[New Feature] API Connector plugin - ability to add fields not returned in initial API call

Hi Everybody,

We’re adding a feature to the API connector plugin by which you can initialize an API call by manually pasting in representative JSON, thus adding fields that might not be present in a test call. Just click the “Manually enter API response” button, paste in your JSON, and then edit fields and data types as you ordinarily would.

We’ve also included the ability to edit JSON gotten from an automatic call. You can do this by scrolling to the bottom of the Edit Data Types popup and clicking “Edit raw data”.

29 Likes

OMG, a thousand hearts for this!

1 Like

@marca, this is fantastic to hear! Cannot wait to test it out. :slight_smile:

This is a major update - And very welcome. Having to make a “perfect” Initialize Call that contained every field I think I would ever need was cumbersome… And in some cases, very very difficult to do. Looking forward to testing it out.

Great addition. Thanks everyone

Much needed feature. Thanks!

So much time saved! :grinning:

1 Like

…Eeexcellent…
excellent

4 Likes

Thank you SO much for this awesome feature!

@marca I see one potential area for improvement. After setting up the initial call, if you click the “modify call types” button or the “Manually enter API response” link to modify the call, it wipes out the previous code/fields.

Is there a way for it to keep the manually added code?

Default behavior is to make a test call again when you click “Modify call types”, but to retain additional fields from custom JSON. This decision was made to keep things reasonably simple, but we’re open to input on how this best ought to work.

Sample JSON is not stored for performance reasons. If you have strong feelings that it ought to be, let me know.

Hi @marca - thanks for improving the API connector. I’ve initialized my call and saved all the types, but there’s one field “error” that is not saved because it only happens when there’s a server side error. If I save just “error”, it wipes out all my other fields as per what @Kfawcett has experienced.

With this new feature, Is there a way to add in field “error” in addition to what I’ve already saved from my initialize successful call? Or, do I have to somehow manually copy all the successful call fields and manually enter “error” as an additional field?

Thank you

Yes there is. Initialize an automatic call, show the raw response, and then click “Edit raw response”, which we just added. This will open the JSON editor and allow you to add the necessary field.

2 Likes

@marca Marca, will this handle being able to call directly from a JSON output file rather that calling an api? Sometimes people will want to pull data from a JSON return file directly and use it just like bubble had called an api… Will what you are talking about handle this? If not, can this be currently done?

This is the notion. Just click “Manually enter API response” and paste in your JSON.

Ok. I am going to give it a shot, but my JSON is about 55,000 rows…

It is not letting me put any data in… Cannot paste the code?

That definitely shouldn’t be happening. Submit a bug report and we’ll have a crack at reproducing what’s going on there so we can fix it.

And let us know how it works with the large JSON file.

Is there an example or tutorial on how to do this? I’m just wondering exactly what the json that you paste looks like. Thanks!

1 Like

You don’t need all the rows, just a representative sample that covers the combinations.