Forum Documentation Showcase Pricing Learn more

[New Feature] API Connector version 2


#1

Hello,

We’ve just pushed an important change to the API Connector.

For various reasons, we decided to rewrite the plugin. That enables us to offer a slightly better UI, and especially remove the limitation we’ve had for a while about getting nested arrays. So in practice we now have 2 plugins, API Connector and API Connector (Old). New apps will only be able to install the new versions, but apps using the older plugin will still work as is.

The biggest improvement of the new version is that you can now access any field in a JSON response, including arrays of objects. Bubble will automatically create a new type of thing that can be used in repeating groups, groups, etc. We’ll add more things to the new plugin as more needs come.

While you don’t have to do this, we strongly recommend migrating your calls from the old to the new plugin (after installing the new plugin). We’ve added a feature to the right-click menu to help you do this, if you copy an API from the old plugin you’ll be able to “Paste from old” in the new system. That will copy the URLs, the credentials, etc. but you’ll still have to initialize the calls and match the types if needed. Once you do this you’ll have to update the elements, actions that use the calls, and the issue checker will be handy then. Also, as your app has development and live versions, the changes should not be visible to your users and can be tested.

If you do so and migrate your calls, please uninstall the old version so that we can track how many apps still use the old plugin.

Again, this is entirely up to you to do this, but as we’re going to maintain the new version only, if you want to access the latest set of features, or if you need us to look into a bug, we’ll ask you to upgrade your calls to the new system.

As usual, let us know if you hit some issues, preferably through a bug report.


#2

This is awesome, thanks @emmanuel! :slight_smile:


#3

Thanks Emmanuel this is great.


#6

Of course, will do.


#7

Awesome thanks!


#8

@emmanuel
looks like the ‘paste from old’ function has stopped working (it was working a day ago)


#9

Very slick, thank you.

Also, thank you for deprecating features gracefully


#10

Quick update here: We’re pushing a fix that will make that when you update the data types, you’ll have to update the expressions that use that API (we had to do this to make sure field names don’t interfere with Bubble names, for instance if a field is ‘count’, we don’t want it to interfere with Bubble’s count option for list).

Sorry about this, it’s a one-time thing and the search palette will help to find the relevant calls. And until you update the data types of a call things will work just fine.


#11

@emmanuel

“The biggest improvement of the new version is that you can now access any field in a JSON response, including arrays of objects”

is this also true for the blockspring integration? Can we get data from nested objects here too?

That would be awesome


#12

Well, if you add blockspring to the API connector yes, but otherwise no. This is an improvement to the API connector.


#13

thanks Emmanuel. Thats a pitty because for me as a total non-coder it is very hard to use the API Connector and Blockspring is a big help in that regard. But without the nested fields I cannot use a lot of the tools/services that blockspring offers in bubble.

It would be so cool if you would consider to maybe implement this for blockspring too.

Anyways, keep up the good work


#14

Great!


#15

@Emmanuel - Fantastic, very nice to have the ability to finally deal with nested data. This will be a huge help - thank you!

Any hope for JWT support yet? :slight_smile: I wish Google had provided another way to authenticate as a Service Account, but they’ve stubbornly provided only one means - OAuth2 with JWT. :frowning:


#16

@ezmaass were you able to authenticate a google service account by any chance ?


#17

@gaurav which one are you looking for?


#18

@romanmg
any service account … ideally google cloud platform


#19

If you want to PM me some details I can probably help you set it up - the user endpoints are different for each service. For example for Google Calendar:

Scope: https://www.googleapis.com/auth/calendar
User Profile Endpoint: https://www.googleapis.com/calendar/v3/calendars/primary

For Google Drive…
Scope: https://www.googleapis.com/auth/drive
User Profile Endpoint: https://www.googleapis.com/drive/v3/files


#20

So these are OAuth api’s right ?
I’m looking for service account api i.e. where users dont have to authorize their accounts (service-to-service)
Google seems to give the keys in a file and I’m wondering if you were able to get the token and use it in bubble without using a programming language


#21

Hey Gaurav and Gaby,

Did you figure this one out in the end of the day?
Would be great to know the solution if there is one.

Google offers so much cool stuff, but the authentication part is a pain.


#22

Sorry for the late reply - no, I’ve not figured it out yet.

In order to progress development, I’ve created a temporary database key where I store an OAuth token that I’m manually generating on the Google OAuth 2 Playground. If you insert it with the requests to Google, obviously it’ll accept it… but that only works for an hour at a time before it needs to be refreshed.

Ultimately, in order for this to work, Bubble’s API Connector needs to support 2-leg OAuth. Unlike consumer-facing Google services, like e-mail and calendar (where the user owns the data), most of the Google Cloud Platform APIs are more appropriate for Service Accounts (service-to-service) where the app (in this case Bubble app) owns the credential and related data.

I’ve had discussions with Google’s support on this as well, and unfortunately OAuth with a JWT is the only supported authentication/authorization across the board.

I’ve reached out to @emmanuel on this a few times last year. Without JWT support and OAuth2 2-leg support on the API Connector, I don’t see a way to make it work. I haven’t completely given up hope, but I’ve put in hundreds of hours of development into an app that probably won’t see the light of day without this, either.

Please let me know if you make progress. I’ll do the same.

Eric