Beeminder API: Cannot set roadall

I’ve been trying to modify one of my roads using the API.

But whatever I do I get: “error”:“illegal road parameter”

This includes feeding the original unmodified roadall back to it, which I expect should work.

Any hints?

1 Like

Here’s something weird about how we deal with nested lists that could be what’s thwarting you: You have to actually send the road matrix as a string that evals to proper json. Was that already clear?

Thanks, json encoding the road matrix solved the problem.

This was not already clear, and I had another look through the API docs and couldn’t find it mentioned in there either.

1 Like

Note:
The timestamps in the ‘roadall’ parameter do not take into account the user timezone.

This can cause points to be on the wrong days and unexplained invalid road errors if you don’t compensate.

Beeminder seems to be on GMT-7*

*which means 7 hours behind GMT

1 Like

@dreev Is this still the case that the API requires json-encoding roadall before json-encoding the whole object?

1 Like

That sounds correct. It’s on our long list of things that we intend to make less confusing/annoying in the eventual version 2 of the API.

Hmm. It didn’t solve my problem, unfortunately.