Forum Academy Marketplace Showcase Pricing Features

JSON Body in API connector

I’m using Lyft. This is the body needed by the post call:

{"ride_type" : "lyft", "origin" : {"lat" : 37.77663, "lng" : -122.39227 }, "destination" : {"lat" : 37.771, "lng" : -122.39123, "address" : "Mission Bay Boulevard North" } }

This returns a 200 OK code, but variables are needed

For “lat” and “lng”, how do I include the quotation marks?

When I put the <>s around the “lat” and “lng”, the call fails.

Thanks for your help!

Put the < > around the actual values and just label them with whatever makes the most sense for using within the app. Those labels will be the parameter keys when configuring the call in Bubble workflows, but they’re not the syntax being sent to Lyft. See example below.

The values inside the < > are really what are getting replaced via a key/parameter thing that Bubble creates for you so that you can make these POST body areas dynamic. Hope that makes sense.

{“ride_type” : “lyft”, “origin” : {“lat” : < origin-lat >, “lng” : < origin-lng > }, “destination” : {“lat” : < destination-lat >, “lng” : < destination-lng >, “address” : “Mission Bay Boulevard North” } }

PS: I had to put spaces between the <> in my example because it got reformatted weird in this post.

1 Like

Thank you!