BuyNumbers REST function
This function will allow you to purchase a phone number.
If you like to keep things simple, its just a matter of defining a default ringto URI (https://www.multitel.net/auth/setting , in the "URI Settings" tab) and then calling the URL below:
http://api.multitel.net/json/buynumbers/USERNAME/PASSWORD/NUMBER
A successful call will return the following message:
{"DATA":[{"RETURN":1234567890}]} <= this is presuming you were trying to purchase phone number 1234567890
An unsuccessful call will return one of the following messages:
{"DATA":[{"RETURN":99}]} <== not enough balance to purchase number
{"DATA":[{"RETURN":100}]} <== not authenticated (Check username/password)
{"DATA":[{"RETURN":-165}]} <== number has already been sold (check your account, possibly you hit the refresh button twice and you already purchased the number?)
{"DATA":[{"RETURN":-220}]} <== number is reserved (might happen when number was just released, please try again in a few minutes)
{"DATA":[{"RETURN":-275}]} <== this number does not exist in our inventory anymore
{"DATA":[{"RETURN":-1210}]} <== number not cleared
{"DATA":[{"RETURN":-1265}]} <== documentation required - usually proof of address / ID card copy (please contact us for more info.
If you need to specify more parameters, read on:
POST URL: http://api.multitel.net/json/buynumbers/
POST Parameters:
UserName | Your login Username or your API Username |
Password | Your login Password or your API Password |
Number | The phone number you want to purchase |
Description | Short description (if none provided, defaults to Number) |
Type | Equivalent to "Forward Destination" from the web interface. Possible values are : 1 (for SIP) or 2 (for Dial) |
RingType | 1 For Sequential , 2 for Random , 3 for Simultaneous |
Ringstyle | 1 for Ring, 2 for Music (Early Media) |
URI | First SIP URI to ring (or phone number to dial -- no 00/011/+ prefix please) |
URI2 | Second SIP URI to ring |
URI3 | Third SIP URI to ring |
SMSRingType | 1 for E-Mail , 2 for URL Post |
SMSURI | either E-Mail address, either the POST url |
FaxDetect | 1 for enabled, 0 for disabled . If not specified, defaults to 0 |
FaxEmail | E-mail where to forward fax |
FaxRing | How many seconds should we listen for fax tones? Defaults to 5 |
Vm | VoiceMail enabled ? Possible values 1 or 0 |
Vmring | How many seconds before VM kicks in |
Vms2t | Voicemail Speech 2 Text -- 1 for enabled, 0 for disabled |
Vmemail | E-Mail address where to forward VoiceMails to |
Cnam | Enable CNAM lookups (possible values 0 or 1 -defaults to 0) |
Record | Record the phone conversations (0 or 1 , defaults to 0) |
Screening | Screen callers (ask them to identify themselves before being connected - possible values 0 or 1 , defaults ot 0 |
Channels | How many channels do we need? Defaults to 2 unless number has only 1 channel available. Please note that for SMS Only numbers (Numbers that have no VoIP capability), this setting has no effect, so do not set it if you won't need it. |
Atcd | Automatic Telemarketer Call Detection -- feature that listens for automated/robo calls and hangs up if such call is detected . Possible values 1 or 0 , defaults to 0 |
SID | Sub Account ID -- define your subaccounts at https://www.multitel.net/auth/setting/ in the SubAccounts tab |
GET URL:
http://api.multitel.net/json/buynumbers/UserName/Password/Number/Description/Type/RingType/Ringstyle/URI/URI2/URI3/SMSRingType/ .... etc
Please note that the parameters used for GET are exactly the same as the parameters used for POST and they should be used in the exact order as they are listed in
the table above.
We strongly recommend that you use POST instead of GET as it minimizes the risk of switching parameters around.