PHP

Number Search API

KooKoo Numbers API will give you instant access to search,buy and remove the numbers
 
KooKoo Provides the numbers only from India(IN) for now.

Authentication

KooKoo api_key is used as Authencation api
 
to be passed in header Authorization: {api_key}

Add Number

Parameter Description
number phone number to add
app_url app url to assign
					<?php

						$curl = curl_init();

						curl_setopt_array($curl, array(
						CURLOPT_URL => "http://kookoo.in/restkookoo/index.php/api/numbersapi/confirm_kookoonumber",
						CURLOPT_RETURNTRANSFER => true,
						CURLOPT_ENCODING => "",
						CURLOPT_MAXREDIRS => 10,
						CURLOPT_TIMEOUT => 30,
						CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
						CURLOPT_CUSTOMREQUEST => "POST",
						CURLOPT_POSTFIELDS => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"app_url\"\r\n\r\nhttp://test.com/ivrsurl\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"number\"\r\n\r\n9140XXXXXXX\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--",
						CURLOPT_HTTPHEADER => array(
						"Authorization: KKXXXXXXXXXXXXX",
						"cache-control: no-cache",
						"content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
						"postman-token: 272d960a-915b-f879-a077-3680f50cd9ed"
						),
						));

						$response = curl_exec($curl);
						$err = curl_error($curl);

						curl_close($curl);

						if ($err) {
							echo "cURL Error #:" . $err;
						} else {
							echo $response;
						}

						Expected Response:

						<?xml version="1.0" encoding="utf-8"?>
						<response>
						<status>success</status>
						<message>URL Assigned to 918046XXX</message>
						</response>


					


				

Application URL update

You can use this API to update the IVR URL assigned to the KooKoo Number.

Parameter Description
number KooKoo Number for which the URL needs to be updated.
app_url New IVR URL.
					<?php

						$curl = curl_init();

						curl_setopt_array($curl, array(
						CURLOPT_URL => "http://kookoo.in/restkookoo/index.php/api/numbersapi/update_kookoonumber",
						CURLOPT_RETURNTRANSFER => true,
						CURLOPT_ENCODING => "",
						CURLOPT_MAXREDIRS => 10,
						CURLOPT_TIMEOUT => 30,
						CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
						CURLOPT_CUSTOMREQUEST => "POST",
						CURLOPT_POSTFIELDS => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"app_url\"\r\n\r\nhttp://test.com/ivrsurl\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"number\"\r\n\r\n9140XXXXXXXXXX\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--",
						CURLOPT_HTTPHEADER => array(
						"Authorization: KKXXXXXXXXXXXXXXXXXXXXX",
						"cache-control: no-cache",
						"content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
						"postman-token: dfa90316-5bb9-871a-5fb2-98b4830f0576"
						),
						));

						$response = curl_exec($curl);
						$err = curl_error($curl);

						curl_close($curl);

						if ($err) {
							echo "cURL Error #:" . $err;
						} else {
							echo $response;
						}

						Expected Response:

						<?xml version="1.0" encoding="utf-8"?>
						<response>
						<status>success</status>
						<message>URL Assigned to 918046XXX</message>
						</response>

					
				

Remove Numbers

Remove the Numbers from your KooKoo Account

Parameter Description
loc Location Short Code
number KooKoo number
					<?php

						$curl = curl_init();

						curl_setopt_array($curl, array(
						CURLOPT_URL => "http://kookoo.in/restkookoo/index.php/api/numbersapi/remove_kookoonumber",
						CURLOPT_RETURNTRANSFER => true,
						CURLOPT_ENCODING => "",
						CURLOPT_MAXREDIRS => 10,
						CURLOPT_TIMEOUT => 30,
						CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
						CURLOPT_CUSTOMREQUEST => "POST",
						CURLOPT_POSTFIELDS => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"location\"\r\n\r\nhyd\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"number\"\r\n\r\n9140XXXXXXXXXX\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--",
						CURLOPT_HTTPHEADER => array(
						"Authorization: KKXXXXXXXXXXXXXXXXXXXXX",
						"cache-control: no-cache",
						"content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
						"postman-token: 286ca36c-94c5-f298-350f-4a861a6395af"
						),
						));

						$response = curl_exec($curl);
						$err = curl_error($curl);

						curl_close($curl);

						if ($err) {
							echo "cURL Error #:" . $err;
						} else {
							echo $response;
						}

						Expected Response:

						<?xml version="1.0" encoding="utf-8"?>
						<response>
						<status>success</status>
						<message>The requested number 918046XXX has been removed from your KooKoo Account</message>
						</response>
					
				

List KooKoo Numbers

Total Number of KooKoo Numbers in detailed Account wise.

Parameter Description
city Location Short Code
					<?php

						$curl = curl_init();

						curl_setopt_array($curl, array(
						CURLOPT_URL => "http://kookoo.in/restkookoo/index.php/api/userinfo/numbers/city/BLR/",
						CURLOPT_RETURNTRANSFER => true,
						CURLOPT_ENCODING => "",
						CURLOPT_MAXREDIRS => 10,
						CURLOPT_TIMEOUT => 30,
						CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
						CURLOPT_CUSTOMREQUEST => "GET",
						CURLOPT_HTTPHEADER => array(
						"Authorization: KKXXXXXXXXXXXXXXXXXXXXX",
						"cache-control: no-cache",
						"postman-token: fcb95361-249e-025f-89b5-c521073c56de"
						),
						));

						$response = curl_exec($curl);
						$err = curl_error($curl);

						curl_close($curl);

						if ($err) {
							echo "cURL Error #:" . $err;
						} else {
							echo $response;
						}

						Expected Response:

						<?xml version="1.0" encoding="utf-8"?>
						<response>
						<assigned_number>
						<phone_number>9122XXXXX</phone_number>
						<application_url> http://XXXXXX </application_url>
						</assigned_number>
						</response>
					
				

