Before you start

Sandbox

Please use this URL for your code while you testing (SandBox API). https://sandbox-api.didww.com/api2/index.php?wsdl

The commercial API URL is: https://api.didww.com/api2/?wsdl

SOAP

DIDWW API use SOAP protocol to exchange information between DIDWW and your website.

More resources about SOAP:

http://en.wikipedia.org/wiki/SOAP

http://www.w3.org/TR/soap

Authentication Key

Please obtain your API Username and API Security Key from your DIDWW Account -> API section.

This sample is used on reseller's production server for public.

Web Site WSDL URL: http://api.didww.com/api2/?wsdl


def auth_string
require 'digest/sha1'
Digest::SHA1.hexdigest(@api_username + @api_key)
end

This sample is used on DID World Wide Sandbox for testing.

  • Please, note: We are adding word "sandbox" to authentication string
  • Web Site WSDL URL:
https://sandbox-api.didww.com/api2/index.php?wsdl

def auth_string
require 'digest/sha1'
Digest::SHA1.hexdigest(@api_username + @api_key + "sandbox")
end

This sample is used on reseller's production server for public.

Web Site WSDL URL: http://api.didww.com/api/?wsdl


$username = 'username@domain.com'
$key = '123456780909';
$auth_string = sha1($username.$key);

This sample is used on DID World Wide Sandbox for testing.

  • Please, note: We are adding word "sandbox" to authentication string
  • Web Site WSDL URL:
https://sandbox-api.didww.com/api2/index.php?wsdl

$username = 'username@domain.com';
$key = '123456780909';
$auth_string = sha1($username.$key.'sandbox');

This sample is used on reseller's production server for public.

Web Site WSDL URL: http://api.didww.com/api/?wsdl


#!/usr/bin/perl -w
use Digest::SHA1 qw(sha1_hex);
$username = 'username@domain.com';
$key = '12345678909';
my $auth_string = sha1_hex($username.$key);

This sample is used on DID World Wide Sandbox for testing.

  • Please, note: We are adding word "sandbox" to authentication string
  • Web Site WSDL URL:
https://sandbox-api.didww.com/api2/index.php?wsdl

#!/usr/bin/perl -w
use Digest::SHA1 qw(sha1_hex);
$username = 'username@domain.com';
$key = '12345678909';
my $auth_string = sha1_hex($username.$key.'sandbox');

This sample is used on reseller's production server for public.

Web Site WSDL URL: http://api.didww.com/api/?wsdl

int auth_string = "username@domain.com" + "12345678909"

This sample is used on DID World Wide Sandbox for testing.

  • Please, note: We are adding word "sandbox" to authentication string
  • Web Site WSDL URL:
https://sandbox-api.didww.com/api2/index.php?wsdl
int auth_string = "username@domain.com" + "12345678909" + "sandbox"

Get DIDWW Regions

This method will return list of regions from DIDWW coverage list.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
country_iso xsd:string Yes Country ISO Code
city_prefix xsd:string Yes City Prefix
last_request_gmt xsd:string Yes Date in UNIXTIME GMT format. Get list of updated regions starting from date of the last request
Response

RegionsList (array)

Sample response

Array (
  [0] => stdClass Object (
    [country_name] => Russian Federation
    [country_prefix] => 7
    [country_iso] => RU
    [cities] => Array
            (
              [0] => stdClass Object
                (
                  [city_id] => 107
                  [city_name] => Moscow
                  [city_prefix] => 495
                  [city_nxx_prefix] =>
                  [setup] => 0
                  [monthly] => 60.9
                  [isavailable] => 1
                  [islnrrequired] => 0
                )
                ...
            )
    )
  ...
)
Parameters
Part Name Part Type Description
country_name xsd:string Country Name
country_prefix xsd:string Country Prefix
country_iso xsd:string Country ISO Code
city_id xsd:string City ID
city_name xsd:string City Name
city_prefix xsd:string City Area Prefix
city_nxx_prefix xsd:string City Prefix
setup xsd:string Setup fee
monthly xsd:string DID monthly price
isavailable xsd:int Returns 1 if city is available, 0 - if not
islnrrequired xsd:int Returns 1 if country requires special registration, 0 - if not

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_getdidwwregions(country_iso, city_prefix, last_request_gmt, city_id)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  "auth_string" => $authstr,
  "country_iso" => "RU",
  "city_prefix" => null,
  "last_request_gmt" => null
);

$errorCode = null;
$errorString = null;
$result = null;

