10-16-2022
03:57
- last edited on
10-17-2022
13:08
by
Gordon-C
10-16-2022
03:57
- last edited on
10-17-2022
13:08
by
Gordon-C
I m hitting the web api to set Goals via post method, payload and required headers but there is no update reflected in the app also instead of 201 as mentioned in docs, I get status of 200 . Any help is appereciated ASAP
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.
We support several goals through the Web API. Would you please provide me with the endpoint syntax that your calling including any of the parameter values? You can leave out any PII data such as user ids.
Thank you!
Gordon
Best Answer
Also my code here
| async function submitGoal(e) { | |
| e.preventDefault(); | |
| try{ | |
| let querystring=`type=${parameter}&value=${Number(activityval)}` | |
| let request=await fetch(`https://api.fitbit.com/1/user/-/activities/goals/daily.json?type=${parameter}&value=${Number(activityval)}`,{ | |
| method:"post", | |
| headers:{ | |
| "authorization":`Bearer ${token}`, | |
| "content-length":`${querystring.length.toString()}`, | |
| //"content-type":"application/json" | |
| }, | |
| //body:querystring | |
| }) | |
| let response=await request.json(); | |
| console.log(response); | |
| } | |
| catch(e){ | |
| console.log(e) | |
| } | |
| } |
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.
What device do you have paired with your account? When you query the Get Activity Goals endpoint, do you see your changes listed?
Best Answergreetings GordonFitbit , my device is inspire 2 and yes i do see my updated changes when i query the Get Activity Goals endpoint but same is not reflected in the app
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.
This is a known issue. We have seen the activity goals updated after the user syncs forces a sync to occur in their mobile application. At this point, I don't have a date when a fix will be available. I'll attach this request to the existing bug. When the functionality is fixed, I'll update this forum post.
Best,
Gordon
Best AnswerThanks for your response GordonFitbit , but it be resolved soon cause i have a deadline to complete the project , if its not resolved soon then i will be unable to deliver the project
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.
I've been told the problem is resolved for Android, but not iOS. I don't have a date when the fix will be available on iOS. You should be able to see the updated goal if you force a sync within the mobile application on iOS after Create Activity Goal endpoint has made the change. Would you please test this?
Best AnswerThanks , GordonFitbit really appreciate your help but unfortunately i m not an iOS user ,but in case i am able to test it on an ios device i will update you for the same
Best Answer