Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to transfer phone number from master account to subaccount

I have read the tutorial in twilio but its not quite clear.

Can someone lay down the step by step procedure please?

Here is what I got from twilio:

Exchanging Phone Numbers Between Accounts

You can transfer numbers between subaccounts, and between your master account and any one of your subaccounts. You must use your master account's credentials when making the API request to transfer a phone number.

To transfer a phone number between two accounts that you control, make an HTTP POST request to an IncomingPhoneNumber instance resource URI. In the body of the POST set the parameter 'AccountSid' to the AccountSid of the account you wish to own that number. This will remove the phone number from its original account and make it available under the IncomingPhoneNumbers list resource of the new account while retaining all other properties.

Remember, closing a subaccount as described above will release all of that account's phone numbers, so you might consider transferring all numbers to your master account beforehand if you want to keep them.

like image 468
Yvonne Lopez Avatar asked Oct 12 '14 16:10

Yvonne Lopez


People also ask

What is twilio phone number?

Twilio's virtual phone numbers give you instant access to local, national, mobile, and toll-free phone numbers in over 100 countries for your voice call and messaging applications. Leverage local phone numbers for your customers to call and text, or use your own number.

What are twilio sub accounts?

Subaccounts are a divisions within a Twilio project that are "owned" by the project. Subaccounts share the same balance with a project, but have their own usage and resources. All of your project users have access to your subaccounts.


1 Answers

One line with curl https://curl.haxx.se/.

You will need to know:

  • from the account where the phone number currently is

    SOURCE-ACCOUNT-SID

    PHONE-NUMBER-SID

  • from the account where the phone number will be transfered

    DESTINATION-ACCOUNT-SID

  • from your master Twilio account

    MASTER-ACCOUNT-SID

    MASTER-ACCOUNT-TOKEN

Here is the command:

curl -XPOST https://api.twilio.com/2010-04-01/Accounts/SOURCE-ACCOUNT-SID/IncomingPhoneNumbers/PHONE-NUMBER-SID.json -d "AccountSid=DESTINATION-ACCOUNT-SID" -u "MASTER-ACCOUNT-SID:MASTER-ACCOUNT-TOKEN"

.

Note: when you replace the values it looks something like this

curl -XPOST https://api.twilio.com/2010-04-01/Accounts/AC0123456789abcdefabcdefabcdefabcd/IncomingPhoneNumbers/PN0123456789abcdefabcdefabcdefabcd.json -d "AccountSid=AC0123456789abcdefabcdefabcdefabcd" -u "AC0123456789abcdefabcdefabcdefabcd:0123456789abcdefabcdefabcdefabcd"

like image 103
Alex Baban Avatar answered Oct 01 '22 07:10

Alex Baban