Added Numbers List

Total Number of DIDs Added on your KooKoo account period wise

Parameter Description
startdate Starting Date
enddate Ending Date
					<?php

						$curl = curl_init();

						curl_setopt_array($curl, array(
						CURLOPT_URL => "https://kookoo.in/restkookoo/index.php/api/userinfo/added_numbers/startdate/2018-02-01/enddate/2018-02-20",
						CURLOPT_RETURNTRANSFER => true,
						CURLOPT_ENCODING => "",
						CURLOPT_MAXREDIRS => 10,
						CURLOPT_TIMEOUT => 30,
						CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
						CURLOPT_CUSTOMREQUEST => "GET",
						CURLOPT_HTTPHEADER => array(
						"Authorization: KKXXXXXXXXXXXXXXXXXXXXX",
						"cache-control: no-cache",
						"postman-token: 61a90f23-dafa-ad35-eb51-ce4ec08e9128"
						),
						));

						$response = curl_exec($curl);
						$err = curl_error($curl);

						curl_close($curl);

						if ($err) {
							echo "cURL Error #:" . $err;
						} else {
							echo $response;
						}

						Expected Response:

						<?xml version="1.0" encoding="utf-8"?>
						<response>
						<AddedList>
						<number>
						<DID>9122XXXXX</DID>
						<AddedTime>2018-03-05 17:09:17 </AddedTime>
						</number>
						</AddedList>
						</response>

					
				

Removed Numbers List

Total Number of DIDs Removed on your KooKoo account period wise

Parameter Description
startdate Starting Date
endate Ending Date
					<?php

						$curl = curl_init();

						curl_setopt_array($curl, array(
						CURLOPT_URL => "https://kookoo.in/restkookoo/index.php/api/userinfo/removed_numbers/startdate/2018-02-01/enddate/2018-02-20",
						CURLOPT_RETURNTRANSFER => true,
						CURLOPT_ENCODING => "",
						CURLOPT_MAXREDIRS => 10,
						CURLOPT_TIMEOUT => 30,
						CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
						CURLOPT_CUSTOMREQUEST => "GET",
						CURLOPT_HTTPHEADER => array(
						"Authorization: KKXXXXXXXXXXXXXXXXXXXXX",
						"cache-control: no-cache",
						"postman-token: 61a90f23-dafa-ad35-eb51-ce4ec08e9128"
						),
						));

						$response = curl_exec($curl);
						$err = curl_error($curl);

						curl_close($curl);

						if ($err) {
							echo "cURL Error #:" . $err;
						} else {
							echo $response;
						}

						Expected Response:

						<?xml version="1.0" encoding="utf-8"?>
						<response>
						<RemovedList>
						<number>
						<DID>9122XXXXX</DID>
						<RemovedTime>2018-03-05 17:09:17 </RemovedTime>
						</number>
						</RemovedList>
						</response>
					
				

Numbers Count

Total Number of DIDs based on account or City

Parameter Description
city Location Short Code
Note:If no location provided it will get you Account Complete Count.
					<?php

						$curl = curl_init();

						curl_setopt_array($curl, array(
						CURLOPT_URL => "https://kookoo.in/restkookoo/index.php/api/userinfo/count_numbers/city/XXX",
						CURLOPT_RETURNTRANSFER => true,
						CURLOPT_ENCODING => "",
						CURLOPT_MAXREDIRS => 10,
						CURLOPT_TIMEOUT => 30,
						CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
						CURLOPT_CUSTOMREQUEST => "GET",
						CURLOPT_HTTPHEADER => array(
						"Authorization: KKXXXXXXXXXXXXXXXXXXXXX",
						"cache-control: no-cache",
						"postman-token: 8561d0a9-1d60-61a2-e8ed-b79c2ff4144e"
						),
						));

						$response = curl_exec($curl);
						$err = curl_error($curl);

						curl_close($curl);

						if ($err) {
							echo "cURL Error #:" . $err;
						} else {
							echo $response;
						}

						Expected Response:

						<?xml version="1.0" encoding="utf-8"?>
						<response>
						<count>X</count>
						</response>
					
				

Un mute the caller

Un mute the caller's If caller is in mute by requested call mute api.

Parameter Description
phone_no caller number
caller_id KooKoo number
ucid caller's call ucid
					<?php
						$url = 'http://KooKoo.in/api/v1/CallControl/UnMute';
						$param = array(
						'phone_no' => '099xxxxxxxx',
						'caller_id' => '91xxxxxxxx',
						'ucid' => 'xxx'
						);

						$url = $url . "?" . http_build_query($param, '&');
						$curl = curl_init();
						curl_setopt_array($curl, array(
						CURLOPT_URL => $url,
						CURLOPT_RETURNTRANSFER => true,
						CURLOPT_ENCODING => "",
						CURLOPT_MAXREDIRS => 10,
						CURLOPT_TIMEOUT => 30,
						CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
						CURLOPT_CUSTOMREQUEST => "GET",
						CURLOPT_HTTPHEADER => array(
						"Authorization: {{api_key}}",
						),
						));

						$response = curl_exec($curl);
						$err = curl_error($curl);
						curl_close($curl);
						if ($err) {
							echo "cURL Error #:" . $err;
						} else {
							echo $response;
						}