Success and Errors

Anodot APIs use HTTP status codes to indicate the success or failure of a request.

An error indicates that the service did not successfully handle your request. In addition to the status code, the response may contain a JSON object with an errors array containing more detailed error messages (see Error response format bellow).

If the service is able to handle your request, but some issues are present (e.g. one of the metric sent has an illegal timestamp but all the reset are ok), the HTTP status code will indicate success and the response body will contain the expected result with the addition of errors array containing detailed error messages.

HTTP STATUS CODES

  • 200   OK
  • 400   Bad Request
  • 401   Unauthorized
  • 404   Not Found
  • 500   Server error

EXAMPLES of ERROR DESCRIPTIONS and ID 'S

Json parsing error 1001
General error 1002
Token is not active 2001
Too many concurrent requests 2002
Metrics per seconds limit reached 2003
Metric properties are not defined. Must have at least one property. 2004
Metric properties limit exceeded. Metric may contain up to: {xxx} properties. 2005
Undefined property key. Metric property key must contain at least 1 character. 2006
Property: ''{xxx}'' key length exceeded. maximum key length is {yyy} characters.  2007
Undefined property value. Metric property value must contain at least 1 character. 2008
Property: ''{xxx}'' value length exceeded. Maximum value length is {yyy} characters . 2009
Property key: ''{xxx}'' contains illegal characters. Property key can contain ascii characters only, ''.'' character and space characters are not allowed. 2010
Property value: ''{xxx}'' contains illegal characters. property value can contain ascii characters only, ''.'' character and space characters are not allowed. 2011
Property: ''what'' is undefined. ''what'' is a mandatory property that specified what is being measured by this metric. 2012
Metric tags limit exceeded. Metric may contain up to: {xxx} tags. 2013
Undefined tag key. Metric tag key must contain at least 1 character. 2014
Tag: ''{xxx}'' key length exceeded. Maximum key length is {yyy} characters. 2015
Undefined tag value. Metric tag value must contain at least 1 character. 2016
Tag: ''{xxx}'' value length exceeded. Maximum value length is {yyy} characters. 2017
Tag key: ''{xxx}'' contains illegal characters. Tag key can contain ascii characters only, ''.'' character and space characters are not allowed. 2018
Tag value: ''{xxx}'' contains illegal characters. Tag value can contain ascii characters only, ''.'' character and space characters are not allowed. 2019
Metric timestamp is undefined. Timestamp must be an epoch time in seconds. 2020
Metric timestamp: ''{xxx}'' is not a valid epoch time. Timestamp must be an epoch time in seconds. 2021
Metric timestamp: ''{xxx}'' is in the future. Timestamp must be an epoch time in seconds. 2022
Metric timestamp: ''{xxx}'' is negative. Timestamp must be an epoch time in seconds. 2023
Metric value is undefined. The ''value'' must be a valid decimal double precision number. 2024
Metric value: ''{xxx}'' is not a valid decimal number.  The ''value'' must be a valid decimal double precision number. 2025
Metric value is NaN or Infinite 2026
Metric name is null or empty 2027
Metric name length exceeded the maximum allowed: {xxx}. 2028
Invalid protocol - supported protocols are: {xxx}. 2029
Invalid target type: ''{xxx}''. valid values are: {yyy}. 2030

 ERROR RESPONSE


  “errors”:[ 
    {
      "index":<failed sample index>,
      “error”:<error code>, 
     “description”:”error description” 
    } 
  ] 
}

Was this article helpful?
0 out of 0 found this helpful