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

Posting alarm update results in 'bad request'

I'm trying to use FitBit.Net to post a timer update. I send the following JSON as content:

 

{"time":"07:10+02:00","enabled":true,"recurring":false,"weekDays":[],"snoozeLength":5,"snoozeCount":3}

However, this is what I get back:

 

Üpdate response: BadRequest, reason: Bad Request, content: {"errors":[{"errorType":"validation","fieldName":"snoozeLength","message":"Snooze Length is required"},{"errorType":"validation","fieldName":"recurring","message":"Recurring is required"},{"errorType":"validation","fieldName":"snoozeCount","message":"Snooze Count is required"},{"errorType":"validation","fieldName":"time","message":"Time is required"},{"errorType":"validation","fieldName":"enabled","message":"Enabled is required"}]}

Why am I getting this error, should I be sending the values in a different format?

 

Thanks!

Best Answer
0 Votes
3 REPLIES 3

@DrPoncho If you're updating an existing alarm, looks like you're missing some stuff.

 

Here's a good way to try it out:

 

1. Go to this link here.

2. In the top right, hit "Authorize".

3. Make sure to check the "settings" scope, then scroll down and hit "Authorize" within the popup.

4. Once you've done that, click on "Devices" and play around with those endpoints. Specifically, you might want to look at the "Update Alarm" endpoint (5th one listed under Devices).

 

Let me know if that helps. Robot Happy

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

Thank you for your reply. I've used swagger and it works, but I can't get it to work through fitbit.net in my application.. This is a screenshot of Fiddler from the communication:

 

Fiddler response FitBit.png

 

The top part is what I'm sending, the bottom is what I'm receiving. It says I didn't include the values, but as you can see they are included ..

Best Answer
0 Votes

@DrPoncho You're missing the "tracker-id" and "alarm-id".

 

https://dev.fitbit.com/docs/devices/#update-alarm

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes