Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Messaging Service ChannelSender Resource


(warning)

Public Beta

The Service Resource is currently available as a Public Beta product. This means that some features for configuring your Messaging Service via the REST API are not yet implemented, and others may be changed before the product is declared Generally Available. Messaging Service Configuration through the Twilio Console is Generally Available.

Public Beta products are not covered by a Twilio SLA.

The resources for sending Messages with a Messaging Service are Generally Available.

The ChannelSender subresource of a Service Resource represents a channel sender that is associated with a Messaging Service, such as WhatsApp. It allows you to view basic channel sender information.

See Twilio Channels: A New Way Reach Customers in Apps They Already Use for more information on Twilio Channels.


ChannelSender Properties

Property nameTypePIIDescription
account_sidSID<AC>
Not PII

The SID of the Account that created the ChannelSender resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

messaging_service_sidSID<MG>

The SID of the Service the resource is associated with.

Pattern: ^MG[0-9a-fA-F]{32}$Min length: 34Max length: 34

sidSID<XE>

The unique string that we created to identify the ChannelSender resource.

Pattern: ^XE[0-9a-fA-F]{32}$Min length: 34Max length: 34

senderstring

The unique string that identifies the sender e.g whatsapp:+123456XXXX.


sender_typestring

A string value that identifies the sender type e.g WhatsApp, Messenger.


country_codestring

The 2-character ISO Country Code of the number.


date_createdstring<date-time>

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


date_updatedstring<date-time>

The date and time in GMT when the resource was last updated specified in ISO 8601 format.


urlstring<uri>

The absolute URL of the ChannelSender resource.


Fetch a ChannelSender resource

GET https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/ChannelSenders/{Sid}

Path parameters

Property nameTypeRequiredPIIDescription
MessagingServiceSidSID<MG>required

The SID of the Service to fetch the resource from.

Pattern: ^MG[0-9a-fA-F]{32}$Min length: 34Max length: 34

Sidstringrequired

The SID of the ChannelSender resource to fetch.

Fetch a ChannelSender

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = twilio(accountSid, authToken);
_19
_19
async function fetchChannelSender() {
_19
const channelSender = await client.messaging.v1
_19
.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19
.channelSenders("Sid")
_19
.fetch();
_19
_19
console.log(channelSender.accountSid);
_19
}
_19
_19
fetchChannelSender();

Output

_11
{
_11
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_11
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_11
"sid": "Sid",
_11
"sender": "whatsapp:+12487960483",
_11
"sender_type": "WhatsApp",
_11
"country_code": "US",
_11
"date_created": "2023-07-30T20:12:31Z",
_11
"date_updated": "2023-07-30T20:12:33Z",
_11
"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_11
}


Read multiple ChannelSender resources

GET https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/ChannelSenders

Path parameters

Property nameTypeRequiredPIIDescription
MessagingServiceSidSID<MG>required

The SID of the Service to read the resources from.

Pattern: ^MG[0-9a-fA-F]{32}$Min length: 34Max length: 34

Query parameters

Property nameTypeRequiredPIIDescription
PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

List multiple ChannelSenders

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function listChannelSender() {
_18
const channelSenders = await client.messaging.v1
_18
.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.channelSenders.list({ limit: 20 });
_18
_18
channelSenders.forEach((c) => console.log(c.accountSid));
_18
}
_18
_18
listChannelSender();

Output

_24
{
_24
"meta": {
_24
"page": 0,
_24
"page_size": 20,
_24
"first_page_url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders?PageSize=20&Page=0",
_24
"previous_page_url": null,
_24
"next_page_url": null,
_24
"key": "senders",
_24
"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders?PageSize=20&Page=0"
_24
},
_24
"senders": [
_24
{
_24
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_24
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_24
"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_24
"sender": "whatsapp:+12487960483",
_24
"sender_type": "WhatsApp",
_24
"country_code": "US",
_24
"date_created": "2023-07-30T20:12:31Z",
_24
"date_updated": "2023-07-30T20:12:33Z",
_24
"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_24
}
_24
]
_24
}


Rate this page: