API Codes

 

ON THIS PAGE      Show

 

 

 

 

About API Codes

In addition to HTTP status codes, AP Media API returns detail error codes if available. For example, the following error is returned if query is specified instead of q in the search request:

{
    "api_version": "2.0",
    "api_mode": "live",
    "api_build": "2.0.2",
    "id": "BJk8kS1Hm",
    "method": "/content/search.GET",
    "params": {
      "query": "soccer"
    },
    "error": {
        "status": 400,  // HTTP status code
        "code": 5000,    // Detail error code
        "message": "Invalid query parameter(s) specified: query",
        "timestamp": "2020-07-02T14:07:01.552Z"   // Date and time when the error was returned
    }
}

List of Detail Error Codes

You can access the list of detail error codes in JSON at the following URL (make sure to supply the API key in the x-api-key request header):

https://api.ap.org/media/v[{version}]/help/errors

API Code Examples

200 Status Code

  200 - OK

 

Process the response.

 

 

 

302 Status Code

  302 - Found

 

Implement a redirect to the URL for the content item binary in the Location field.

 

 

 

400 Status Code

1000 Detail Code

  400, 1000 - 'The request cannot be fulfilled due to bad syntax'

 

If the issue is not described in the Troubleshooting FAQs, check the request syntax and parameters.

 

 

 

5000 Detail Code

  400, 5000 - 'Invalid or unknown parameter supplied'

 

Check the request syntax and parameters.

 

 

 

5001 Detail Code

  400, 5001 - 'A parameter has an invalid value'

 

Check the request syntax and parameters.

 

 

 

5003 Detail Code

  400, 5003 - 'Range of min_date and max_date exceeds maximum'

 

Check the min_date and max_date parameter values in the Download History request.

 

 

 

5004 Detail Code

  400, 5004 - 'min_date must be before today's date'

 

Check the min_date and max_date parameter values in the Download History request.

 

 

 

5005 Detail Code

  400, 5005 - 'min_date value must be before max_date'

 

Check the min_date and max_date parameter values in the Download History request.

 

 

 

5006 Detail Code

  400, 5006 - 'min_date must be within the last 12 months'

 

Check the min_date and max_date parameter values in the Download History request.

 

 

 

5008 Detail Code

  400, 5008 - 'Date value has an invalid format'

 

Check the format of the specified date parameter(s) in the Download History request.

 

 

 

6000 Detail Code

  400, 6000 - 'Search query has invalid terms'

 

Check the q parameter value; for example, if the specified product IDs are valid.

 

 

 

6001 Detail Code

  400, 6001 - 'Search query references an unknown field'

 

Check the metadata field names used in the q parameter value.

 

 

 

6002 Detail Code

  400, 6002 - 'Search query has invalid format'

 

Check the q parameter value syntax.

 

 

 

6060 Detail Code

  400, 6060 - 'Bad Request: Query-token parameter qt is expired or invalid, re-issue original request'

 

Query tokens expire after 72 hours of inactivity. Resubmit your original request.

 

 

 

6101 Detail Code

  400, 6101 - 'One or more exclude values may not be excluded'

 

Check the exclude parameter value syntax.

 

 

 

6102 Detail Code

  400, 6102 - 'One or more exclude values are invalid'

 

Check the exclude parameter value syntax.

 

 

 

6111 Detail Code

  400, 6102 - 'One or more include values are unknown'

 

Check the include parameter value syntax.

 

 

 

401 Status Code

2000 Detail Code

  401, 2000 - 'Invalid or unauthorized apikey'

 

Check the API key. If you have just received your key, wait for a few hours and try again. If you are still getting an error, contact us.

 

 

 

2001 Detail Code

  401, 2001 - 'Must supply apikey'

 

Make sure you specify the API key. If you have not received your key, contact us.

 

 

 

2002 Detail Code

  401, 2002 - 'Expired apikey, contact representative'

 

Please contact us.

 

 

 

2003 Detail Code

  401, 2003 - 'Account or apikey configuration issue, contact representative'

 

Please contact us.

 

 

 

402 Status Code

9403 Detail Code

  402, 9403 - 'Price has changed, check updated pricing information'

 

Refer to Download After a Price Change.

 

 

 

9404 Detail Code

  402, 9404 - 'Download of this asset requires price acknowledgment by applying pricetag on download request'

 

Refer to Downloads Incurring a Charge.

 

 

 

403 Status Code

3000 Detail Code

  403, 3000 - 'Requested item is forbidden'

 

Your account is not allowed access to this item.

 

 

 

3002 Detail Code

  403, 3002 - 'The requested mode is unavailable'

 

The requested access mode is not available for the specified version. Use /v/versions to view available versions and modes.

 

 

 

3003 Detail Code

  403, 3003 - 'The requested version is unavailable'

 

The requested API version is not available. Use /v/versions to view available versions and modes.

 

 

 

9402 Detail Code

  403, 9402 - 'Item is unavailable in your plan at this time'

 

Refer to Item Not Available In Plan.

 

 

 

404 Status Code

7001 Detail Code

  404, 7001 - 'Item source unavailable'

 

Refer to the Troubleshooting FAQs.

 

 

 

7002 Detail Code

  404, 7002 - 'Requested binary cannot be located'

 

Refer to the Troubleshooting FAQs.

 

 

 

8000 Detail Code

  404, 7001 - 'Resource not found'

 

Check the request syntax.

 

 

 

409 Status Code

6003 Detail Code

  409, 6003 - 'Too many keyword feeds created recently. To continue feeding on this query, delete an existing query by following one of the links below.'

 

Delete a query-based feed by following one of the links returned in the queries.delete_and_continue_link properties in the error message.

 

 

 

429 Status Code

1001 Detail Code

  429,1001 - 'API request limit exceeded.'

 

Resend your request later and reduce your request rate. For more information, refer to Staying Under Your Quota Limits.

 

 

 

2202 Detail Code

  429,2202 - 'Per-minute quota exceeded, reduce your request rate'

 

Resend your request later and reduce your request rate. For more information, refer to Staying Under Your Quota Limits.

 

 

 

2203 Detail Code

  429,2203 - 'Per-day quota exceeded. Beginning tomorrow, reduce your request rate'

 

Resend your request tomorrow and reduce your request rate. For more information, refer to Staying Under Your Quota Limits.

 

 

 

500 Status Code

8000 Detail Code

  500, 8000 - 'Internal server issue'

 

Contact us.

 

 

 

503 Status Code

8001 Detail Code

  500, 8001 - 'Service Unavailable'

 

Contact us.