01-12-2019 21:16
01-12-2019 21:16
I have successfully verified a subscription web endpoint. Now on changes to any fitbit activity I am getting request on my webhook. But I cannot process those data.
I am always getting "POST /webhook HTTP/1.0" 400 - on my webhook end point.
Here is my python code for webhook:
@main.route('/webhook', methods=['POST']) def get_updates(): updates = request.form['updates'] print updates #pdb.set_trace() resp = make_response('', 204) resp.headers['Content-Length'] = 0
return resp
Here first I didn't process the response, I will process it once I confirmed that there is no error.
01-14-2019 13:38
01-14-2019 13:38
Hi @salayhin
Are you trying to fetch the new data from your webhook endpoint? After receiving the webhook notification, you should execute the appropriate Web API endpoint to get the data you need. For example, if you receive this webhook
{
"collectionType": "activities",
"ownerId": "22PT4L",
"ownerType": "user",
"subscriberId": "3",
"subscriptionId": "123"
}
Then you should execute one of the Activities API endpoints listed here: https://dev.fitbit.com/build/reference/web-api/activity/.
01-14-2019 18:07
01-14-2019 18:07
01-17-2019 08:11
01-17-2019 08:11
Would you provide the API call you're executing to process the data and is returning the 400 error message? The 400 Bad Request message is "Any case where either endpoint doesn't exist, resource path parameters are invalid, POST request parameters are invalid or no Authentication header is provided. This doesn't include invalid specific resource ids."
I'd like to verify the syntax of the API call you're executing.