Skip to contentSkip to navigationSkip to topbar
On this page

CustomerProfileChannelEndpointAssignment Resource



ChannelEndpointAssignment Properties

channelendpointassignment-properties page anchor
Property nameTypeRequiredDescriptionChild properties
sidSID<RA>Optional
Not PII

The unique string that we created to identify the Item Assignment resource.

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

customer_profile_sidSID<BU>Optional

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

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

account_sidSID<AC>Optional

The SID of the Account that created the Item Assignment resource.

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

channel_endpoint_typestringOptional

The type of channel endpoint. eg: phone-number


channel_endpoint_sidSIDOptional

The SID of an channel endpoint

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

urlstring<uri>Optional

The absolute URL of the Identity resource.


Create a new Assigned Item.

create-a-new-assigned-item page anchor
POST https://trusthub.twilio.com/v1/CustomerProfiles/{CustomerProfileSid}/ChannelEndpointAssignments

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

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

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
ChannelEndpointTypestringrequired

The type of channel endpoint. eg: phone-number


ChannelEndpointSidSIDrequired

The SID of an channel endpoint

Pattern: ^[a-zA-Z]{2}[0-9a-fA-F]{32}$Min length: 34Max length: 34
Create a ChannelEndpointAssignmentLink to code sample: Create a ChannelEndpointAssignment
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createCustomerProfileChannelEndpointAssignment() {
11
const customerProfilesChannelEndpointAssignment = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesChannelEndpointAssignment.create({
14
channelEndpointSid: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
channelEndpointType: "ChannelEndpointType",
16
});
17
18
console.log(customerProfilesChannelEndpointAssignment.sid);
19
}
20
21
createCustomerProfileChannelEndpointAssignment();

Output

1
{
2
"sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"channel_endpoint_sid": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"channel_endpoint_type": "ChannelEndpointType",
7
"date_created": "2019-07-31T02:34:41Z",
8
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
9
}

Fetch specific Assigned Item Instance.

fetch-specific-assigned-item-instance page anchor
GET https://trusthub.twilio.com/v1/CustomerProfiles/{CustomerProfileSid}/ChannelEndpointAssignments/{Sid}

Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

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

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

SidSID<RA>required

The unique string that we created to identify the resource.

Pattern: ^RA[0-9a-fA-F]{32}$Min length: 34Max length: 34
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchCustomerProfileChannelEndpointAssignment() {
11
const customerProfilesChannelEndpointAssignment = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesChannelEndpointAssignment(
14
"RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
15
)
16
.fetch();
17
18
console.log(customerProfilesChannelEndpointAssignment.sid);
19
}
20
21
fetchCustomerProfileChannelEndpointAssignment();

Output

1
{
2
"sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"channel_endpoint_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"channel_endpoint_type": "phone-number",
7
"date_created": "2019-07-31T02:34:41Z",
8
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
9
}

Retrieve a list of all Assigned Items for an account.

retrieve-a-list-of-all-assigned-items-for-an-account page anchor
GET https://trusthub.twilio.com/v1/CustomerProfiles/{CustomerProfileSid}/ChannelEndpointAssignments

Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

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

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
ChannelEndpointSidSIDOptional

The SID of an channel endpoint

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

ChannelEndpointSidsstringOptional

comma separated list of channel endpoint sids


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.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listCustomerProfileChannelEndpointAssignment() {
11
const customerProfilesChannelEndpointAssignments = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesChannelEndpointAssignment.list({ limit: 20 });
14
15
customerProfilesChannelEndpointAssignments.forEach((c) => console.log(c.sid));
16
}
17
18
listCustomerProfileChannelEndpointAssignment();

Output

1
{
2
"results": [],
3
"meta": {
4
"page": 0,
5
"page_size": 50,
6
"first_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments?PageSize=50&Page=0",
7
"previous_page_url": null,
8
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments?PageSize=50&Page=0",
9
"next_page_url": null,
10
"key": "results"
11
}
12
}

Remove an Assignment Item Instance.

remove-an-assignment-item-instance page anchor
DELETE https://trusthub.twilio.com/v1/CustomerProfiles/{CustomerProfileSid}/ChannelEndpointAssignments/{Sid}

Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

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

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

SidSID<RA>required

The unique string that we created to identify the resource.

Pattern: ^RA[0-9a-fA-F]{32}$Min length: 34Max length: 34
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function deleteCustomerProfileChannelEndpointAssignment() {
11
await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesChannelEndpointAssignment(
14
"RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
15
)
16
.remove();
17
}
18
19
deleteCustomerProfileChannelEndpointAssignment();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.