Follow

CNAM API Integration examples

PHP

<?php

$username='username'; // Your portal username for i.thinq.com
$password='token'; // The TOKEN you created when logged it as the above user
$URL='https://api.thinq.com/cnam/9195551212?format=json'; // Always use 10-DIGITS

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$URL);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //get status code
$result = curl_exec($ch);

$json = json_decode($result);

//print_r($json);

echo $json->cnam . "\n";

curl_close ($ch);
?>

 

URL Only

(you may need "curl" in front of https)     format options (json/jsonp/xml/text/html)
https://username:token@api.thinq.com/cnam/9195551212?format=json

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk