I can create successfully sessions with the Fit REST API. But when I try to update one (ie change the name), it creates a new session, even if I use the previously created session ID in the url and in the request body (I do the exact same request as the session creation but I change only the "name" property's value).
The result is that I have 2 sessions with the same ID.
If I try to delete the session and the "copy", I get a response error with the message "Session already deleted".
Is there any way to correctly update a session?
You may refer with this documentation about
Users.sessions
. You need to use theupdate
method which updates or inserts a given session.HTTP request:
PUT https://www.googleapis.com/fitness/v1/users/userId/sessions/sessionId
Check the example and explanations here.