NAV Navbar

API Reference

API Base URLs

Welcome to the Anodot API Reference Site. Use the Anodot APIs to access Anodot Objects.

The Anodot API endpoints can be used to:

-- REST API Resources --

The various API endpoints and their supported functions are listed from here onwards.

Authentication

Basic Authentication

Using the basic token in a REST call:

POST https://api.anodot.com/api/v1/metrics?token=${DC_Key}&protocol=anodot20

Basic authentication is used for:

Anodot basic authentication uses a Data Collection Key. Copy the Data Collection Key from the Token Management page and use it in your REST calls.

Access Tokens

Step 2: Token Request:

curl -X POST \
https://app.anodot.com/api/v2/access-token \
-H 'Content-Type: application/json' \
-d '{"refreshToken": "722354b89ae60761f9fcxcxca613315c"}'

The Response contains the token

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiMDgwNjVlYjA3ZTI4ZTRiZGVlZjkxZGJlMTJiNWUyYjU1MjNjMjA4KTAwNjBjODI1YjYwM2M0MGJkOThlMThlYjQ2ZDMyMWIxZDIiLCJpYXQiOjE1NTM2ODU4OTksImV4cCI6MTU1NjI3Nzg5OX0.TOE5ZNr6yL0wyLsB1RQEA8CV-S6zzUEafkXLwHIY76k"

Step 3: Using the token in the calls

curl -X GET \
https://app.anodot.com/api/v2/feedbacks \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiMDgwNjVlYjA3ZTI4ZTRiZGVlZjkxZGJlMTJiNWUyYjU1MjNjMjA4KTAwNjBjODI1YjYwM2M0MGJkOThlMThlYjQ2ZDMyMWIxZDIiLCJpYXQiOjE1NTM2ODU4OTksImV4cCI6MTU1NjI3Nzg5OX0.TOE5ZNr6yL0wyLsB1RQEA8CV-S6zzUEafkXLwHIY76k"
-d '{"startTime" : 1578391000, "endTime": 1578392000}'

To use access token authentication, follow these 3 simple steps:

  1. Define a token in the Token Management page within Anodot.

  2. Use the token in an Authentication call and get the access token which is valid for 24 hours. Use the /access-token endpoint:
    POST https://app.anodot.com/api/v2/access-token

  3. Use the access token in your REST calls
    Set the Authentication header of your call with the bearer token.

Authentication Response Codes

Code Description
200 The response includes a token
401 Token Mismatch

Feedback

End Point GET /api/v2/feedbacks

Our users and trigger recipients give feedback (Not Interesting/Good Catch) to anomaly alert triggers via:

Use the feedback API endpoint to get the feedback instances given by your organization members, tune your alerts, map your anomalies to business cases and improve the use of Anodot by your teams.

Authentication type: Access Token Authentication.

Get Feedback

Request Example:

curl -X GET \
https://app.anodot.com/api/v2/feedbacks \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer ${TOKEN}"
-d '{"startTime" : 1578391000, "endTime": 1578392000}'

Request Arguments

Argument Type Description
startTime [Required] Epoch Time the feedback was given.
Default value is "Now minus 24 hours"
endTime [Required] Epoch Time the feedback was given.
Default value is "Now".

Response Example:

{
  "total": 1,
  "feedbacks": [
    {
      "id": "a9b6d1ea-70bd-4bab-b567-a16ce60a91f2",
      "type": "GOOD_CATCH",
      "comment": "Another close alert test",
      "createdTime": 1578391511,
      "userName": "test@anodot.com",
      "anomalyId": "http://test.anodot.com/#!/anomalies?ref=pd&tabs=main;0&activeTab=1&anomalies=;0(d863a79ec48b407a808379facc89df7e)&duration=;1(1)&durationScale=;minutes(minutes)&delta=;0(0)&deltaType=;percentage(percentage)&resolution=;medium(medium)&score=;0(0)&state=;both(both)&direction=;both(both)&bookmark=;()&alertId=;(1e0fbe4d-a5af-4ba5-8b40-9930d48f5008)&sort=;significance(significance)&q=;()&constRange=;1h(c)&startDate=;0(0)&endDate=;0(0)",
      "alerts": [
        {
          "Id": "http://test.anodot.com/#!/alerts/6d59552d-7d61-44ae-bf20-2d39555af8c7",
          "emailId": "d863a",
          "alertName": "NewAlert1 {{component}}",
          "startTime": 1578381300,
          "endTime": 1578390300,
          "status": "CLOSE",
          "alertOwner": "automation testing"
        }
      ]
    }
  ]
}

Response Fields

Field Type Description / Example
total Number Number of feedback instances included in the response
feedbacks[] Array An array of feedback instances
id String ($uuid) Feedback id
type String Type of feedback. Possible values:
* Good Catch
* Not Interesting
comment String Optional comment, if provided by the user while giving the feedback.
createdTime Epoch Feedback creation time.
username String Email of the user who provided the feedback
anomalyId String Link to the anomaly Investigate page in the Anodot platform.
alerts[] Array An array of alerts related to the feedback instance.

Alerts Array Fields

Field Type Description / Example
Id String Link to the alert settings in the Anodot platform.
emailId String 5 characters used to identify the email.
These are also the first 5 chars of the AnomalyId.
alertName String Alert name in Anodot
startTime Epoch Alert start time
endTime Epoch [Optional] Alert end time, relevant if the alert is closed.
status String The alert status. Possible values:
* OPEN
* CLOSE.
alertOwner String The alert owner in Anodot. Possible values are:
* User first and Last name.
* Group name.

-- Information you need to Know --

Rates and Limits

APIs are limited by:

Rate limit for API calls is 500 calls per minute.

Overall number of entities - per terms of use / specific contract.

End Point Rate Limit
Feedback 50 requests per minute

Response Codes

HTTP Responses

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

Error Code Meaning
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Server error

Error Response Fields

Error Response Example

{ 
  “errors”:[ 
    {
      "index":"failed sample index",
      “error”: "<error code>", 
      “description”:”error description” 
    } 
  ] 
}
Field Description
errors An array of errors received from the request
index In case a batch of records was sent in the request, the index directs to the faulty entry
error Error code
description The error Description

The error code list

Anodot Error Codes

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