Contents

Process a Play Media Intent

Interpret the user’s request to play a media item, and provide instructions to access a corresponding playback queue.

URL

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

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. The client omits this header on the first attempt.

x-applecloudextension-session-id Requiredstring

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

Response Codes

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

The request is successful.

Discussion

Processing a play media request requires a few steps:

  • Resolve the intended media item.

  • Resolve any playback customizations, such as repeat mode.

  • Handle the intent.

  • Provide a playback queue.

You can improve the overall response time to the user’s request by providing a response for resolving any playback customizations, and handling the intent alongside your response to the request to resolve the intended media item. 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 intents to play media.

Topics

Processing a Play Media Intent

Resolving a Media Item

Handling a Play Media Intent

Resolving the Intended Repeat Mode

Resolving the Intended Queue Location

Resuming Playback

Shuffling Playback

See Also

Media Play Queues