Twilio PlayerStreamers API

The PlayerStreamers API from Twilio — 3 operation(s) for playerstreamers.

Documentation

Specifications

Other Resources

OpenAPI Specification

twilio-playerstreamers-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Twilio - Accounts A2p PlayerStreamers API
  description: This is the public Twilio REST API.
  termsOfService: https://www.twilio.com/legal/tos
  contact:
    name: Twilio Support
    url: https://support.twilio.com
    email: support@twilio.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.52.0
servers:
- url: https://accounts.twilio.com
tags:
- name: PlayerStreamers
paths:
  /v1/PlayerStreamers/{Sid}:
    servers:
    - url: https://media.twilio.com
    description: A PlayerStreamer resource provides the ability to send a livestream to a JavaScript, iOS, or Android Player SDK.
    x-twilio:
      defaultOutputProperties:
      - sid
      - status
      pathType: instance
      dependentProperties:
        timed_metadata:
          mapping:
            player_streamer_sid: sid
          resource_url: /v1None
        playback_grant:
          mapping:
            sid: sid
          resource_url: /v1None
        recording_playback_grant:
          mapping:
            sid: sid
          resource_url: /v1None
      mountName: player_streamer
    get:
      description: Returns a single PlayerStreamer resource identified by a SID.
      tags:
      - PlayerStreamers
      parameters:
      - name: Sid
        in: path
        description: The SID of the PlayerStreamer resource to fetch.
        schema:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^VJ[0-9a-fA-F]{32}$
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/media.v1.player_streamer'
          description: OK
      security:
      - accountSid_authToken: []
      operationId: FetchPlayerStreamer
      x-maturity:
      - GA
    post:
      description: Updates a PlayerStreamer resource identified by a SID.
      tags:
      - PlayerStreamers
      parameters:
      - name: Sid
        in: path
        description: The SID of the PlayerStreamer resource to update.
        schema:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^VJ[0-9a-fA-F]{32}$
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/media.v1.player_streamer'
          description: OK
      security:
      - accountSid_authToken: []
      operationId: UpdatePlayerStreamer
      x-maturity:
      - GA
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdatePlayerStreamerRequest'
  /v1/PlayerStreamers:
    servers:
    - url: https://media.twilio.com
    description: A PlayerStreamer resource provides the ability to send a livestream to a JavaScript, iOS, or Android Player SDK.
    x-twilio:
      defaultOutputProperties:
      - sid
      - status
      pathType: list
      dependentProperties:
        timed_metadata:
          mapping:
            player_streamer_sid: sid
          resource_url: /v1None
        playback_grant:
          mapping:
            sid: sid
          resource_url: /v1None
        recording_playback_grant:
          mapping:
            sid: sid
          resource_url: /v1None
      mountName: player_streamer
    post:
      description: ''
      tags:
      - PlayerStreamers
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/media.v1.player_streamer'
          description: Created
      security:
      - accountSid_authToken: []
      operationId: CreatePlayerStreamer
      x-maturity:
      - GA
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreatePlayerStreamerRequest'
    get:
      description: Returns a list of PlayerStreamers.
      tags:
      - PlayerStreamers
      parameters:
      - name: Order
        in: query
        description: 'The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.'
        schema:
          type: string
          $ref: '#/components/schemas/player_streamer_enum_order'
      - name: Status
        in: query
        description: Status to filter by, with possible values `created`, `started`, `ended`, or `failed`.
        schema:
          type: string
          $ref: '#/components/schemas/player_streamer_enum_status'
      - name: PageSize
        in: query
        description: How many resources to return in each list page. The default is 50, and the maximum is 1000.
        schema:
          type: integer
          minimum: 1
          maximum: 1000
      - name: Page
        in: query
        description: The page index. This value is simply for client state.
        schema:
          type: integer
          minimum: 0
      - name: PageToken
        in: query
        description: The page token. This is provided by the API.
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListPlayerStreamerResponse'
          description: OK
      security:
      - accountSid_authToken: []
      operationId: ListPlayerStreamer
      x-maturity:
      - GA
  /v1/PlayerStreamers/{Sid}/PlaybackGrant:
    servers:
    - url: https://media.twilio.com
    description: A PlaybackGrant resource allows developers to generate a grant to initialize the Twilio Live Player SDK and connect to a livestream.
    x-twilio:
      defaultOutputProperties: []
      pathType: instance
      parent: /PlayerStreamers/{Sid}
    post:
      description: ''
      tags:
      - PlayerStreamers
      parameters:
      - name: Sid
        in: path
        description: The unique string generated to identify the PlayerStreamer resource associated with this PlaybackGrant
        schema:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^VJ[0-9a-fA-F]{32}$
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/media.v1.player_streamer.player_streamer_playback_grant'
          description: Created
      security:
      - accountSid_authToken: []
      operationId: CreatePlayerStreamerPlaybackGrant
      x-maturity:
      - GA
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreatePlayerStreamerPlaybackGrantRequest'
    get:
      description: '**This method is not enabled.** Returns a single PlaybackGrant resource identified by a SID.'
      tags:
      - PlayerStreamers
      parameters:
      - name: Sid
        in: path
        description: The SID of the PlayerStreamer resource to fetch.
        schema:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^VJ[0-9a-fA-F]{32}$
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/media.v1.player_streamer.player_streamer_playback_grant'
          description: OK
      security:
      - accountSid_authToken: []
      operationId: FetchPlayerStreamerPlaybackGrant
      x-maturity:
      - GA
