Path parameters
-
The SID of the Service to create the resource under.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^IS[0-9a-fA-F]{32}$
.
Body
-
A descriptive string that you create to describe the new resource. It can be up to 64 characters long.
-
An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's
sid
in the URL. This value must be 64 characters or less in length and be unique within the Service. -
A valid JSON string that contains application-specific data.
-
The visibility of the channel. Can be:
public
orprivate
.Values are
public
orprivate
.
POST
/v1/Services/{ServiceSid}/Channels
curl \
--request POST 'https://chat.twilio.com/v1/Services/{ServiceSid}/Channels' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'Type=public&Attributes=%7B+%22foo%22%3A+%22bar%22+%7D&UniqueName=unique_name&FriendlyName=friendly_name'
Request example
{"Type"=>"public", "Attributes"=>"{ \"foo\": \"bar\" }", "UniqueName"=>"unique_name", "FriendlyName"=>"friendly_name"}
Response examples (201)
{
"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"type": "public",
"links": {
"invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites",
"members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members",
"messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
"last_message": null
},
"attributes": "{ \"foo\": \"bar\" }",
"created_by": "system",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"unique_name": "unique_name",
"date_created": "2015-12-16T22:18:37Z",
"date_updated": "2015-12-16T22:18:37Z",
"friendly_name": "friendly_name",
"members_count": 0,
"messages_count": 0
}