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#
Solution below
Leaving this here so people can feel better about themselves.
When calling the
.post()
method I was givingparams
as an argument and notjson
. Fixed it in the code below to reflect the correct way.I keep getting 400 for the following params:
{'message': 'child "query" fails because ["query" is required]', 'id': '09ef9905-8b97-4f45-a593-7faabb239c89'}
Tried giving the post() method a "query" argument as well but that's invalid. Clearly something is off with my syntax, just don't see how it's different than what was stated in the example.