Hey so I’m trying to change the rate through the API. As best I can determine from documentation and from observing changes, I should just have to update roadall so that the current rate ends a week from now and append a new rate to the end of roadall that ends sometime in the future.
Current my code which does this returns a 500 error and nothing more descriptive than “internal server error”
Below is a code snippet that shows what I’m doing. Any help in this matter would be greatly appreciated.
old_rate_end_date = (datetime.datetime.today() + datetime.timedelta(days=7)).strftime("%Y-%m-%d")
new_rate_end_date = (datetime.datetime.today() + datetime.timedelta(days=3650)).strftime("%Y-%m-%d")
self.roadall[-1][0] = old_rate_end_date
self.roadall.append([new_rate_end_date, None, new_rate])
payload = {
"auth_token": TOKEN,
"roadall": self.roadall
}
print(payload)
request = URL + "/users/" + USERNAME + "/goals/" + self.name + ".json"
resp = requests.put(request, data=payload)