I'm struggling successfully hitting the DELETE Food Log service from my PHP application using Curl. From what I'm reading, my request is accurately constructing with setting the curl option CURLOPT_CUSTOMREQUEST = 'DELETE'. I'm also using a FitBit user-id that can already get and post food logs.
Here's what I'm returning from the API request:
Array ( [errors] => Array ( [0] => Array ( [errorType] => not_found [fieldName] => n/a [message] => The API you are requesting could not be found. ) ) [success] => )
Has anyone else had trouble deleting from PHP?
Answered! Go to the Best Answer.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
It should be DELETE https://api.fitbit.com/1/user/-/foods/log/food-log-id-here.json . This was incorrectly transferred from our old wiki documentation. I will fix it. Apologies for the error.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Jeremiah,
I'm trying to request:
DELETE /1/user/[user-id]/food/[food-log-id].json
/1/user/xxxxx/food/xxxxxxxx.json
Would it help if I gave you the exact URL?
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
It should be DELETE https://api.fitbit.com/1/user/-/foods/log/food-log-id-here.json . This was incorrectly transferred from our old wiki documentation. I will fix it. Apologies for the error.
Best AnswerThanks Jeremiah
Best Answer