components:
  schemas:
    CreatePlayerStreamerPlaybackGrantRequest:
      type: object
      properties:
        Ttl:
          type: integer
          description: The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds.
        AccessControlAllowOrigin:
          type: string
          description: The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain.
    player_streamer_enum_status:
      type: string
      enum:
      - created
      - started
      - ended
      - failed
    CreatePlayerStreamerRequest:
      type: object
      properties:
        Video:
          type: boolean
          description: Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`.
        StatusCallback:
          type: string
          format: uri
          description: The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details.
        StatusCallbackMethod:
          type: string
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          description: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
        MaxDuration:
          type: integer
          description: The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming.
    player_streamer_enum_ended_reason:
      type: string
      enum:
      - ended-via-api
      - max-duration-exceeded
      - stream-disconnected-by-source
      - unexpected-failure
    player_streamer_enum_order:
      type: string
      enum:
      - asc
      - desc
    media.v1.player_streamer:
      type: object
      properties:
        account_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^AC[0-9a-fA-F]{32}$
          nullable: true
          description: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PlayerStreamer resource.
        date_created:
          type: string
          format: date-time
          nullable: true
          description: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        date_updated:
          type: string
          format: date-time
          nullable: true
          description: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        video:
          type: boolean
          nullable: true
          description: Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`.
        links:
          type: object
          format: uri-map
          nullable: true
          description: The URLs of related resources.
        sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^VJ[0-9a-fA-F]{32}$
          nullable: true
          description: The unique string generated to identify the PlayerStreamer resource.
        status:
          type: string
          $ref: '#/components/schemas/player_streamer_enum_status'
          nullable: true
          description: 'The status of the PlayerStreamer. Can be: `created`, `started`, `ended`, or `failed`. See [status](/docs/live/api/playerstreamers#status) for more information.'
        url:
          type: string
          format: uri
          nullable: true
          description: The absolute URL of the resource.
        status_callback:
          type: string
          format: uri
          nullable: true
          description: The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details.
        status_callback_method:
          type: string
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          nullable: true
          description: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
        ended_reason:
          type: string
          $ref: '#/components/schemas/player_streamer_enum_ended_reason'
          nullable: true
          description: The reason why a PlayerStreamer ended. When a PlayerStreamer is in progress, will be `null`. When a PlayerStreamer is completed, can be `ended-via-api`, `max-duration-exceeded`, `stream-disconnected-by-source` or `unexpected-failure`. See [ended reasons](/docs/live/api/playerstreamers#ended-reason) for more details.
        max_duration:
          type: integer
          nullable: true
          description: The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming.
    media.v1.player_streamer.player_streamer_playback_grant:
      type: object
      properties:
        sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^VJ[0-9a-fA-F]{32}$
          nullable: true
          description: The unique string generated to identify the PlayerStreamer resource that this PlaybackGrant authorizes views for.
        url:
          type: string
          format: uri
          nullable: true
          description: The absolute URL of the resource.
        account_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^AC[0-9a-fA-F]{32}$
          nullable: true
          description: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this resource.
        date_created:
          type: string
          format: date-time
          nullable: true
          description: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        grant:
          nullable: true
          description: The grant that authorizes the player sdk to connect to the livestream
    UpdatePlayerStreamerRequest:
      type: object
      required:
      - Status
      properties:
        Status:
          type: string
          $ref: '#/components/schemas/player_streamer_enum_update_status'
          description: 'The status the PlayerStreamer should be transitioned to. Can be: `ended`.'
    ListPlayerStreamerResponse:
      type: object
      properties:
        player_streamers:
          type: array
          items:
            $ref: '#/components/schemas/media.v1.player_streamer'
        meta:
          type: object
          properties:
            first_page_url:
              type: string
              format: uri
            next_page_url:
              type: string
              format: uri
              nullable: true
            page:
              type: integer
            page_size:
              type: integer
            previous_page_url:
              type: string
              format: uri
              nullable: true
            url:
              type: string
              format: uri
            key:
              type: string
    player_streamer_enum_update_status:
      type: string
      enum:
      - ended
  securitySchemes:
    accountSid_authToken:
      type: http
      scheme: basic
x-maturity:
- name: GA
  description: This product is Generally Available.
- name: Beta
  description: PLEASE NOTE that this is a Beta product that is subject to change. Use it with caution.