The NumberValidation API validates any phonenumber.
It will tell you the formatting options and type of the number, and will determine the most likely carrier.
There are a few optional parameters available:
The mnp_lookup parameter (boolean) forces our system to look up the number in our Portability databases to provide a carrier as accurately as possible.
And the responsetype parameter (int) determines what properties are available in the returned object.
Your product-token authenticates your calls.
Provide it in the X-CM-PRODUCTTOKEN header for authentication.
The default Number Validation resource validates one phonenumber at a time.
Mobile Number Portability lookup is turned on by default to provide carrier determination that is as accurate as possible.
https://api.cmtelecom.com/v1.1/numbervalidation/{phonenumber}
Send one request with a phonenumber in the url, and receive the validation information as JSON object.
name | in | required | schema |
---|---|---|---|
X-CM-PRODUCTTOKEN | header | true | 0000000-0000-0000-0000-000000000000 |
phonenumber | path | true | 0031687654321 |
mnp_lookup | query | false | true (default) |
responsetype | query | false | 1 |
http status | content-type | description |
---|---|---|
200 | application/json | { |
curl -i https://api.cmtelecom.com/v1.1/numbervalidation/0031687654321 -H "X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000"
<?php // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required $data = json_encode(array("phonenumber" => "string")); $url = 'https://api.cmtelecom.com/v1.1/numbervalidation/0031687654321'; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_HTTPHEADER => array( 'X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000' ), CURLOPT_HEADER => TRUE, CURLOPT_RETURNTRANSFER => TRUE ) ); $result = curl_exec($ch); var_dump($result); curl_close($ch);
https://api.cmtelecom.com/v1.1/numbervalidation
Send one JSON object with a phonenumber property, and receive the validation information as JSON object.
name | in | required | schema |
---|---|---|---|
X-CM-PRODUCTTOKEN | header | true | 0000000-0000-0000-0000-000000000000 |
object | body | true | {"phonenumber" : "string"} |
object | body | false | {"mnp_lookup" : true} (default) |
object | body | false | {"responsetype" : 1} (default) |
http status | content-type | description |
---|---|---|
200 | application/json | { |
curl -i https://api.cmtelecom.com/v1.1/numbervalidation -X POST -H "Content-Type: application/json" -H "X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000" -d '{"phonenumber": "string"}'
<?php // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required $data = json_encode(array("phonenumber" => "string")); $url = 'https://api.cmtelecom.com/v1.1/numbervalidation'; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000' ), CURLOPT_HEADER => TRUE, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $data, CURLOPT_RETURNTRANSFER => TRUE ) ); $result = curl_exec($ch); var_dump($result); curl_close($ch);
The batch resource on the Number Validation API can validate multiple numbers at once.
Reducing requests and overhead to speed up the validation of a list of numbers.
https://api.cmtelecom.com/v1.1/numbervalidation/batch
Send a JSON array containing objects with a phonenumber property.
The GUID for this batch is returned, for use with the processing and retreavel calls.
name | in | required | schema |
---|---|---|---|
X-CM-PRODUCTTOKEN | header | true | 0000000-0000-0000-0000-000000000000 |
array | body | true |
|
http status | content-type | description |
---|---|---|
200 | application/json | {"batch": "B9247F0F-3A00-4076-A0B4-894ABBA3E08D"} |
curl -i https://api.cmtelecom.com/v1.1/numbervalidation/batch -X POST -H "Content-Type: application/json" -H "X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000" -d '[{"phonenumber": "string"},{"phonenumber": "string"},{"phonenumber": "string"}]'
<?php // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required $data = json_encode(array( array("phonenumber" => "string"), array("phonenumber" => "string"), array("phonenumber" => "string") )); $url = 'https://api.cmtelecom.com/v1.1/numbervalidation/batch'; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000' ), CURLOPT_HEADER => TRUE, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $data, CURLOPT_RETURNTRANSFER => TRUE ) ); $result = curl_exec($ch); var_dump($result); curl_close($ch);
https://api.cmtelecom.com/v1.1/numbervalidation/batch/{batch}/status
A status call to see how far along the processing of the batch is. Processing will start automatically.
name | in | required | type |
---|---|---|---|
X-CM-PRODUCTTOKEN | header | true | 0000000-0000-0000-0000-000000000000 |
batch | path | true | string |
http status | content-type | description |
---|---|---|
200 | application/json | { |
curl -i https://api.cmtelecom.com/v1.1/numbervalidation/batch/{batch}/status -X GET -H "Content-Type: application/json" -H "X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000"
<?php // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required $url = 'https://api.cmtelecom.com/v1.1/numbervalidation/batch/' .$batch .'/status'; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000' ), CURLOPT_HEADER => TRUE, CURLOPT_RETURNTRANSFER => TRUE ) ); $result = curl_exec($ch); var_dump($result); curl_close($ch);
https://api.cmtelecom.com/v1.1/numbervalidation/batch/{batch}
Retrieve the first page of the batch.
A page contains 1000 items, the amount of pages is availble in return of the /status call and the /process call.
name | in | required | type |
---|---|---|---|
X-CM-PRODUCTTOKEN | header | true | 0000000-0000-0000-0000-000000000000 |
batch | path | true | string |
http status | content-type | description |
---|---|---|
200 | application/json | |
curl -i https://api.cmtelecom.com/v1.1/numbervalidation/batch/{batch} -X GET -H "Content-Type: application/json" -H "X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000"
<?php // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required $url = 'https://api.cmtelecom.com/v1.1/numbervalidation/batch/' .$batch; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000' ), CURLOPT_HEADER => TRUE, CURLOPT_RETURNTRANSFER => TRUE ) ); $result = curl_exec($ch); var_dump($result); curl_close($ch);
https://api.cmtelecom.com/v1.1/numbervalidation/batch/{batch}/page/{page}
Retrieve a specific page of the batch.
A page contains 1000 items, the amount of pages is availble in return of the /status call and the /process call, a call to an out of range page will return an empty array.
name | in | required | type |
---|---|---|---|
X-CM-PRODUCTTOKEN | header | true | 0000000-0000-0000-0000-000000000000 |
batch | path | true | string |
page | path | true | string |
http status | content-type | description |
---|---|---|
200 | application/json | |
curl -i https://api.cmtelecom.com/v1.1/numbervalidation/batch/{batch}/page/{page} -X GET -H "Content-Type: application/json" -H "X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000"
<?php // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required $url = 'https://api.cmtelecom.com/v1.1/numbervalidation/batch/' .$batch .'/page/' .$page; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000' ), CURLOPT_HEADER => TRUE, CURLOPT_RETURNTRANSFER => TRUE ) ); $result = curl_exec($ch); var_dump($result); curl_close($ch);
The Lookup method in the Number Verifier API will look up additional information for the given phonenumber.
Information like the Portation-state, the actual operator, if the number is roaming and even if the number is active on the network.
Collecting this data is not free, and you must contact your account manager before you can use this resource.
https://api.cmtelecom.com/v1.1/numberlookup/{phonenumber}
Send one request with a phonenumber in the url, and receive the validation information as JSON object, enriched with properties provided by the lookup result.
name | in | required | schema |
---|---|---|---|
X-CM-PRODUCTTOKEN | header | true | 0000000-0000-0000-0000-000000000000 |
phonenumber | path | true | 0031687654321 |
mnp_lookup | query | false | false (default) |
responsetype | query | false | 2 (default) |
http status | content-type | description |
---|---|---|
200 | application/json | { |
curl -i https://api.cmtelecom.com/v1.1/numberlookup/0031687654321 -H "X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000"
<?php // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required $data = json_encode(array("phonenumber" => "string")); $url = 'https://api.cmtelecom.com/v1.1/numberlookup/0031687654321'; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_HTTPHEADER => array( 'X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000' ), CURLOPT_HEADER => TRUE, CURLOPT_RETURNTRANSFER => TRUE ) ); $result = curl_exec($ch); var_dump($result); curl_close($ch);
https://api.cmtelecom.com/v1.1/numberlookup
Send one JSON object with a phonenumber property, and receive the validation information as JSON object, enriched with properties provided by the lookup result.
name | in | required | schema |
---|---|---|---|
X-CM-PRODUCTTOKEN | header | true | 0000000-0000-0000-0000-000000000000 |
object | body | true | {"phonenumber" : "string"} |
object | body | false | {"mnp_lookup": false} (default) |
object | body | false | {"responsetype": 2} (default) |
http status | content-type | description |
---|---|---|
200 | application/json | { |
curl -i https://api.cmtelecom.com/v1.1/numberlookup -X POST -H "Content-Type: application/json" -H "X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000" -d '{"phonenumber": "string"}'
<?php // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required $data = json_encode(array("phonenumber" => "string")); $url = 'https://api.cmtelecom.com/v1.1/numberlookup'; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000' ), CURLOPT_HEADER => TRUE, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $data, CURLOPT_RETURNTRANSFER => TRUE ) ); $result = curl_exec($ch); var_dump($result); curl_close($ch);