try {
  $result = $client->__soapCall("didww_getdidwwregions", $params);
} catch(SoapFault $e) {
  $errorCode = $e->faultcode;
  $errorString = $e->faultstring;
} catch(Exception $e) {
  $errorCode = $e->getCode();
  $errorString = $e->getMessage();
}

Get DIDWW PSTN Rates

This method will return list of supported PSTN prefixes from DIDWW.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
country_iso xsd:string Yes Country ISO Code
pstn_prefix xsd:string Yes PSTN Prefix
last_request_gmt xsd:string Yes Date in UNIXTIME GMT format. Get list of updated PSTN Rates starting from date of the last request
Response

RatesList (array)

Sample response

Array
(
  [0] => stdClass Object
    (
      [country_name] => Russian Federation
      [country_prefix] => 7
      [country_iso] => RU
      [networks] => Array
        (
          [0] => stdClass Object
            (
              [network_name] => Local
              [network_prefix] => 7
              [cost_rate] => 0.25
              [sell_rate] => 0.25
            )
            ...
        )
    )
    ...
)
Parameters
Part Name Part Type Description
country_name xsd:string Country Name
country_prefix xsd:string Country Prefix
country_iso xsd:string Country ISO Code
network_name xsd:string Network Name
network_prefix xsd:string Network Prefix
cost_rate xsd:string Cost Rate
sell_rate xsd:string Sell Rate

This code example is based on ruby class DidwwAPI which can be found here.

client = DidwwAPI.new
response = client.didww_getdidwwpstnrates(country_iso, pstn_prefix, last_request_gmt)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
"auth_string" => $authstr,
"country_iso" => "RU",
"pstn_prefix" => null,
"last_request_gmt" => null
);
...
$result = $client->__soapCall("didww_getdidwwpstnrates", $params);
...

Update PSTN Rates

This method will change PSTN tariffs for resellers through their Staff panel.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
rates tns:RatesListIn No Rate List
Response

GlobalResponse (object)

Sample response

stdClass Object
(
  [result] => 0
  [error] => 0
)
Parameters
Part Name Part Type Description
result xsd:string Returns 0 if success, 1 - if there any errors
error xsd:string Returns error number

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_updatepstnrates(rates)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  "auth_string" => $authstr,
  "rates" => array(
    0 => array(
    "network_prefix" => 93,
    "sell_rate" => 6.720
  ),
  1 => array(
    "network_prefix" => 26391,
    "sell_rate" => 4.800
    )
  )
);
...
$result = $client->__soapCall("didww_updatepstnrates", $params);
...

Check PSTN Number

This method will validate a PSTN Number.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
pstn_number xsd:string No PSTN number
Response

GlobalResponse (object)

Sample response
stdClass Object
              (
              [result] => 0
              [error] => 0
              ) 
Parameters
Part Name Part Type Description
result xsd:string Returns 0 if success, 1 - if there any errors
error xsd:string Returns error number

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_checkpstnnumber(pstn_number)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  "auth_string" => $authstr,
  "pstn_number" => "21376576"
);
...
$result = $client->__soapCall("didww_checkpstnnumber", $params);
...

Order Create

This method will purchase new service.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string No Customer ID (from your local database, any digit)
country_iso xsd:string No Country ISO Code
city_prefix xsd:string No City Prefix
period xsd:int No Period (months)
map_data tns:MappingDataIn No Forwarding data
prepaid_funds xsd:string No Amount in points
uniq_hash xsd:string No Unique md5 hash (Minimum 32 characters length). If unique hash has already been processed, method returns the information about DID number that was previously created with the same unique hash.
city_id xsd:string No City ID
autorenew_enable xsd:string Yes Enable automatic renewal
Response

service_data (object)

Sample response

                  stdClass Object
                  (
                  [result] => 0
                  [country_name] => Austria
                  [country_iso] => AT
                  [city_name] => National Wide
                  [city_prefix] => 720
                  [city_id] => 175
                  [did_number] => 43720100125
                  [did_status] => 1
                  [did_timeleft] => 7776000
                  [did_expire_date_gmt] => 2011-03-21 14:01:25
                  [order_id] => 299659
                  [order_status] => Completed
                  [did_mapping_format] => PSTN:3763123126663
                  [did_setup] => 0.00
                  [did_monthly] => 5.00
                  [did_period] => 3
                  [autorenew_enable] => 1
                  [prepaid_balance] => 8326.51
                  )
