Responses and errors

If all goes well with sending your data, you’ll receive a response like this:

HTTP/1.1 200 OK
Content-Type: application/json

{"status":"ok"}

Possible error responses are listed below.

HTTP/1.1 200 OK
{ "status": "Unauthorized", "message": "Unauthorized - Token not provided!" }
{ "status": "Bad Request", "message": "Bad request - Content-Type should be application/json!" }
{ "status": "Bad Request", "message": "Bad request - Exceeded request count limit!" }
{ "status": "Bad Request", "message": "Validation error - Metric data should be wrapped into 'data' item" }
{ "status": "Bad Request", "message": "Validation error - Data must contain metric value" }
{ "status": "Bad Request", "message": "Validation error - Invalid metric value" }
{ "status": "Internal Server Error", "message": "An unhandled exception occurred while processing your request!" }
{ "status": "Unauthorized", "message": "Invalid token" }
{ "status": "Unauthorized", "message": "You cannot push for deleted space" }
{ "status": "Unauthorized", "message": "You cannot push for expired space" }
{ "status": "Unauthorized", "message": "ou cannot push for inactive space" }
{ "status": "Unauthorized", "message": "Storing custom data is not allowed on your current plan." }

The maximum Content-Length is set to 500 kB. In case you exceed that, you will get an error like this:

{"status" : "REQUEST_ENTITY_TOO_LARGE", "message" : "Your payload has exceeded the maximum size restriction (500kB). Please modify your request and try again.", "id" : null }

All error messages should be self-explanatory and point you in the right direction. But, if you get a warning like this:

{"status":"Warning: some items not inserted (OK: 0, FAILED: 1)”}

you should make sure your data follow these rules:

  • the metric name has a $ prepended
  • the metric value is a number (float is allowed)
  • the date, if specified, conforms to the ISO 8601 standard and is compatible with JavaScript Date.parse().

If you have any questions, feel free to contact our Support Team at help@databox.com