Handling requests and responses
Write a request for app or book metadata and handle responses from the API.
Overview
Learn how to compose a request to get data from the Apps and Books for Organizations API and how to interpret responses.
Compose a request
To compose a request, first specify the root path - https://api.ent.apple.com/v1 for enterprise organizations, or https://api.edu.apple.com/v1 for educational organizations.
Follow this part of the path with /catalog/, the storefront, and then any parameters that are specific to the endpoint. All requests must include the storefront in the path.
For example, to request information about a specific app, construct a URL that includes the ID of the app in the path:
GET https://api.ent.apple.com/v1/catalog/{storefront}/stoken-authenticated-apps?ids={id}&platform=iphoneYou must also include the organization’s sToken as a cookie named itvt to access the stoken-authenticated-apps and stoken-authenticated-books endpoints.
Most requests return only the requested resource. For information about how to request related resources at the same time, see Fetching resources with extended attributes.
Interpret a response
There are three kinds of responses: resource collection, results, and errors.
Results responses always have a top-level results member object that contains the information for the response. Results responses are always unique to the endpoint.
Error responses contain an array of one or more error objects that indicate any issues while handling the request. The status code of the response reflects the primary error. See Error and HTTP Status Codes.
Default responses for common requests include:
Request description | Status code | Response description |
|---|---|---|
Request for an existing single resource object |
| The |
Request for a single resource object that doesn’t exist |
| The response doesn’t contain a |
Request for multiple resource objects by ID |
| The |
Request for multiple resource objects by ID and none of the resources exist |
| The |
Request contains successfully modified or deleted resources |
| The body is empty. |
A successful request to an endpoint that returns results |
| The response includes the returned results. |
The request isn’t accepted because its authorization is missing or invalid due to an issue with the developer token |
| The response doesn’t contain a |
The request isn’t accepted due to an issue with the media user token or because the request is using incorrect authentication. |
| The response doesn’t contain a |
The request isn’t supported as specified |
| The |
The request encounters errors on the server | Any status code in the 500 range | The |