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

SHAKEN/STIR Onboarding with the Trust Hub REST API (Direct Customers using Subaccounts)


(information)

Info

For general information on the Trust Hub API, go to the Trust Hub API Docs.

This page walks Direct Customers using subaccounts through creating a SHAKEN/STIR Trust Product with the Trust Hub REST API.

Not a Direct Customer using subaccounts? Find the appropriate onboarding instructions below:


Direct Customers using Subaccounts

direct-customers-using-subaccounts page anchor
Create a Primary Business Profile under your Parent Account. Add Phone Numbers from Subaccounts to the Business Profile.

1. Create a Primary Business Profile in your Parent Account in the Console's Trust Hub and submit for vetting

1-create-a-primary-business-profile-in-your-parent-account-in-the-consoles-trust-hub-and-submit-for-vetting page anchor

2. Add Phone Number(s) from your Subaccount(s) to your Primary Business Profile

2-add-phone-numbers-from-your-subaccounts-to-your-primary-business-profile page anchor
  • This is required before you can add a phone number to your SHAKEN/STIR Trust Product.
  • You'll need your Business Profile's SID

    • To find your Business Profile SID in the Console, navigate to Trust Hub -> Customer Profiles -> View Profile Details .
    • If you'd prefer to use the Trust Hub API to do this, see the Additional API Calls section .
    • Business Profile SIDs start with " BU ".
  • You'll also need your Phone Number SID(s) from your subaccount(s).

    • To find your Phone Number SIDs in the Console, first navigate to your subaccount ( Settings -> Subaccounts -> View Subaccount ), then go to Phone Numbers , and click on the phone number.
    • To find your Phone Number SIDs via API (you'll need your Subaccount SID(s) , which can be found in the Console or via API), see the Additional API Calls Section .
    • Phone Number SIDs begin with " PN ".
  • In the API Call below, don't change the ChannelEndpointType . It needs to be phone-number to add a phone number to your Business Profile.

Add Phone Number to Primary Business Profile

add-phone-number-to-primary-business-profile page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_17
// Download the helper library from https://www.twilio.com/docs/node/install
_17
import twilio from "twilio";
_17
_17
// Find your Account SID and Auth Token at twilio.com/console
_17
// and set the environment variables. See http://twil.io/secure
_17
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17
const authToken = process.env.TWILIO_AUTH_TOKEN;
_17
const client = twilio(accountSid, authToken);
_17
_17
const customerProfilesChannelEndpointAssignment = await client.trusthub.v1
_17
.customerProfiles("YOUR_BUSINESS_PROFILE_SID")
_17
.customerProfilesChannelEndpointAssignment.create({
_17
channelEndpointSid: "YOUR_PHONE_NUMBER_SID",
_17
channelEndpointType: "phone-number",
_17
});
_17
_17
console.log(customerProfilesChannelEndpointAssignment.sid);

Output

_10
{
_10
"sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"customer_profile_sid": "YOUR_BUSINESS_PROFILE_SID",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"channel_endpoint_sid": "YOUR_PHONE_NUMBER_SID",
_10
"channel_endpoint_type": "phone-number",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}

3. Create a SHAKEN/STIR Trust Product

3-create-a-shakenstir-trust-product page anchor
  • Note: Do not change the policy_sid from the example below.
  • The response will contain the SID for your Trust Product. You'll need this for the next step.

Create SHAKEN/STIR Trust Product

create-shakenstir-trust-product page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
const trustProduct = await client.trusthub.v1.trustProducts.create({
_16
email: "EMAIL@EMAIL.COM",
_16
friendlyName: "FRIENDLY_NAME_FOR_YOUR_TRUST_PRODUCT",
_16
policySid: "RN7a97559effdf62d00f4298208492a5ea",
_16
});
_16
_16
console.log(trustProduct.sid);

Output

_19
{
_19
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"policy_sid": "RN7a97559effdf62d00f4298208492a5ea",
_19
"friendly_name": "FRIENDLY_NAME_FOR_YOUR_TRUST_PRODUCT",
_19
"status": "draft",
_19
"email": "EMAIL@EMAIL.COM",
_19
"status_callback": "http://www.example.com",
_19
"valid_until": null,
_19
"date_created": "2019-07-30T22:29:24Z",
_19
"date_updated": "2019-07-31T01:09:00Z",
_19
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"links": {
_19
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
_19
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_19
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
_19
},
_19
"errors": null
_19
}

4. Connect your SHAKEN/STIR Trust Product to your Business Profile

4-connect-your-shakenstir-trust-product-to-your-business-profile page anchor
  • You'll need your Trust Product's SID . This was returned by the previous API call.
  • You'll need your Business Profile's SID .
  • To retrieve these SIDs via the API, see the Additional API Calls section below. You can also find them in the Console under Trust Hub.

Connect your SHAKEN/STIR Trust Product to your Business Profile

connect-your-shakenstir-trust-product-to-your-business-profile page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
const trustProductsEntityAssignment = await client.trusthub.v1
_16
.trustProducts("YOUR_TRUST_PRODUCT_SID")
_16
.trustProductsEntityAssignments.create({
_16
objectSid: "YOUR_BUSINESS_PROFILE_SID",
_16
});
_16
_16
console.log(trustProductsEntityAssignment.sid);

Output

_10
{
_10
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"trust_product_sid": "YOUR_TRUST_PRODUCT_SID",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"object_sid": "YOUR_BUSINESS_PROFILE_SID",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}

5. Assign phone numbers to your SHAKEN/STIR Trust Product

5-assign-phone-numbers-to-your-shakenstir-trust-product page anchor
  • You'll need the Phone Number SID(s) you assigned to your Business Profile earlier. ( Note: Only those phone numbers already assigned to your Primary Business Profile are eligible)
  • You'll need your Trust Product SID used earlier.
  • Don't change the ChannelEndpointType
  • You can complete this step before or after submitting your SHAKEN/STIR Trust Product for vetting
  • To check your Business Profile's phone numbers via API, see the Additional API Calls section below.

Assign Phone Numbers to SHAKEN/STIR Trust Product

assign-phone-numbers-to-shakenstir-trust-product page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_17
// Download the helper library from https://www.twilio.com/docs/node/install
_17
import twilio from "twilio";
_17
_17
// Find your Account SID and Auth Token at twilio.com/console
_17
// and set the environment variables. See http://twil.io/secure
_17
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17
const authToken = process.env.TWILIO_AUTH_TOKEN;
_17
const client = twilio(accountSid, authToken);
_17
_17
const trustProductsChannelEndpointAssignment = await client.trusthub.v1
_17
.trustProducts("YOUR_TRUST_PRODUCT_SID")
_17
.trustProductsChannelEndpointAssignment.create({
_17
channelEndpointSid: "YOUR_PHONE_NUMBER_SID",
_17
channelEndpointType: "phone-number",
_17
});
_17
_17
console.log(trustProductsChannelEndpointAssignment.sid);

Output

_10
{
_10
"sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"trust_product_sid": "YOUR_TRUST_PRODUCT_SID",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"channel_endpoint_sid": "YOUR_PHONE_NUMBER_SID",
_10
"channel_endpoint_type": "phone-number",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}

6. Submit your SHAKEN/STIR Trust Product for vetting

6-submit-your-shakenstir-trust-product-for-vetting page anchor
  • Once it reaches Twilio-Approved status, you will be able to sign outbound calls with "A" level attestation.

Submit SHAKEN/STIR Trust Product for Vetting

submit-shakenstir-trust-product-for-vetting page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
import twilio from "twilio";
_14
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = twilio(accountSid, authToken);
_14
_14
const trustProduct = await client.trusthub.v1
_14
.trustProducts("YOUR_TRUST_PRODUCT_SID")
_14
.update({ status: "pending-review" });
_14
_14
console.log(trustProduct.sid);

Output

_19
{
_19
"sid": "YOUR_TRUST_PRODUCT_SID",
_19
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"friendly_name": "friendly_name",
_19
"status": "pending-review",
_19
"email": "email",
_19
"status_callback": "http://www.example.com",
_19
"valid_until": null,
_19
"date_created": "2019-07-30T22:29:24Z",
_19
"date_updated": "2019-07-31T01:09:00Z",
_19
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"links": {
_19
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
_19
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_19
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
_19
},
_19
"errors": null
_19
}


Find Parent Account and Subaccount SIDs

find-parent-account-and-subaccount-sids page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
import twilio from "twilio";
_12
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = twilio(accountSid, authToken);
_12
_12
const accounts = await client.api.v2010.accounts.list({ limit: 20 });
_12
_12
accounts.forEach((a) => console.log(a.authToken));

Output

_45
{
_45
"first_page_uri": "/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0",
_45
"end": 0,
_45
"previous_page_uri": null,
_45
"accounts": [
_45
{
_45
"auth_token": "auth_token",
_45
"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
_45
"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
_45
"friendly_name": "friendly_name",
_45
"owner_account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_45
"sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_45
"status": "active",
_45
"subresource_uris": {
_45
"available_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json",
_45
"calls": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json",
_45
"conferences": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json",
_45
"incoming_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json",
_45
"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
_45
"outgoing_caller_ids": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json",
_45
"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
_45
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
_45
"addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json",
_45
"signing_keys": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json",
_45
"connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json",
_45
"sip": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP.json",
_45
"authorized_connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json",
_45
"usage": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage.json",
_45
"keys": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json",
_45
"applications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json",
_45
"short_codes": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json",
_45
"queues": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json",
_45
"messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json",
_45
"balance": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Balance.json"
_45
},
_45
"type": "Full",
_45
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
_45
}
_45
],
_45
"uri": "/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0",
_45
"page_size": 50,
_45
"start": 0,
_45
"next_page_uri": null,
_45
"page": 0
_45
}

Get Business Profile SID

get-business-profile-sid page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
import twilio from "twilio";
_14
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = twilio(accountSid, authToken);
_14
_14
const customerProfiles = await client.trusthub.v1.customerProfiles.list({
_14
limit: 20,
_14
});
_14
_14
customerProfiles.forEach((c) => console.log(c.sid));

Output

_36
{
_36
"results": [
_36
{
_36
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_36
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_36
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_36
"friendly_name": "friendly_name",
_36
"status": "twilio-approved",
_36
"email": "email",
_36
"status_callback": "http://www.example.com",
_36
"valid_until": "2020-07-31T01:00:00Z",
_36
"date_created": "2019-07-30T22:29:24Z",
_36
"date_updated": "2019-07-31T01:09:00Z",
_36
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_36
"links": {
_36
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
_36
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_36
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
_36
},
_36
"errors": [
_36
{
_36
"code": 18601
_36
}
_36
]
_36
}
_36
],
_36
"meta": {
_36
"page": 0,
_36
"page_size": 50,
_36
"first_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles?Status=draft&FriendlyName=friendly_name&PolicySid=RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
_36
"previous_page_url": null,
_36
"url": "https://trusthub.twilio.com/v1/CustomerProfiles?Status=draft&FriendlyName=friendly_name&PolicySid=RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
_36
"next_page_url": null,
_36
"key": "results"
_36
}
_36
}

Get Phone Number SIDs from Subaccount

get-phone-number-sids-from-subaccount page anchor

Replace $TWILIO_ACCOUNT_SID in the URL with your Subaccount SID

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

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
import twilio from "twilio";
_14
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = twilio(accountSid, authToken);
_14
_14
const incomingPhoneNumbers = await client.incomingPhoneNumbers.list({
_14
limit: 20,
_14
});
_14
_14
incomingPhoneNumbers.forEach((i) => console.log(i.accountSid));

Output

_56
{
_56
"end": 0,
_56
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
_56
"incoming_phone_numbers": [
_56
{
_56
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"address_requirements": "none",
_56
"address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"api_version": "2010-04-01",
_56
"beta": null,
_56
"capabilities": {
_56
"voice": true,
_56
"sms": false,
_56
"mms": true,
_56
"fax": false
_56
},
_56
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_56
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_56
"emergency_status": "Active",
_56
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"emergency_address_status": "registered",
_56
"friendly_name": "(808) 925-5327",
_56
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"origin": "origin",
_56
"phone_number": "+18089255327",
_56
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"sms_application_sid": "",
_56
"sms_fallback_method": "POST",
_56
"sms_fallback_url": "",
_56
"sms_method": "POST",
_56
"sms_url": "",
_56
"status_callback": "",
_56
"status_callback_method": "POST",
_56
"trunk_sid": null,
_56
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_56
"voice_application_sid": "",
_56
"voice_caller_id_lookup": false,
_56
"voice_fallback_method": "POST",
_56
"voice_fallback_url": null,
_56
"voice_method": "POST",
_56
"voice_url": null,
_56
"bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"voice_receive_mode": "voice",
_56
"status": "in-use",
_56
"subresource_uris": {
_56
"assigned_add_ons": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json"
_56
}
_56
}
_56
],
_56
"next_page_uri": null,
_56
"page": 0,
_56
"page_size": 50,
_56
"previous_page_uri": null,
_56
"start": 0,
_56
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0"
_56
}

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

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
import twilio from "twilio";
_14
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = twilio(accountSid, authToken);
_14
_14
const trustProducts = await client.trusthub.v1.trustProducts.list({
_14
limit: 20,
_14
});
_14
_14
trustProducts.forEach((t) => console.log(t.sid));

Output

_32
{
_32
"results": [
_32
{
_32
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_32
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_32
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_32
"friendly_name": "friendly_name",
_32
"status": "twilio-approved",
_32
"email": "email",
_32
"status_callback": "http://www.example.com",
_32
"valid_until": "2020-07-31T01:00:00Z",
_32
"date_created": "2019-07-30T22:29:24Z",
_32
"date_updated": "2019-07-31T01:09:00Z",
_32
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_32
"links": {
_32
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
_32
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_32
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
_32
},
_32
"errors": null
_32
}
_32
],
_32
"meta": {
_32
"page": 0,
_32
"page_size": 50,
_32
"first_page_url": "https://trusthub.twilio.com/v1/TrustProducts?Status=draft&FriendlyName=friendly_name&PolicySid=RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
_32
"previous_page_url": null,
_32
"url": "https://trusthub.twilio.com/v1/TrustProducts?Status=draft&FriendlyName=friendly_name&PolicySid=RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
_32
"next_page_url": null,
_32
"key": "results"
_32
}
_32
}

Check Business Profile Phone Number Assignments

check-business-profile-phone-number-assignments page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
import twilio from "twilio";
_14
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = twilio(accountSid, authToken);
_14
_14
const customerProfilesChannelEndpointAssignments = await client.trusthub.v1
_14
.customerProfiles("YOUR_BUSINESS_PROFILE_SID")
_14
.customerProfilesChannelEndpointAssignment.list({ limit: 20 });
_14
_14
customerProfilesChannelEndpointAssignments.forEach((c) => console.log(c.sid));

Output

_22
{
_22
"results": [
_22
{
_22
"sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_22
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_22
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_22
"channel_endpoint_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_22
"channel_endpoint_type": "phone-number",
_22
"date_created": "2019-07-31T02:34:41Z",
_22
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_22
}
_22
],
_22
"meta": {
_22
"page": 0,
_22
"page_size": 50,
_22
"first_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments?ChannelEndpointSid=PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
_22
"previous_page_url": null,
_22
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments?ChannelEndpointSid=PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
_22
"next_page_url": null,
_22
"key": "results"
_22
}
_22
}


Rate this page: