Appearance
Errors
Error replies are JSON with an error message, and sometimes more fields.
json
{ "error": "body larger than 16384 bytes" }Sending readings
POST /api/v1/machines/{id}/data
| Status | Meaning | What to do |
|---|---|---|
| 202 | Accepted. See the reply. | Check unknownKeys |
| 400 | The body is not valid JSON, is empty, is not an object or array of objects, or the array has more than 200 entries | Fix the body |
| 401 | Wrong username or password. The message says which: no credentials sent, a username that is not this machine's id, or a password that does not match. | Use the machine id as the username. Issue a new password if it is lost. |
| 404 | No machine has this id | Check the id in the address |
| 413 | Larger than 16 KB | Send fewer entries per message |
| 422 | Nothing could be stored. Either no key matches a reading of this machine, or every value had the wrong type. The reply lists unknownKeys, nonNumericKeys, hints and the machine's pointKeys. | Add the readings on the machine's setup page, or rename the keys |
| 503 | Kealink could not accept the reading right now | Keep the readings and retry after a few seconds |
Refusals are also listed on the machine's setup page, so a gateway nobody is watching still leaves a trace.
Reading data
| Status | Meaning |
|---|---|
| 400 | point missing, resolution not raw, hour or day, a time not in ISO 8601, from not before to, or a range longer than allowed |
| 401 | No API key, a malformed key, or a key that is not valid or was revoked |
| 404 | No such machine or reading for this API key |
MQTT
MQTT has no replies. A wrong password or username is refused at connect (Not authorized). A message on another machine's topic is dropped. A message that is too large or malformed is dropped. Check the machine's setup page and Troubleshooting.