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
10-17-2022 13:10
10-17-2022 13:10
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
10-17-2022 20:39
10-17-2022 20:39
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) | |
} | |
} |
10-18-2022 06:24
10-18-2022 06:24
What device do you have paired with your account? When you query the Get Activity Goals endpoint, do you see your changes listed?
10-18-2022 09:18
10-18-2022 09:18
greetings 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
10-18-2022 11:40
10-18-2022 11:40
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
10-18-2022 13:03
10-18-2022 13:03
Thanks 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
10-20-2022 08:44
10-20-2022 08:44
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?
10-22-2022 14:26
10-22-2022 14:26
Thanks , 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