Create player streamer playback grant

POST /v1/PlayerStreamers/{Sid}/PlaybackGrant

A PlaybackGrant resource allows developers to generate a grant to initialize the Twilio Live Player SDK and connect to a livestream.

Path parameters

  • Sid string Required

    The unique string generated to identify the PlayerStreamer resource associated with this PlaybackGrant

Body

  • The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain.

  • Ttl integer

    The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds.

Responses

  • Created

    Hide response attributes Show response attributes object
    • account_sid string | null

      The SID of the Account that created the resource

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • date_created string(date-time) | null

      The ISO 8601 date and time in GMT when the resource was created

    • The grant that authorizes the player sdk to connect to the livestream

    • sid string | null

      The unique string that identifies the PlayerStreamer associated with this PlaybackGrant.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^VJ[0-9a-fA-F]{32}$.

    • url string(uri) | null

      The absolute URL of the resource

POST /v1/PlayerStreamers/{Sid}/PlaybackGrant
curl \
 -X POST https://media.twilio.com/v1/PlayerStreamers/{Sid}/PlaybackGrant \
 --user "username:password" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'AccessControlAllowOrigin=string&Ttl=42'
Request example
{
  "AccessControlAllowOrigin": "string",
  "Ttl": 42
}
Request examples
{
  "AccessControlAllowOrigin": "string",
  "Ttl": 42
}
Response examples (201)
{
  "account_sid": "string",
  "date_created": "2023-05-04T09:42:00+00:00",
  "sid": "string",
  "url": "https://example.com"
}
Response examples (201)
{
  "account_sid": "string",
  "date_created": "2024-05-04T09:42:00+00:00",
  "sid": "string",
  "url": "https://example.com"
}