I am trying to Post a request to uber. The token is setup and working well.
I’m getting an error:
{
"message": "Only request header `Content-Type: application/json` is supported for this endpoint. Please check your request headers.",
"code": "invalid_content_type"
}
…which really sucks.
I have the transaction set to be in JSON, but no love.
Any suggestions?
Try adding the following header…
Content-Type : application/json
2 Likes
I did, but that gave me this
{
"message": "Unable to parse JSON in request body.",
"code": "invalid_json"
}
After some sleep it seems like that’s progress. JSON in the head body seems like it should go here
But I’m not sure how to cook that dish in Bubble.
I just looked at the Uber docs, it requires 3 parameters:
Start location
End location
Fare ID
You can use the “add parameter” button for each of these. If the parameter values aren’t an array, like these 3, then you can leave that request body area alone. If you do need to send an array of data, for example a list of people who each contain name, age, address data, then you should format the request in that area because you’ll be able to define the array properly.
Also, I’m assuming you have the OAuth2 configured for this API?
https://developer.uber.com/docs/riders/references/api/v1.2/requests-post
Hi!
That was it!
For posterity, never confuse your Uber product_id
for your rider uuid
. It won’t return a normal fare_id
and you’ll cause Uber to explode.
Thank you, Gaby.
1 Like
I will accept tips in almond croissants and coffee.
I’m setting up a fund now.