Parameters
Part Name Part Type Description
result xsd:string Returns 0 if success, 1 - if there any errors
country_name xsd:string Country Name
country_iso xsd:string Country ISO code
city_name xsd:string City Name
city_prefix xsd:string City Prefix
city_id xsd:int City ID
did_number xsd:string DID Number
did_status xsd:string DID Status (see full list below)
did_timeleft xsd:string Time left of the DID Number
did_expire_date_gmt xsd:string Expiration date in GMT
order_id xsd:string Order ID on DIDWW
order_status xsd:string Order status (see full list below)
did_mapping_format xsd:string Forwarding data
did_setup xsd:string Setup fee for reseller
did_monthly xsd:string Monthly fee for reseller
did_period xsd:int Period
autorenew_enable xsd:string Return 1 if autorenew enabled, 0 - if autorenew disabled
prepaid_balance xsd:string Balance amount in points
DID Status
Status Value Status Description
-2 Removed (moved to SAP, SRL, NRL, reserved by customer or will be removed soon)
-1 Blocked (Expired, Canceled or Suspended)
0 Unknown (DID number does not exist or status is unknown)
1 Active DID number
Order Status
Status Value Status Description Possible DID Status
Completed Completed order 1
Pending Pending order -1, 0, 1
Canceled Order was canceled -2, -1, 0

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_ordercreate(customer_id, country_iso, city_prefix, period, map_data,
prepaid_funds, uniq_hash, city_id)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
"auth_string" => $authstr,
"customer_id" => "62",
"country_iso" => "AT",
"city_prefix" => "720",
"period" => 3,
"map_data" => array(
"map_type" => "PSTN",
"map_proto" => "0",
"map_detail" => "xxxxxxxxxxxx", //Phone number in the international format
"map_pref_server" => 0, // map_pref_server can be: 0 – Local Server (automatic detection), 1 – USA
Server, 3 – Europe Server
"map_itsp_id" => null
"cli_format"=>"raw", //RAW - Do not alter CLI (default); E164 - Attempt to convert CLI to E.164
format; Local - Attempt to convert CLI to Localized format
"cli_prefix"=>"" //CLI can be prefixed with optional '+' sign followed by up to 6 characters
including digits and '#'
),
"prepaid_funds" => "0",
"uniq_hash" => md5($order_id) //uniq order id stored in local database
);
...
$result = $client->__soapCall("didww_ordercreate", $params);
...

* Important! CLI format conversation may not work correctly for phone calls originated from outside of DID country

This sample code is used for PSTN call forwarding. For other forwarding destinations array "map_data" changes in the following ways:

VoIP (SIP)


"map_type" => "URI",
"map_proto" => "SIP",
"map_detail" => "12.34.56.78/3763126666123",
"map_pref_server" => 0, // map_pref_server can be: 0 – Local Server (automatic detection), 1 – USA Server, 3 –
Europe Server
"map_itsp_id" => null
"cli_format"=>"raw", //RAW - Do not alter CLI (default); E164 - Attempt to convert CLI to E.164 format; Local -
Attempt to convert CLI to Localized format
"cli_prefix"=>"" //CLI can be prefixed with optional '+' sign followed by up to 6 characters including digits and
'#'

VoIP (H.323)


"map_type" => "URI",
"map_proto" => "H323",
"map_detail" => "12.34.56.78/3763126666123",
"map_pref_server" => 0, // map_pref_server can be: 0 – Local Server (automatic detection), 1 – USA Server, 3 –
Europe Server
"map_itsp_id" => null
"cli_format"=>"raw", //RAW - Do not alter CLI (default); E164 - Attempt to convert CLI to E.164 format; Local -
Attempt to convert CLI to Localized format
"cli_prefix"=>"" //CLI can be prefixed with optional '+' sign followed by up to 6 characters including digits and
'#'

VoIP (IAX)


"map_type" => "URI",
"map_proto" => "IAX",
"map_detail" => "12.34.56.78/3763126666123",
"map_pref_server" => 0, // map_pref_server can be: 0 – Local Server (automatic detection), 1 – USA Server, 3 – Europe
Server
"map_itsp_id" => null
"cli_format"=>"raw", //RAW - Do not alter CLI (default); E164 - Attempt to convert CLI to E.164 format; Local -
Attempt to convert CLI to Localized format
"cli_prefix"=>"" //CLI can be prefixed with optional '+' sign followed by up to 6 characters including digits and
'#'

ITSP


"map_type" => "ITSP",
"map_proto" => "0",
"map_detail" => "example.com/account-number", // Provider domain with account details
"map_pref_server" => 0, // map_pref_server can be: 0 – Local Server (automatic detection), 1 – USA Server, 3 – Europe
Server
"map_itsp_id" => "123456789" // Provider ID
"cli_format"=>"raw", //RAW - Do not alter CLI (default); E164 - Attempt to convert CLI to E.164 format; Local - Attempt
to convert CLI to Localized format
"cli_prefix"=>"" //CLI can be prefixed with optional '+' sign followed by up to 6 characters including digits and
'#'

Order Cancel

This method will cancel order and remove purchased services.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string No Customer ID (from your local database, any digit)
did_number xsd:string No DID number to cancel
Response

GlobalResponse (object)

Sample response

stdClass Object
(
  [result] => 0
  [error] => 0
)
Parameters
Part Name Part Type Description
result xsd:string Returns 0 if success, 1 - if there any errors
error xsd:string Returns error number

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_ordercancel(customer_id, did_number)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
"auth_string" => $authstr,
"customer_id" => "62",
"did_number" => "1403345102"
);
...
$result = $client->__soapCall("didww_ordercancel", $params);
...

Order Autorenew

This method will renew active service for specific period.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string No Customer ID (from your local database, any digit)
did_number xsd:string No DID Number to renew
period xsd:string No Month(s) to renew for
uniq_hash xsd:string No Unique md5 hash (minimum 32 characters length)
Response

service_data (object)

Sample response

  stdClass Object
  (
    [result] => 0
    [country_name] => Austria
    [city_name] => National Wide
    [did_number] => 43720100125
    [did_status] => 1
    [did_timeleft] => 7776000
    [did_expire_date_gmt] => 2011-03-21 14:01:25
    [order_id] => 299659
    [order_status] => Completed
    [did_mapping_format] => PSTN:3763123126663
    [did_setup] => 0.00
    [did_monthly] => 5.00
    [did_period] => 3
    [prepaid_balance] => 8326.51
  )
Parameters
Part Name Part Type Description
result xsd:string Returns 0 if success, 1 - if there any errors
country_name xsd:string Country Name
country_iso xsd:string Country ISO Code
city_name xsd:string City Name
city_prefix xsd:string City Prefix
did_number xsd:string DID Number
did_status xsd:string DID Status (see full list below)
did_timeleft xsd:string Time left of the DID Number
did_expire_date_gmt xsd:string Expiration date in GMT
order_id xsd:string Order ID on DIDWW
order_status xsd:string Order status (see full list below)
did_mapping_format xsd:string Forwarding data
did_setup xsd:string Setup fee for reseller
did_monthly xsd:string Monthly fee for reseller
did_period xsd:int Period
prepaid_balance xsd:string Customer Balance in points
DID Status
Status Value Status Description
0 Unknown
1 Active
-1 Blocked
-2 Removed
Order Status
Status Value Status Description
Completed Completed order
Pending Pending order
Canceled Order was canceled

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_orderautorenew(customer_id, did_number, period, uniq_hash)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
"auth_string" => $authstr,
"customer_id" => "62",
"did_number" => "1403345102",
"period" => "6",
"uniq_hash" => md5(gmdate("Y-m-d") . '.' . $order_id)
);
...
$result = $client->__soapCall("didww_orderautorenew", $params);
...

Update Mapping

This method will change/update forwarding data for DID Number.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string No Customer ID (from your local database, any digit)
did_number xsd:string No DID Number
map_data tns:MappingDataIn No Forwarding data
Response

GlobalResponse (object)

Sample response

stdClass Object
(
  [result] => 0
  [error] => 0
)
Parameters
Part Name Part Type Description
result xsd:string Returns 0 if success, 1 - if there any errors
error xsd:string Returns error number

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_updatemapping(customer_id, did_number, map_data)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
"auth_string" => $authstr,
"customer_id" => "62",
"did_number" => "43720100124",
"map_data" => array(
"map_type" => "PSTN",
"map_proto" => "0",
"map_detail" => "xxxxxxxxxxxx", //Phone number in the international format
"map_pref_server" => 0, // map_pref_server can be: 0 – Local Server (automatic detection), 1 –
USA Server, 3 – Europe Server
"map_itsp_id" => null,
"cli_format"=>"raw", //raw - Do not alter CLI (default); e164 - Attempt to convert CLI to
E.164 format; Local - Attempt to convert CLI to Localized format
"cli_prefix"=>"" //CLI can be prefixed with optional '+' sign followed by up to 6 characters
including digits and '#'
)
);
...
$result = $client->__soapCall("didww_updatemapping", $params);
...

* Important! CLI format conversation may not work correctly for phone calls originated from outside of DID country

This sample code is used for PSTN call forwarding. For other forwarding destinations array "map_data" changes in the following ways:

VoIP (SIP)


"map_type" => "URI",
"map_proto" => "SIP",
"map_detail" => "12.34.56.78/3763126666123",
'map_pref_server' => 0, // map_pref_server can be: 0 – Local Server (automatic detection), 1 – USA Server, 3 –
Europe Server
'map_itsp_id' => null,
"cli_format"=>"raw", //RAW - Do not alter CLI (default); E164 - Attempt to convert CLI to E.164 format; Local -
Attempt to convert CLI to Localized format
"cli_prefix"=>"" //CLI can be prefixed with optional '+' sign followed by up to 6 characters including digits and
'#'

VoIP (H.323)


"map_type" => "URI",
"map_proto" => "H323",
"map_detail" => "12.34.56.78/3763126666123",
'map_pref_server' => 0, // map_pref_server can be: 0 – Local Server (automatic detection), 1 – USA Server, 3 –
Europe Server
'map_itsp_id' => null,
"cli_format"=>"raw", //RAW - Do not alter CLI (default); E164 - Attempt to convert CLI to E.164 format; Local -
Attempt to convert CLI to Localized format
"cli_prefix"=>"" //CLI can be prefixed with optional '+' sign followed by up to 6 characters including digits and
'#'

VoIP (IAX)


"map_type" => "URI",
"map_proto" => "IAX2",
"map_detail" => "12.34.56.78/3763126666123",
'map_pref_server' => 0, // map_pref_server can be: 0 – Local Server (automatic detection), 1 – USA Server, 3 –
Europe Server
'map_itsp_id' => null,
"cli_format"=>"raw", //RAW - Do not alter CLI (default); E164 - Attempt to convert CLI to E.164 format; Local -
Attempt to convert CLI to Localized format
"cli_prefix"=>"" //CLI can be prefixed with optional '+' sign followed by up to 6 characters including digits and
'#'

ITSP


"map_type" => "ITSP",
"map_proto" => "SIP",
"map_detail" => "example.com/account-number", // Provider domain with account details
'map_pref_server' => 0, // map_pref_server can be: 0 – Local Server (automatic detection), 1 – USA Server, 3 –
Europe Server
'map_itsp_id' => "123456789", // Provider ID
"cli_format"=>"raw", //RAW - Do not alter CLI (default); E164 - Attempt to convert CLI to E.164 format; Local -
Attempt to convert CLI to Localized format
"cli_prefix"=>"" //CLI can be prefixed with optional '+' sign followed by up to 6 characters including digits and
'#'

Get Prepaid Balance

This method will return current Prepaid Balance of customer.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string No Customer ID (from your local database, any digit)
Response

prepaid_data (object)

Sample response

stdClass Object
(
  [result] => 0
  [error] => 0
  [prepaid_balance] => 8276.01000
)
Parameters
Part Name Part Type Description
result xsd:int Returns 0 if success, 1 - if there any errors
error xsd:string Returns error number
prepaid_balance xsd:string Balance amount in points

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_getprepaidbalance(customer_id)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
"auth_string" => $authstr,
"customer_id" => "62"
);
...
$result = $client->__soapCall("didww_getprepaidbalance", $params);
...

Update Prepaid Balance

This method will update customer's Prepaid Balance. Add/Remove points.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string No Customer ID (from your local database, any digit)
prepaid_funds xsd:string No Amount in points
operation_type xsd:int No 1 - Add funds (positive amount), 2 - Remove funds (negative amount)
uniq_hash xsd:string No Unique md5 hash (Minimum 32 characters length)
Response

prepaid_data (object)

Sample response

stdClass Object
(
  [result] => 0
  [error] => 0
  [prepaid_balance] => 8326.51000
)
Parameters
Part Name Part Type Description
result xsd:int Returns 0 if success, 1 - if there any errors
error xsd:string Returns error number
prepaid_balance xsd:string Balance amount in points

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_updateprepaidbalance(customer_id, prepaid_funds, operation type,
uniq_hash)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
"auth_string" => $authstr,
"customer_id" => "62",
"prepaid_funds" => "50.5",
"operation_type" => 1,
"uniq_hash" => md5($order_id)
);
...
$result = $client->__soapCall("didww_updateprepaidbalance", $params);
...

DID Number Restore

This method will restore canceled and expired DID number within aging period.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string No Customer ID (from your local database, any digit)
did_number xsd:string No DID Number to be restored
period xsd:int No Period (months)
uniq_hash xsd:string No Unique md5 hash (Minimum 32 characters length)
isrenew xsd:int Yes If set to 1 - specified order will be renewed, if set to 0 - no.
Response

GlobalResponse (object)

Sample response
stdClass Object
(
  [result] => 0
  [error] => 0
)
Parameters
Part Name Part Type Description
result xsd:int Returns 0 if success, 1 - if there any errors
error xsd:string Returns error number

This code example is based on ruby class DidwwAPI which can be found here.


                  

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
"auth_string" => $authstr,
"customer_id" => "62",
"did_number" => "1403345102",
"period" => "6",
"uniq_hash" => md5($order_id) //uniq order ID stored in local database
"isrenew" => "1"
);
...
$result = $client->__soapCall("didww_didrestore", $params);
...

Get DIDWW API Details

This method will return configuration settings for reseller.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
Response

api_didwwdata (object)

Sample response


stdClass Object
(
  [result] => 0
  [error] => 0
  [api_version] => Sandbox API 2.0.154
  [reseller_did_pricelist] => Retail
  [reseller_id] => 147200
  [reseller_pstn_tariff] => Retail Main
  [reseller_balance] => 49986.1000
  [reseller_balance_status] => Active
)
Parameters
Part Name Part Type Description
result xsd:int Returns 0 if success, 1 - if there any errors
error xsd:string Returns error number
api_version xsd:string Returns version of DIDWW API
reseller_did_pricelist xsd:string Assigned DID Pricelist Plan name
reseller_pstn_tariff xsd:string Assigned PSTN Tariff name
reseller_id xsd:string Reseller ID
reseller_balance xsd:string Returns balance of reseller ( USD )
reseller_balance_status xsd:string Returns status of reseller's balance ( Disabled/Active/Suspended )

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_ getdidwwapidetails

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
"auth_string" => $authstr
);
...
$result = $client->__soapCall("didww_getdidwwapidetails", $params);
...

Get Service Details

This method will return order details on the API for the component synchronization.

Parameters
Part Name Part Type Optional Description
customer_id xsd:string No Customer ID (from your local database, any digit)
api_order_id xsd:string No Order ID on API
did_number xsd:string Yes DID Number

* Important: "api_order_id" and "did_number" parameters are interchangeable, so query can be done by Order ID _OR_ DID number.

Response

service_data (object)

Sample response

stdClass Object
(
  [result] => 0
  [country_name] => Denmark
  [country_iso] => DK
  [city_name] => Geographical
  [city_prefix] => 3
  [did_number] => 453100101
  [did_status] => -1
  [did_timeleft] => -5757041
  [did_expire_date_gmt] => 2011-02-11 17:43:33
  [order_id] => 300005
  [order_status] => Completed
  [did_mapping_format] => SKYPE:skypename
  [did_setup] => 0.00
  [did_monthly] => 8.00
  [did_period] => 1
  [prepaid_balance] => 9411.24000
)
Parameters
Part Name Part Type Description
result xsd:int Returns 0 if success, 1 - if there any errors
country_name xsd:string Country Name
country_iso xsd:string Country ISO Code
city_name xsd:string City Name
city_prefix xsd:string City Area Prefix
did_number xsd:string DID Number
did_status xsd:string DID Status (see full list below)
did_timeleft xsd:string Time left of the DID Number
did_expire_date_gmt xsd:string Expiration date in GMT
order_id xsd:string Order ID on DIDWW
order_status xsd:string Order status (see full list below)
did_mapping_format xsd:string Forwarding data
did_setup xsd:string Setup fee for reseller
did_monthly xsd:string Monthly fee for reseller
did_period xsd:int Period
prepaid_balance xsd:string Customer Balance in points
DID Status
Status Value Status Description
-2 Removed (moved to SAP, SRL, NRL*, reserved by customer or will be removed soon)
-1 Blocked (Expired, Canceled or Suspended)
0 Unknown (DID number does not exist or status is unknown)
1 Active DID number
  • SAP - Service Aging Pool
  • SRL - Service Removed List
  • NRL - Not-Renewed DID Numbers
Order Status
Status Value Status Description Possible DID Status
Completed Completed order 1
Pending Pending order -1, 0, 1
Canceled Order was canceled -2, -1, 0

This code example is based on ruby class DidwwAPI which can be found here.


client = DidwwAPI.new
response = client.didww_getservicedetails(customer_id, api_order_id)
                    

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  "auth_string" => $authstr,
  "customer_id" => $customer_id,
  "api_order_id" => $api_order_id
);
$errorCode = null;
$errorString = null;
$result = null;
try {
  $result = $client->__soapCall("didww_getservicedetails", $params);
} catch(SoapFault $e) {
  $errorCode = $e->faultcode;
  $errorString = $e->faultstring;
} catch(Exception $e) {
  $errorCode = $e->getCode();
  $errorString = $e->getMessage();
}
                       

* Important: DID Number parameter can be used instead of Order ID on API:

"api_order_id" => $api_order_id

_OR_

"did_number" => $did_number

Get CDR Log

This method will return call data records for specified User, DID number, or date period.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string Yes Customer ID (from your local database, any digit)
did_number xsd:string Yes DID Number
from_date xsd:string Yes Start date from which call records will be retrieved
to_date xsd:string Yes End date date to which call records will be retrieved
limit xsd:string Yes Maximum number of call log records to return
offset xsd:string Yes The offset of the position
order xsd:string Yes Order records by a specific field
order_Dir xsd:string Yes Sort rows in ascending or descending order
Response

CDRFull (object)

Sample response

array
0 =>
object(stdClass)[179]
[customer_id] => int 201
[source] => '123456789101' (length=12)
[destination] => '109876543210' (length=12)
[status] => 'ok' (length=2)
[date_gmt] => '2012-04-25 08:14:54' (length=19)
[duration] => '0' (length=1)
[reseller_billed_usd] => null
[customer_billed_points] => null
[reason] => 200
[caller_id] => '123456789'
Parameters
Part Name Part Type Description
customer_id xsd:int Customer ID (from your local database, any digit)
source xsd:string Callee ID
destination xsd:string Caller ID
status xsd:string Hang-up status
date_gmt xsd:string Call date (UNIXTIME GMT)
duration xsd:string Duration of the call
reseller_billed_usd xsd:string Billed amount for Reseller (USD)
customer_billed_points xsd:string Billed amount for reseller's customer (Points)
reason xsd:int Call End reason
caller_id xsd:string Caller telephone number

                          

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  'auth_string' => $authstr,
  'customer_id' => $customer_id,
  'did_number' => $did_number,
  'from_date' => $from_date,
  'to_date' => $to_date,
  'limit' => $limit,
  'offset' => $offset,
  'order' => $order,
  'order_Dir' => $order_Dir
);

$result = $client->__soapCall("didww_getcdrlog", $params);

Call History Invoices

This method will return data for invoice generation based on CDR.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string Yes Customer ID (from your local database, any digit)
from_date xsd:string Yes Start date from which call records will be retrieved
to_date xsd:string Yes End date date to which call records will be retrieved
Response

used_amount_data (object)

Sample response

object
0 =>
  object(stdClass)[166]
  [amount] => 1000
  [customer_id] => 61
Parameters
Part Name Part Type Description
amount xsd:string Invoice amount (in points)
customer_id xsd:string Customer ID (from your local database, any digit)

client = DidwwAPI.new
response = client.didww_callhistory_invoices(customer_id, from_date, to_date)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  'auth_string' => $authstr,
  'customer_id' => $customer_id,
  'from_date' => $from_date,
  'to_date' => $to_date
);

$result = $client->__soapCall("didww_callhistory_invoices", $params);

Get Prepaid Balance List

This method will return array of balances of all customers.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string Yes Customer ID (from your local database, any digit)
Response

PrepaidBalanceList (object)

Sample response

stdClass Object
(
  [customer_id] => 81
  [prepaid_balance_amount] => 21020.00000

)
Parameters
Part Name Part Type Description
customer_id xsd:string Customer ID (from your local database, any digit)
prepaid_balance_amount xsd:string Balance amount in points

client = DidwwAPI.new
response = client.didww_getprepaidbalancelist (customer_id)

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  "auth_string" => $authstr,
  "customer_id" => "62"
);
...
$result = $client->__soapCall("didww_getprepaidbalancelist", $params);
...

Order Autorenew Status

This method will change Auto-renew status of the specified DID number.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
customer_id xsd:string No Customer ID (from your local database, any digit)
did_number xsd:string No DID Number to renew
Response

GlobalResponse (object)

Sample response

stdClass Object
(
  [result] => 0
  [error] => 0
)
Parameters
Part Name Part Type Description
result xsd:string Returns 0 if success, 1 - if there any errors
prepaid_balance_amount xsd:string Balance amount in points

            

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  "auth_string" => $authstr,
  "customer_id" => "62",
  "did_number" => "1403345102",
  "status" => "1",
);
...
$result = $client->__soapCall("didww_order_autorenew_status", $params);
...

PSTN Traffic

This method will return data for building PSTN Traffic chart, including "Cost", "Sold" and "Duration" values.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
from_date xsd:string No Start date from which PSTN traffic records will be retrieved
to_date xsd:string No End date date to which PSTN traffic records will be retrieved
Response

traffic_data (object)

