Skip to content
Back to Home

API Codes

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": "1.0",
    "api_mode": "live",
    "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": "2018-08-01T14: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

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

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.

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

400, 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 - 'Requested item or resource is not found'

Refer to the Troubleshooting FAQs.

7002 Detail Code

404, 7002 - 'Requested binary cannot be located'

Refer to the Troubleshooting FAQs.

409 Status Code

6003 Detail Code

409, 6003 - 'Too many query-based feeds have been created, delete a prior one to proceed'

Delete one or more query-based feeds by following the links returned in the queries.delete_and_continue_link properties in the error message.

429 Status Code

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 Account Quotas.

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 Account Quotas.

500 Status Code

8000 Detail Code

500, 8000 - 'Internal server issue'

Contact us.

503 Status Code

8001 Detail Code

503, 8001 - 'Service Unavailable'

Contact us.