I’ve set up a custom API using the Bubble API Connector that scrapes websites like Google, Yelp, etc for review information (star ratings, reviewers’ names, the full text of their reviews, etc). I believe I have structured the calls correctly, as they are returning JSON objects.
Here’s the thing: I want to display the JSON data that is returned on Bubble elements. The goal would be to make something that (loosely) looks like this:
(with Bubble elements for the reviewer’s photo, star rating, reviewer’s name, full text, review source, etc)
Is there any way to take the JSON data that is returned from these API calls and pass its data to Bubble elements? Am I missing something obvious?
Thanks in advance!
If I understand you correctly, maybe this quick example using the google search api will help…
Since you already have an api connector initialized, you have values something similar to this:
So for this api, I want to display the items (list) that is returned so I setup a repeating group like so:
with the API provider being your api connector call:
Then within the cell of the repeating group, you can point to the current cells values:
Which results in:
Is that what you meant?
Looking to accelerate your app development?
Let me turn
Development through Coaching at https://uniqueideas.com or schedule a free intro session
It is what I meant…and that’s what I thought I should be doing.
One more question, though: the API I am using has several steps. First, you have to add a job to the queue and pass the URL of the review site you want in as a parameter by POSTing to the API.
After the job is added to the queue, you need to call the API again to GET the results of the previous job, which displays the JSON objects whose data I want to use (API documentation here - may do a better job of explaining it than I can )
So, I have this multi-step API call process.
Is there a best way to set this up? Should I make this entire sequence of multiple calls an API Workflow and then call that API Workflow when the button to retrieve reviews is clicked?
Update: I figured out that I am calling the API just fine, even with multiple steps. The only problem is that I have to wait until the 2nd step of the API (the “get results” step) is finished before I can set the values of Bubble elements based on the JSON data that the API returns.
Is there any way to do this in Bubble? To wait until an API call has finished and returned data before Making Changes to a Thing?
@romanmg, you seem to have done a lot with APIs – is what I’m wanting to do possible?
This topic was automatically closed after 70 days. New replies are no longer allowed.