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

[SOLVED] HTTP Error 400: Bad Request when Adding Alarm through HTTP POST

ANSWERED

My code was working two weeks ago, but suddenly I am not able to add alarms anymore. 

I am using python 3.6 and urllib. Any suggestions?

 

Here is a snippet of my code:

 

post_data ={'time':alarm_time,'enabled':'true','recurring':'false','weekDays':'MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY,SUNDAY'}

 

data = urllib.parse.urlencode(post_data).encode()
request = urllib.request.Request(request_url, data = data)
request.add_header('Authorization', 'Bearer %s' % self.access_token)
http_obj = urllib.request.urlopen(request)
json_obj = json.loads(http_obj.read().decode("utf-8"))
 
 
Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Solved my issue. I had 8 alarms set on my FitBit already, and that is the maximum.

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

Solved my issue. I had 8 alarms set on my FitBit already, and that is the maximum.

Best Answer
0 Votes