Knowladge Base

GET LIST OF AVAILABLE DID AREAS

1C. METHOD FOR GETTING AVAILABLE DID’S AREA LIST BY COUNTRY CODE

This method returns the list of available DID’s Area list by country code and Vendor Rating in the form of an array. The user is required to give User ID, Password, country code and Vendor Ratings as arguments and he’ll get a list of available DID’s area list of that country.

User can supply Vendor Rating range to get a list of available DID’s areas by Vendor Rating and country code. If there is no range is defined than it will get a list of DID’s areas with all vendor ratings.

Method Signature

getDIDArea ($UserID,$Password,$CountryCode,$VRatingFrom,$VRatingTo,$VendorIDs(comma separated), $RateFrom, $RateTo, $CountryID)

Example Usage

We are providing a sample code in PERL which accesses and uses this service.

1. !/usr/bin/perl

<?php

require_once “nusoap.php”;

$parameters=array(“65948″,”sdaf485″,”1″,”5″,”9″,”123455″,”1″,”10″,”211”);
$soapclient= new soapclient(‘http://api.didx.net/webservice/WebGetDIDAreasServer.php’);
$SoapResult = array();
$SoapResult = $soapclient->call(“getDIDArea”, $parameters,’urn:getDIDArea’);

print_r($SoapResult);

?>

WSDL Access (PHP Client):

<?php
$parameters=array(“700000″,”xxxx”,”1″,”1″,”9″,””,”0″,”5″,211);
$soapclient= new soapclientnusoap(‘http://api.didx.net/webservice/WebGetDIDAreasServer.wsdl’, true);
$SoapResult = array();
$SoapResult = $soapclient->call(“getDIDArea”, $parameters,’urn:getDIDArea’);

print_r($SoapResult);

?>

WSDL Access (PERL Client):

#!/usr/bin/perl

use SOAP::Lite;

my $Areas= SOAP::Lite
-> service(‘http://api.didx.net/webservice/WebGetDIDAreasServer.wsdl’)
-> getDIDArea(“700000″,”xxxx”,”1″,”9″);

$TotalAreas = @{$Areas};
for ($iIndex=0;$iIndex<=$TotalAreas;$iIndex++)
{
print “\n $Areas->[$iIndex][0] – $Areas->[$iIndex][1] “;
}

The first two arguments passed to the method are user id and password. The third argument is the country code, the fourth represents the starting Rating and the fifth represents the ending Rating. In this case, we’ve provided ratings from 5 to Vendor Rating 9. This will return the list of all available DID’s Area list for Pakistan.

Optionally you can provide, Vendor IDs (comma separated values), Monthly Rate Range and Country ID (for country countries having country code 1. To get the Country ID see Get Available DIDs’ Country Codes)

How to use country ID for countries having same code

Fields Returned:
AreaCode?
Description

Error Codes

For some countries where there is no area such as Singapore, Hong Kong, Denmark etc, the area code will be returned as “-99”, it means there is no area or area name is same as the country name.

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 = There are no rated DIDs’ Areas avaiable in our record.