Subscribe to User Defined Messages for a given Call SID.

POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions.json

Subscription for server-side application access to messages sent from the Voice SDK for an active Call.

Subscribe to User Defined Messages for a given Call SID.

Path parameters

  • AccountSid string Required

    The SID of the Account that subscribed to the User Defined Messages.

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

  • CallSid string Required

    The SID of the Call the User Defined Messages subscription is associated with. This refers to the Call SID that is producing the user defined messages.

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

application/x-www-form-urlencoded

Body

  • Callback string(uri) Required

    The URL we should call using the method to send user defined events to your application. URLs must contain a valid hostname (underscores are not permitted).

  • IdempotencyKey string

    A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.

  • Method string(http-method)

    The HTTP method Twilio will use when requesting the above Url. Either GET or POST. Default is POST.

    Values are GET or POST.

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 subscribed to the User Defined Messages.

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

    • call_sid string | null

      The SID of the Call the User Defined Message Subscription is associated with. This refers to the Call SID that is producing the User Defined Messages.

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

    • sid string | null

      The SID that uniquely identifies this User Defined Message Subscription.

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

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

      The date that this User Defined Message Subscription was created, given in RFC 2822 format.

    • uri string | null

      The URI of the User Defined Message Subscription Resource, relative to https://api.twilio.com.

POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions.json
curl \
 --request POST 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions.json' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'Method=POST&Callback=http%3A%2F%2Fwww.example.com&IdempotencyKey=1'
Request example
{"Method"=>"POST", "Callback"=>"http://www.example.com", "IdempotencyKey"=>"1"}
Response examples (201)
{
  "sid": "ZYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions/ZYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
  "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_created": "Wed, 18 Dec 2019 20:02:01 +0000"
}