Create a new token for ICE servers

POST /2010-04-01/Accounts/{AccountSid}/Tokens.json

Credentials for ICE servers

Create a new token for ICE servers

Path parameters

  • AccountSid string Required

    The SID of the Account that will create the resource.

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

application/x-www-form-urlencoded

Body

  • Ttl integer

    The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours).

Responses

  • 201 application/json

    Created

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

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

      The SID of the Account that created the Token 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-rfc-2822) | null

      The date and time in GMT that the resource was created specified in RFC 2822 format.

    • date_updated string(date-time-rfc-2822) | null

      The date and time in GMT that the resource was last updated specified in RFC 2822 format.

    • ice_servers array[object(ice-server)] | null

      An array representing the ephemeral credentials and the STUN and TURN server URIs.

      Hide ice_servers attributes Show ice_servers attributes object(ice-server)
      • credential string
      • username string
      • url string
      • urls string
    • password string | null

      The temporary password that the username will use when authenticating with Twilio.

    • ttl string | null

      The duration in seconds for which the username and password are valid.

    • username string | null

      The temporary username that uniquely identifies a Token.

POST /2010-04-01/Accounts/{AccountSid}/Tokens.json
curl \
 --request POST 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Tokens.json' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'Ttl=1'
Request example
{"Ttl"=>1}
Response examples (201)
{
  "ttl": "86400",
  "password": "tE2DajzSJwnsSbc123",
  "username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "ice_servers": [
    {
      "urls": "stun:global.stun.twilio.com:3478"
    },
    {
      "urls": "turn:global.turn.twilio.com:3478?transport=udp",
      "username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
      "credential": "tE2DajzSJwnsSbc123"
    },
    {
      "urls": "turn:global.turn.twilio.com:3478?transport=tcp",
      "username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
      "credential": "tE2DajzSJwnsSbc123"
    },
    {
      "urls": "turn:global.turn.twilio.com:443?transport=tcp",
      "username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
      "credential": "tE2DajzSJwnsSbc123"
    }
  ],
  "date_created": "Fri, 01 May 2020 01:42:57 +0000",
  "date_updated": "Fri, 01 May 2020 01:42:57 +0000"
}