API Connector - use most JSON APIs directly from Bubble

Very cool… Great Job guys!

1 Like

Hi,

First of all, congrats guys for this new feature !:smiley:

I would like to know if this feature can allow us to stock and display some HTML content such as heading tags, text, etc. on the API connector and then display them as a fully understandable and readable written code by robots in body pages of an app?

So far as I know, Bubble does not offer yet the ability to set different tags in the body of all pages of an app. Feel free to correct me if I’m wrong ! :wink:

If not, maybe an easier, less api call function on page load and with less settings operations for bubblers option would be to have something like this on page settings ? :

a) Add a button called " Add a tag into the Body"

b) Adding sections for the code we want to add for example “My h1 heading” or wich would enable bubblers to have access on styles settings, x and y values at least on it :

Does it makes sense and is it something easy to implement?

Thanks a lot! :smile:

Does this support nested calls?

I’m currently testing the following out:

But when I initialize it, it gives me ----> {“errors”:{“fulfillment_service”:“expected String to be a Hash”}}

I’m not too familiar with API calls so I’m guessing “fulfillment_service” is nested but Bubble can’t support this yet?

Thank you. Makes sense. Am I able to get an access token. How do I pass that into the next GET call? Their documentation tells me to pass the access token as a bearer token by including an Authorization header with the value of Bearer, but I can’t get the call to initialize in Bubble due to an “invalid_token” error. Obviously I’m not including credentials (client_id, client_secret, code) in this get call. Should I be?

It should work. Did you set the Content-Type header to application/json?

This depends on the token expiration. If the token is valid for say minutes or an hour, you can include it as a client-safe header for the second call. If the token nevee expires obtain it and then manually save it as a private header parameter on the call.

We’ll enable native OAuth support soon, it looks like it’s needed. This will make the process transparent and secure, since it will be handled by our server.

1 Like

Thank you Jean-Pierre.
What are you trying to achieve? If you’d like to edit the page HTML, look into the HTML component to add things. I’m not sure it would help with SEO if that’s what you’re looking to do.

Not sure, but if you want to you can add an HTML embed with the HTML component.

1 Like

Hi Bam,

We only load the first element of an array (changing that soon) so that might be what you are seeing. Can you please include a screenshot of the result of the initialize call mapping, and of the editor where you use this? Email us at support if you have confidential data.

Hey @georgeciobanu

how would i use the API connector and place a value in the url below. This API provider requires the data to be passed in the url (Red area). this is aside from other data required in parameters

thanks

Hi Ali,

If there’s no other way to pass the parameter (via body, header or parameters) we can create a client-safe checkbox for the url and let you configure it as well.

1 Like

So it will be like the parameter section? OK let me know when as blockspring now requires me to have a paid membership and I rather use this plugin.

I just enabled the URL as a parameter. Let me know how it goes!

Works well thank you @georgeciobanu . Another question how would i handle error responses. You know responses that are not code 200 is there a way for the plugin to return these responses to be validated? Right now from development environment it returns

and from app preview it returns this

Thanks

1 Like

In the editor what you see is the actual response from the sever. We pass it through. In production that’s unsafe to do since it might contain provate information (your secret API key for example, some APIs include that in the response) so we keep in on the server, away from your users’ access.

Thanks for the reply @georgeciobanu But my question is really on how to handle the errors instead of having the site produce a popup saying we ran into a temporary bug. When building the site we do our best to reduce input errors as much as possible but as you know this will not be a 100%. If we can have the option in the meantime to set a standard reply to the users on errors produced this will serve the purpose. The other option is a was to capture non-success codes. for example 400 errors.

Thanks again looking forward to your response.

Being able to trap errors more elegantly would be really useful.

Eagerly waiting for JSON array handling. Particularly nest arrays, and optional ones. So in my test case I want to return Google Places, which is an array, but within each place is an array of Images for each place. But that may not exist. Going to be interesting to see how works in practice :slight_smile:

I was recently pointed at https://wrapapi.com/ which is a bit beta at the moment, but could be a way to reskin API based websites with a responsive bubble front end.

1 Like

Thanks for the reply George.

What I am trying to achieve is to have the following structure on pages source code :

I am just trying to follow Google recommandations (see p20 on the following link) : http://static.googleusercontent.com/media/www.google.com/fr//webmasters/docs/search-engine-optimization-starter-guide.pdf

I have already edit the page HTML with the HTML component but not sure robots can read it as it does not appear on source code.

If you can guarantee that using HTML component have the same impact as a fully code site, it’s ok for me :smile:

Why don’t you put that on the body of the page?

Hi Emmanuel,
Thanks for your reply.
Where can I have access on it?
I can access on the body of the app via Settings>Metatags>Script in the body but it does know allow us to have a different body per page and this is what I am trying to do for having different heading tags on each pages of my app.
Or maybe you have a alternative solution that I don’t know for doing what I’m trying to do? :smile: