Knowladge Base

2A PURCHASE A DID

Method for Purchasing a DID By using this method the user can purchase a DID. The user has to provide user id, password, DID Number (which he wants to purchase), SIP URL or IAX ,flag (1 for SIP URL or 2 for IAX) and/or Vendor ID. In case of successful purchase, the DID number itself would be returned. Otherwise, an error code would be returned which is described later.

 

Example URL:

http://newapi.didx.net/DidxApis/api/BuyDIDByNumber.php?UserID=700290&Password=XXXX&DIDNumber=14194643509

 

Example Code in PHP:

<?php

$curl_handle = curl_init();

$url = "http://newapi.didx.net/DidxApis/api/BuyDIDByNumber.php?UserID=700290&Password=XXXX&DIDNumber=14194643509";

curl_setopt($curl_handle, CURLOPT_URL, $url);

curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);

$curl_data = curl_exec($curl_handle);

curl_close($curl_handle);

$response_data = json_decode($curl_data);

print_r($response_data);

die();

?>

 

Input Fields:

    1. UserID
    2. Password
    3. DIDNumber
    4. SIPorIAX
    5. Flag
    6. VendorID

 

Returned Fields:

    1. Flags: 1 = SIP 2 = IAX

 

Error Codes:

In case of any incorrect information provided by the user or in case of no matching data, an error code will be returned. Error codes correspond to the following messages:

-1 = User ID does not exist

-2 = Your Password is Incorrect

-3 = This DID Number is already Sold

-4 = This DID Number is already Reserved

-5 = DID Number doesn’t exit

-6 = The Country Code does not exist

-20 = Account not active

-22 = Due not cleared

-23 = Customer documents required. See Also Submiting Documents

-24 = This DID is reserved for another customer

-30 = Invalid Account Type

-31 = Rating of this DID is less then the one you have been allowed