Sample response

object
0 =>
object(stdClass)[166]
[customer_amount] => 5.03
[amount] => 2.09
[date] => 2012-04-10
[duration] => 35
Parameters
Part Name Part Type Description
customer_amount xsd:string Sold (in points) - funds paid by customer
amount xsd:string Cost (in points) - funds paid by reseller
date xsd:string Date of the call

              

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  'auth_string' => $authstr,
  'from_date' => $from_date,
  'to_date' => $to_date
);

$result = $client->__soapCall("didww_pstn_traffic", $params);

Get DIDWW Countries

This method will return list of available countries from DIDWW coverage list.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
country_iso xsd:string Yes Country ISO Code
Response

CountriesList (array)

Sample response

Array
(
  [0] => stdClass Object
(
  [country_name] => Russian Federation
  [country_prefix] => 7
  [country_iso] => RU
)
...
)
Parameters
Part Name Part Type Description
country_name xsd:string Country Name
country_prefix xsd:string Country Prefix
country_iso xsd:string Country ISO Code

              

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  "auth_string" => $authstr,
  "country_iso" => "RU",
);

Get DIDWW Cities

This method will return list of cities from DIDWW coverage list.

Parameters
Part Name Part Type Optional Description
auth_string xsd:string No User Token for authorization
country_iso xsd:string Yes Country ISO Code
city_id xsd:string Yes City ID
active xsd:int ? 1 - returns cities with available DID numbers, 0 - all cities will be returned
Response

CitiesArray (array)

Sample response

Array
(
  [0] => stdClass Object
  (
    [city_id] => 107
    [city_name] => Moscow
    [city_prefix] => 495
    [city_nxx_prefix] =>
    [setup] => 0
    [monthly] => 60.9
    [isavailable] => 1
    [islnrrequired] => 0
  )
...
)
Parameters
Part Name Part Type Description
city_id xsd:string City ID
city_name xsd:string City Name
city_prefix xsd:string City Area Prefix
city_nxx_prefix xsd:string City Prefix
setup xsd:string Setup fee
monthly xsd:string DID monthly price
isavailable xsd:int Returns 1 if city is available, 0 - if not
islnrrequired xsd:int Returns 1 if country requires special registration, 0 - if not

            

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
  "auth_string" => $authstr,
  "country_iso" => "RU",
  "city_id" => null,
  "active" => 1
);

Get Service List

This method will return list of orders for given customer.

Parameters
Part Name Part Type Optional Description
customer_id xsd:string No Customer ID (from your local database, any digit)
Response

service_data (object)

Sample response
                
Array
(
  [0] => stdClass Object
  (
    [result] => 0
    [country_name] => Denmark
    [country_iso] => DK
    [city_name] => Geographical
    [city_prefix] => 3
    [did_number] => 453100101
    [did_status] => -1
    [did_timeleft] => -5757041
    [did_expire_date_gmt] => 2011-02-11 17:43:33
    [order_id] => 300005
    [order_status] => Completed
    [did_mapping_format] => SKYPE:skypename
    [did_setup] => 0.00
    [did_monthly] => 8.00
    [did_period] => 1
    [autorenew_enable] => 0
    [prepaid_balance] => 9411.24000
  )
...
)
                
              
Parameters
Part Name Part Type Description
result xsd:int Return 0 - success, 1 - failed
country_name xsd:string Country Name
country_iso xsd:string Country ISO Code
city_name xsd:string City Name
city_prefix xsd:string City Area Prefix
did_number xsd:string DID Number
did_status xsd:string DID Status (see full list below)
did_timeleft xsd:string Time left of the DID Number
did_expire_date_gmt xsd:string Expiration date in GMT
order_id xsd:string Order ID on DIDWW
order_status xsd:string Order status (see full list below)
did_mapping_format xsd:string Forwarding data
did_setup xsd:string Setup fee for reseller
did_monthly xsd:string Monthly fee for reseller
did_period xsd:int Period
autorenew_enable xsd:int Auto Renew disabled or enabled (0/1)
prepaid_balance xsd:string Customer Balance in points

                    

This code example is based on PHP class DidwwAPI which can be found here.


...
$params = array(
"auth_string" => $authstr,
"customer_id" => $customer_id
);
$errorCode = null;
$errorString = null;
$result = null;
try {
$result = $client->__soapCall("didww_getservicelist", $params);
} catch(SoapFault $e) {
$errorCode = $e->faultcode;
$errorString = $e->faultstring;
} catch(Exception $e) {
$errorCode = $e->getCode();
$errorString = $e->getMessage();
}
...