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

When updating my goals, the changes are not reflected in the app

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 

Best Answer
0 Votes
8 REPLIES 8

Hi @junaidkernel 

 

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  

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

junaidkernel_0-1666063969358.png

 

 

 

 

 

junaidkernel_1-1666064030855.png

 

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
0 Votes

What device do you have paired with your account?  When you query the Get Activity Goals endpoint, do you see your changes listed?

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

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

Best Answer
0 Votes

Hi @junaidkernel 

 

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

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

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 

Best Answer
0 Votes

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?

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

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 

 

Best Answer
0 Votes