GetDIDs JSON pakalpojums

Šī funkcija nodrošinās JSON formātā sagatavotu iegādei pieejamo numuru sarakstu

Meta:

GetDids(Username, Password, Country Code)

Ņemiet vērā, ka “Country code” (valsts kods) šeit nozīmē pilnu prefiksu. Piemēram, ASV zvanītājam bezmaksas numuriem šī vērtība ir 1800/1855/1866/1877 vai 1888

Lietošanas piemērs:

POST:

curl -X POST https://api.multitel.net/json/getdids \
--data-urlencode "UserName=USERNAME" \
--data-urlencode "Password=PASSWORD" \
--data-urlencode "CountryCode=1203"

GET:

curl -x GET https://api.multitel.net/json/getdids/USERNAME/PASSWORD/1203

Varat izmantot arī šādu piemēru:

<?php

  $server_url = 'https://api.multitel.net/json/getdids/';
  // GET : https://api.multitel.net/json/getdids/username/password/prefix

  if(isset($_POST['submit'])) {
	$data = array(
      		'UserName' => $_POST['username'], 
      		'Password' => $_POST['password'],
      		'CountryCode' => $_POST['country_code'],
    	);

    	$handle = curl_init($server_url);
    	curl_setopt($handle, CURLOPT_POST, true);
    	curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
    	curl_exec($handle);
  }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>GetDIDs</title>
</head>

<body>
  <form name="form1" method="post" action="">
    Username : <input type="text" name="username" value="administrator" />
    <br />
    Password : <input type="text" name="password" value="password" />
    <br />
    Country Code : <input type="text" name="country_code" value="" />
    <br />
    <input type="submit" name="submit" value="submit" />
  </form>
</body>
</html>

Koda piemērs · Skatīt avotu

Rezultāts būs:

{"DATA":
  [
    {
      "Number":"12036587208",
      "SetupCost":"2.000",
      "MonthlyCharges":"3.00",
      "PerMinuteCharges":"0.019",
      "Country":"United States",
      "Area":"",
      "CountryCode":"US",
      "StateCode":"1203",
      "FreeMinutes":0,
      "VOIP":1,
      "SMS":1,
      "MMS":0,
      "PER_SMS":"0",
      "PER_MMS":"0",
      "SS7":3214
    },{
      "Number":"12036587209",
      "SetupCost":"2.000",
      "MonthlyCharges":"3.00",
      "PerMinuteCharges":"0.019",
      "Country":"United States",
      "Area":"",
      "CountryCode":"US",
      "StateCode":"1203",
      "FreeMinutes":0,
      "VOIP":1,
      "SMS":1,
      "MMS":0,
      "PER_SMS":"0",
      "PER_MMS":"0",
      "SS7":3714
      },{
      ...
      }
    ],"return_code":0}

Koda piemērs · Skatīt avotu

Meklēt dokumentāciju