-
-
Notifications
You must be signed in to change notification settings - Fork 484
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 error #741
Comments
You're missing the unit. I would recommend going to https://your.pi.IP.address/api/ and finding the endpoint you want to test, then clicking "Try it out" and entering the required information, and clicking execute. |
I see your URL also has two unique IDs, when it should only have one. |
I see your URL also has two unique IDs, when it should only have one. -> yes, I know this, I just show that there is no values check. |
The API is relatively new, so sanity checks aren't fully covered. I'll add a check for the unit's existence and return an informative error if it doesn't exist. |
Thank you. |
Were you able to get the endpoint working? |
Yes, this was my request |
Describe the problem/bug
Server error un such request:
https://192.168.1.11/api/measurements/last/76305962-e363-4deb-a38c-78c12cd24b28/0c3ede1b-0999-4597-b57c-289233885197/0/10
Versions:
Reproducibility
{
"error": "Traceback (most recent call last):\n File "/home/pi/Mycodo/mycodo/mycodo_flask/api/measurement.py", line 259, in get\n unique_id, unit, channel, duration_sec=past_seconds)\n File "/home/pi/Mycodo/mycodo/utils/influx.py", line 440, in read_influxdb_single\n last_measurement = client.query(query).raw\n File "/home/pi/Mycodo/env/lib/python3.7/site-packages/influxdb/client.py", line 450, in query\n expected_response_code=expected_response_code\n File "/home/pi/Mycodo/env/lib/python3.7/site-packages/influxdb/client.py", line 302, in request\n raise InfluxDBClientError(response.content, response.status_code)\ninfluxdb.exceptions.InfluxDBClientError: 400: {"error":"error parsing query: found 0c3ede1b, expected identifier at line 1, char 25"}\n\n",
"message": "An exception occurred"
}
The text was updated successfully, but these errors were encountered: