Hello to all!
I’m writing to you today because I’m stuck on an API problem.
I want to create an online airplane tickets booking platform thanks to the Duffel.com API.
I watched several tutorial videos in order to understand how API integration works in Bubble (API connector plugin, different types of requests etc…).
The Duffel API allows you to search for airline tickets via a POST call and returns a list of tickets matching the parameters of the search.
See this page of the documentation: Getting Started with Flights<!-- --> | Duffel Documentation
I have successfully configured the first call to send a request to search for airline tickets by importing this into Bubble :
curl -X POST --compressed “https://api.duffel.com/air/offer_requests?return_offers=false”
-H “Accept-Encoding: gzip”
-H “Accept: application/json”
-H “Content-Type: application/json”
-H “Duffel-Version: beta”
-H “Authorization: Bearer myapikey”
My problem: I can’t display the result of this query in my app, even in a simple text element (I tested the query in Postman and it returns a list of airline tickets).
I got a button with a workflow that launch the query, but I don’t know what to do after.
I think that (maybe ?) I’m supposed to configure another GET call to access the search results but… This call must contain a dynamic parameter (the ID of the first query), so I don’t see how to configure it in Bubble.
I think there is something I don’t understand, but I don’t see what.
I’ll stop here before making a long post, but if there is an API expert here who would like to help me I’d love it!
Thanks in advance and have a great day