narthur
December 13, 2019, 10:02pm
1
I’m working on a script to add breaks to goals, but I’m getting an error back from the API testing with one of my goals :
422: Error parsing params (roadall)
I’ve printed the roadall my script is generating, and it looks reasonable to me the best I can tell:
[[1576083600, 0, None], [1576947600, None, 1], [1577206800, None, 0], [1907341200, None, 1]]
Can anyone help me figure out what I’m doing wrong?
1 Like
dreev
December 14, 2019, 12:25am
2
Good question! I think it needs to be null
not None
narthur
December 14, 2019, 11:53am
3
Hmm, but None is the keyword for null in Python… So I don’t think that’s wrong… Unless the API wants the literal string “null”?
The key here will be establishing how your object is getting serialized over the network. If it’s getting turned into the characters “None”, I don’t think that’s going to work.
byorgey
December 14, 2019, 3:01pm
5
The API accepts data in JSON format, not Python.
narthur
December 14, 2019, 4:23pm
6
Right, I’m aware. I was printing the data before it was serialized in my API wrapper.
Anyway, thanks for the tips! I’ll take a closer look at the serialization step once I get back to a computer.
byorgey
December 14, 2019, 4:32pm
7
Oh, I see, apologies, I misunderstood. In that case I agree with @adamwolf .
1 Like