Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DELETE Food Log from PHP using Curl returns invalid API response

ANSWERED

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?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

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.

View best answer in original post

Best Answer
0 Votes
4 REPLIES 4

Can you please tell us what the URL is that your application is requesting?

Best Answer
0 Votes

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
0 Votes

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
0 Votes

Thanks Jeremiah

Best Answer
0 Votes