headers:
- x-app-id
- x-app-key
- Content-Type: application/json
POST request body:
{
"query":"ran 3 miles",
"gender":"female",
"weight_kg":72.5,
"height_cm":167.64,
"age":30
}
See comment below for sample API response.
Original documentation: https://docs.google.com/document/d/1_q-K-ObMTZvO0qUEAxROrN3bwMujwAN25sLHwJzliK0/edit#
401 error comes when you don't have permission to that particular API endpoint.
In your code you didn't passed your API key. Use
'x-app-key'
as key and give itAPI_KEY
as value in your header.Few more things to do. Add
query
key in your parameters dict and pass theexercise_input
Your parameters are also incorrect. I'm attaching the correct code below: