List My Phone Number Inventory Inside Twilio Flex
I need to show a list of my purchased phone numbers inside my flex app in order to let the agent choose which number to call from. I've been checking both REST and flex/manager doc
Solution 1:
List all IncomingPhoneNumber resources for your account
curl -X GET 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=20' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
Source: https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource
Solution 2:
You can do this with Active Numbers API. The API is still in the developer preview (August, 2020).
$ curl -G https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy.json \
    -u '<ACCOUNT_SID:AUTH_TOKEN>'The API returns the set of active telephone numbers along with their capabilities
[{
    "phone_number": "+18559728742",
    "url": "https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
    "capabilities": {
        "voice": {
            "inbound_connectivity": true,
            "outbound_connectivity": true,
            "e911": false,
            "fax": true,
            "calls_per_second": 20,
            "concurrent_calls_limit": 40,
            "long_record_length": 30,
            "inbound_called_dtmf": true,
            "inbound_caller_dtmf": true,
            "sip_trunking": true,
            "inbound_caller_id_preservation": "international",
            "inbound_reachability": "global"
        },
        "sms": {
            ....
]
Post a Comment for "List My Phone Number Inventory Inside Twilio Flex"