Contents

Process an Add Media Intent

Add media items to the user’s library or to a playlist.

URL

POST https://cloudextension-testservice.local/api/intent/addMedia

Header Parameters

NameTypeDescription
Accept-Language Requiredstring

The client’s current user interface language. Respond with localized content for this language, if available.

Request-Timeout Requireduint32

An approximate deadline, in seconds, for processing this real-time user request. The Session object provides the exact deadline for handling an intent.

User-Agent Requiredstring

The extension protocol running on the client. This is an RFC 7231-compliant string that contains the product name AppleCloudExtension and the SiriKit Extension library version running on the client.

x-applecloudextension-retry-count Optionaluint32

The number of previous requests from the client.

x-applecloudextension-session-id Requiredstring

A constant session identifier to include in each request and response. Respond to each request with the same session ID the client sends in that request.

Response Codes

StatusReasonTypeDescription
200OK
Content-Type: application/json
[AddMediaIntentHandlingInvocationResponse]

The request is successful.

Discussion

Processing a request to add media items to the user’s library or to a playlist requires a few steps: resolving the intended media item, resolving the intended destination library or playlist, confirming the intent, and handling the intent.

You can often improve the overall response time to the user’s request by providing multiple responses to the client’s first request. Include an AddMediaIntentHandlingInvocationResponse for each of the subsequent steps in your response to the first request of a session. This allows the client to skip subsequent requests when you can resolve each parameter successfully. If your service responds with a disambiguation, confirmation, or failure, the client disregards the pre-emptive responses, and sends the subsequent intent-processing requests.

HTTP Body

An array of requests to process intents.

Topics

Processing an Add Media Intent

Identifying a Media Item

Identifying a Library or Playlist

Confirming and Handling an Add Media Intent