Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API request failed with code 422: {"errors":{"message":"Error parsing params (roadall)"}} #6

Open
tom-doerr opened this issue Mar 10, 2020 · 2 comments

Comments

@tom-doerr
Copy link

When I run

dummy3.stage_rate_change(1, 1586815200, 1586820000) 
dummy3.commit_road()

I get the following output:

Exception: API request failed with code 422: {"errors":{"message":"Error parsing params (roadall)"}}

Am I using stage_rate_change correctly? Is it correct to input the start and end timestamps as Unix timestamps?

@narthur
Copy link
Owner

narthur commented Mar 10, 2020 via email

@tom-doerr
Copy link
Author

This is the data that is being sent (I removed the tokens):

data: {'auth_token': ''}
data: {'roadall': [[1576429200, 0, None]], 'auth_token': ''}

The Unix timestamp 1576429200 is neither the start nor the end timestamp I set, but the timestamp of the first datapoint for the goal.
I guess the error occurs because the timestamp corresponds to Sun Dec 15 18:00:00 CET 2019.
After that I looked into self._dense_path and noticed that the rate is not changed there since the steps are bigger than the timestamp range that I set for stage_rate_change.
After increasing the range to 1586815200(Tue Apr 14 00:00:00 CEST 2020) - 1587820000 (Sat Apr 25 15:06:40 CEST 2020), pyminder transmits the following:

data: {'auth_token': ''}
data: {'roadall': [[1576429200, 0, None], [1587747600, None, 1], [1907600400, None, 0]], 'auth_token': ''}

The error message is the same one as before.
Should the roadall array contain more datapoints? The range for the rate change is 11 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants