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

Deleting Activities using the API

When trying to delete activities using python code that accesses the API; if the activity was created on/by the watch it cannot be deleted. However, if the activity is created automatically on the watch or by the API it can be deleted.
Can anyone help me figure out how to adapt my code to allow for deleting activities created by the watch? 

This is the line of code:

        response = self.session.delete(f"https://api.fitbit.com/1/user/-/activities/56247056863.json")

The response I get if it is an activity that was created by the watch is:
{
    "errors": [
        {
            "errorType": "validation",
            "fieldName": "logId",
            "message": "Invalid activity log id: 56247056863"
        }
    ]
}


I can access all activities, all sleep, GPS information, delete sleep and access profile information. I'm not sure why deleting the activities that I start on the watch myself are causing an issue.
Best Answer
0 Votes
4 REPLIES 4

HI @hons00000 

I can investigate this problem for you.   Would you let me know what type of Fitbit watch you're using?

Thanks!

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Hi @hons00000 

I wanted to let you know that I was able to reproduce the problem using a recorded activity by my Charge 5.  When attempting to delete the activity, I received the same error message as you.   I have submitted a ticket to our engineering team to investigate further.   I'll let you know once I hear something from them.

Best,

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Thank you. Its a Fitbit versa that I am using, if that helps at all.

Best Answer
0 Votes

Thank you.   I believe the problem applies to all devices since I can reproduce it with a Charge 5.

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes