Skip to contentSkip to navigationSkip to topbar
On this page

Incoming Phone Number Assigned Add-ons Extensions Subresource


This endpoint allows Add-on Listing users to fetch an Extension or view a list of Extensions associated with an assigned Add-on Listing of a Twilio phone number.

When an Add-on Listing is assigned to a Twilio phone number, it is only invoked for communications associated with that phone number rather than the entire Account.

(information)

Info

This API only supports Add-on Listings that are in General Availability (GA) or Beta state. Listings that are labeled as Coming Soon or Developer Preview are not accessible via the API and must be managed in the Console.


Extension Properties

extension-properties page anchor
Property nameTypeRequiredDescriptionChild properties
sidSID<XF>

Optional

Not PII

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

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

account_sidSID<AC>

Optional

The SID of the Account that created the resource.

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

resource_sidSID<PN>

Optional

The SID of the Phone Number to which the Add-on is assigned.

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

assigned_add_on_sidSID<XE>

Optional

The SID that uniquely identifies the assigned Add-on installation.

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

friendly_namestring

Optional

PII MTL: 30 days

The string that you assigned to describe the resource.


product_namestring

Optional

A string that you assigned to describe the Product this Extension is used within.


unique_namestring

Optional

An application-defined string that uniquely identifies the resource. It can be used in place of the resource's sid in the URL to address the resource.


uristring

Optional

The URI of the resource, relative to https://api.twilio.com.


enabledboolean

Optional

Whether the Extension will be invoked.


Fetch an instance of an Extension for the Assigned Add-on.

fetch-an-instance-of-an-extension-for-the-assigned-add-on page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns/{AssignedAddOnSid}/Extensions/{Sid}.json

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the resource to fetch.

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

ResourceSidSID<PN>required

The SID of the Phone Number to which the Add-on is assigned.

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

AssignedAddOnSidSID<XE>required

The SID that uniquely identifies the assigned Add-on installation.

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

SidSID<XF>required

The Twilio-provided string that uniquely identifies the resource to fetch.

Pattern: ^XF[0-9a-fA-F]{32}$Min length: 34Max length: 34
Fetch an ExtensionLink to code sample: Fetch an Extension
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 fetchIncomingPhoneNumberAssignedAddOnExtension() {
11
const extension = await client
12
.incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
14
.extensions("XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
15
.fetch();
16
17
console.log(extension.sid);
18
}
19
20
fetchIncomingPhoneNumberAssignedAddOnExtension();

Output

1
{
2
"sid": "XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"assigned_add_on_sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"resource_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"friendly_name": "Incoming Voice Call",
7
"product_name": "Programmable Voice",
8
"unique_name": "voice-incoming",
9
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
10
"enabled": true
11
}

Retrieve a list of Extensions for the Assigned Add-on.

retrieve-a-list-of-extensions-for-the-assigned-add-on page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns/{AssignedAddOnSid}/Extensions.json

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the resources to read.

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

ResourceSidSID<PN>required

The SID of the Phone Number to which the Add-on is assigned.

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

AssignedAddOnSidSID<XE>required

The SID that uniquely identifies the assigned Add-on installation.

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

Optional

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

Minimum: 1Maximum: 1000

Pageinteger

Optional

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

Minimum: 0

PageTokenstring

Optional

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 listIncomingPhoneNumberAssignedAddOnExtension() {
11
const extensions = await client
12
.incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
14
.extensions.list({ limit: 20 });
15
16
extensions.forEach((e) => console.log(e.sid));
17
}
18
19
listIncomingPhoneNumberAssignedAddOnExtension();

Output

1
{
2
"end": 0,
3
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0",
4
"next_page_uri": null,
5
"page": 0,
6
"page_size": 50,
7
"previous_page_uri": null,
8
"extensions": [
9
{
10
"sid": "XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
11
"assigned_add_on_sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
12
"resource_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
14
"friendly_name": "Incoming Voice Call",
15
"product_name": "Programmable Voice",
16
"unique_name": "voice-incoming",
17
"enabled": true,
18
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
19
}
20
],
21
"start": 0,
22
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0"
23
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.