Errors
Errors
An API request may fail due to a request or server error.
Errors are returned using standard HTTP Status Codes. The available status codes are defined by RFC 7231 and registered status codes are listed in the IANA Status Code Registry.
An error will include a response body in JSON format.
Response Status Codes
Status-code element is a three-digit integer code giving the result of the attempt to understand and satisfy the request. HTTP has a set of standard status codes which fall into five categories:
- Informational (
1xx) - Success (
2xx) - Redirection (
3xx) - Client Errors (
4xx) - Server Errors (
5xx)
Informational (1xx)
Not currently supported.
Success (2xx)
The following 2xx status codes are supported:
| Code | Reason-phrase |
|---|---|
200 | OK |
201 | Created |
202 | Accepted |
204 | No Content |
Redirection (3xx)
Not currently supported.
Client Errors (4xx)
The following 4xx status codes are supported:
| Code | Reason-phrase |
|---|---|
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
405 | Method Not Allowed |
412 | Precondition Failed |
413 | Payload Too Large |
415 | Unsupported Media Type |
Server Errors (5xx)
The following 5xx status codes are supported:
| Code | Reason-phrase |
|---|---|
500 | Internal Server Error |
503 | Service Unavailable |
Response Headers
| Name | Description |
|---|---|
| content-type | REQUIRED. MIME type of the content: application/json |
| apple-request-id | Unique ID |
HTTP/1.1 404 Not Found
apple-request-id: 0a8af52f-aa59-4cbd-96a6-bde380fc64ea
content-type: application/json
Response Body
| Name | Type | Description |
|---|---|---|
code | string | REQUIRED. May be prefixed with a resource type. Possible values |
message | string | Message describing the issue |
context | object | Refer to Context |
details | object | Refer to Details |
Context
| Name | Type | Description |
|---|---|---|
| key | string | A name-value map of a variable and its value necessary to construct the message. A null value indicates the referenced field was not included in the request body, as distinct from being present with a non-matching value.REQUIRED when message includes dynamic content |
Refer to FAQs for additional information about how a partner may use context
Details
| Name | Type | Description |
|---|---|---|
createdDate | dateTime | Date and time the error was recorded |
submitted | array | Field-value pairs representing the values submitted in the request. Refer to Details Item |
expected | array | Field-value pairs representing the values expected by the API. Refer to Details Item |
compared | array | Field-value pairs representing existing resource values compared against the request. Refer to Details Item |
Details Item
| Name | Type | Description |
|---|---|---|
field | string | Name of the field |
value | string | Value of the field |
Example Response Body
[
{
"code": "LOCATION__NOT_FOUND",
"message": "Resource not found for Apple-generated '{{id}}'",
"context": {
"id": "9467895078742654451"
}
}
]
HTTP Status Code and Response Body Code Combinations
View Combinations
400 Bad Request
Already Accepted
Code Description
Attempt to contest an Apple Override after it is already accepted.
Code may be returned for these resource types and by the following web service operations:
| Resource Type | Accept |
|---|---|
| Apple Override | ✓ |
Example Response Body
[
{
"code": "APPLE_OVERRIDE__ALREADY_ACCEPTED",
"message": "Change to resource with Apple-generated '{{id}}' already accepted",
"context": {
"id": "30eaaef3-688c-4e82-8547-7c64c1181ffa"
}
}
]
Already Exists
Code Description
- Attempt to create a resource using a partner provided ID referenced in the body of the request that's associated with an existing resource. Partner provided ID in
messagemay be:
partnersAssetId(brand asset or location asset)partnersBrandIdpartnersLocationIdpartnersReviewId
partnersAssetId(brand asset or location asset)partnersBrandIdpartnersLocationId
- Attempt to create a resource using the resource named in the URL path that's associated with an existing resource.
- Attempt to create a resource using values which match an already existing resource.
Code may be returned for these resource types and by the following web service operations:
| Resource Type | Create |
|---|---|
| Aggregate Rating | ✓ |
| Brand | ✓ |
| Brand Asset | ✓ |
| Location | ✓ |
| Location Asset |