cancel
Showing results for 
Search instead for 
Did you mean: 

updateActivityById - Resource Not Found Error

eioaa
Mt. Kenya

Hi,

I'm trying to update an activity using the endpoint updateActivityById with a PUT request in Python. However, I'm consistently getting a "Resource Not Found" error. Here's my code:

 

def update_acti(idd):
   activity_write_read_all_token = ***

    url = f'https://www.strava.com/api/v3/activities/{idd}'
    
    header = {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer ' + activity_write_read_all_token
        }
    
    data = {
        'gear_id' : user['shoes'] #shoes identifier, string
        }
    
    r = requests.put(url, headers = header, json = data).json()
    return r

response = update_acti(***)

 

I get an error 404 : Ressource Not Found.

I first checked that the activity existed with getActivityById and it does. The user['shoes'] returns the correct gear id as a string. Even with this line commented I still get the error.

Then I supposed the error came from my PUT request "syntax" or from the access token. So I tested the updateActivityById  endpoint using the Swagger Playground. Considering the scope issue in the playground I used a public activity requiring only the activity:write scope. And once again I got a 404 : Ressource Not Found.

I am all out of ideas to solve this so if you have a clue on what could be the problem on my part or if it could be a bug on the endpoint, I'd be glad to hear it. Thanks.

0 REPLIES 0
Ready, Get Set, Go!

Welcome to the Community - here is your guide to help you get started!


Know how to use Community


Understand Community Settings