If a request was invalid or there was a problem with the response, the server will respond with an error object describing the issue.

For example, if you make a request with a begin date of October 1st, 2015 and an end date of September 30, 2015 you'll receive the following response along with an HTTP 422 response code:

{
  "error": {
    "code": 10012,
    "message": "Begin date must be before end date",
    "description": "The requested date range is not valid. The begin date must be before the end date."
  }
}


Other typical error messages are outlined in the table below:

Error Code: 1
Message: SSL is required to perform this operation.
HTTP Response: 403
HTTP Response Description: Forbidden
Description: HTTP is not supported. Please send all requests over HTTPS (e.g.https://api.dragonmetrics.com)

Error Code: 2
Message: Out of credits
HTTP Response: 429
HTTP Response Description: Too Many Requests
Description: Your account does not have enough API credits to maket his request.

Error Code: 3
Message: Rate limit exceeded
HTTP Response: 429
HTTP Response Description: Too Many Requests
Description: You have made too many requests during this time period. Please wait and try your request again shortly.

Error Code: 4
Message: Authentication Missing
HTTP Response: 401
HTTP Response Description: Unauthorized
Description: You must authenticate to access this resource.

Error Code: 5
Message: Authentication failed
HTTP Response: 401
HTTP Response Description: Unauthorized
Description: The supplied authentication credentials were not correct.

Error Code: 6
Message: Forbidden
HTTP Response: 403
HTTP Response Description: Forbidden
Description: You do not have access to this resource. Please consult with your account administrator for more details.

Error Code: 7
Message: Not found
HTTP Response: 404
HTTP Response Description: Not Found
Description: The requested resource cannot be found. Please consult the Dragon Metrics API documentation for more information.

Error Code: 8
Message: POST not allowed
HTTP Response: 405
HTTP Response Description: Method not allowed
Description: The HTTP POST method is not allowed for this resource

Error Code: 9
Message: PUT not allowed
HTTP Response: 405
HTTP Response Description: Method not allowed
Description: The HTTP PUT method is not allowed for this resource

Error Code: 10
Message: DELETE not allowed
HTTP Response: 405
HTTP Response Description: Method not allowed
Description: The HTTP DELETE method is not allowed for this resource

Error Code: 11
Message: GET not allowed
HTTP Response: 405
HTTP Response Description: Method not allowed
Description: The HTTP GET method is not allowed for this resource

Error Code: 1000
Message: Unknown validation error
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: An unknown validation error has occurred. One or more parameters in your request may be poorly formed. Please verify all parameters and try again.

Error Code: 1001
Message: Incorrect date format
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The date format is not correct. All dates must be formatted as 'dd-mm-yyyy'. (e.g. '30-05-2015')

Error Code: 1002
Message: Campaign does not exist
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The requested campaign ID does not exist.

Error Code: 1003
Message: Limit too high
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The value specified for 'limit' is too high. Please use a number less than or equal to 100.

Error Code: 1005
Message: Invalid value for 'limit'
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The value for the 'limit' parameter must be an integer between 1 and 100.

Error Code: 1007
Message: Invalid value for'start'
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The value for the 'limit' parameter must be an integer greater than or equal to 0

Error Code: 1008
Message: Invalid value for'fields'
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The value for the 'fields' parameter is not valid. Please ensure all fields are spelled correctly and separated by a comma. Example: 'keyword,search_engines,ranking'

Error Code: 1009
Message: Keyword Group does not exist
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The requested keyword group ID does not exist.

Error Code: 10010
Message: Begin date required
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The 'begin_date' parameter is required for this field

Error Code: 10011
Message: End date required
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The 'end_date' parameter is required for this field

Error Code: 10012
Message: Begin date must be before end date
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The requested date range is not valid. The begin date must be before the end date.

Error Code: 10013
Message: Invalid value for 'site'
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The value for the 'fields' parameter is not valid. Please omit this parameter for the campaign's main site, or set its value to a competitor URL (string).

Error Code: 10014
Message: Invalid value for 'keyword_groups'
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The value for the 'keyword_groups' parameter in not valid. Please enter the ID of the keyword groups to include in the filter, separated by a comma. Use the integer ID, not the string name of the keyword group.

Error Code: 10015
Message: Invalid value for 'search_engines'
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The value for the 'search_engines' parameter is not valid. Please enter each search engine separated by a comma, in the format '{SEARCH ENGINE}|{COUNTRY CODE}|{LANGUAGE CODE}|{DEVICE}'. For example: 'google|us|en-US|desktop,google|uk|en|desktop'

Error Code: 10017
Message: Invalid value for 'tags'
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The value for the 'fields' parameter is not valid. Please enter the ID of the tag to include in the filter, separated by a comma. Use the integer ID, not string name of the tag.

Error Code: 10018
Message: Tags not found
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: One or more of the requested tag IDs do not exist

Error Code: 10019
Message: Invalid value for 'top_ranking_only'
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The value for the 'top_ranking_only' parameter is not valid. Please provide boolean values 'true' or 'false' for this paramater.

Error Code: 10020
Message: Invalid value for 'sort'
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: The value for the 'sort' parameter is not valid. Please use the format '{FIELD}|{DIRECTION}', where {FIELD} is the sort field, and {DIRECTION} is either 'asc' or 'desc'. Example: 'keyword|asc'. Not all fields are supported for to be used in the sort parameter.

Error Code: 10021
Message: Dates out of range
HTTP Response: 422
HTTP Response Description: Unprocessable Entity
Description: 'begin_date' and 'end_date' parameters must be a value before yesterday's date (Hong Kong Time UTC+8)

Did this answer your question?