Address Book
PHP

Introduction

Addressbook API

Authentication

Addressbook uses CM's producttokens for authentication. The producttoken can be obtained from the https://gateway.cmtelecom.com application.

Obtain the account identifier (accountId)

The account identifier is the GUID associated with your account. This identifier can be found in the URL of the https://addressbook.cmtelecom.com application. Examples:

URL account identifier
https://addressbook.com/en/2f1e7331-991b-497d-9a32-dd3c2d79c56d 2f1e7331-991b-497d-9a32-dd3c2d79c56d
https://addressbook.com/en/d7836eee-3c32-4fbf-8a26-638db93d8f03 d7836eee-3c32-4fbf-8a26-638db93d8f03
https://addressbook.com/en/811283f7-caf1-4155-8422-e918e9ac4221 811283f7-caf1-4155-8422-e918e9ac4221
https://addressbook.com/en/dfc37133-be88-4008-842e-fbd95b9a91cc dfc37133-be88-4008-842e-fbd95b9a91cc
https://addressbook.com/en/d3d544d1-55d0-4768-a9e5-53eca9f5e765 d3d544d1-55d0-4768-a9e5-53eca9f5e765

Contacts

Get one contact

Find a contact by id

https://api.cmtelecom.com/addressbook/v1.0/contacts/{contactId}

GET Parameters

name in description required type
accountId query Account GUID true string
contactId path contact id true string
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
200 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/contacts/{contactId}?accountId='accountId'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'contactId' => 'contactId',
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/contacts/'
         .$contactId
         .'?accountId='accountId'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Get contacts

Find all contacts

https://api.cmtelecom.com/addressbook/v1.0/contacts/

GET Parameters

name in description required type
accountId query Account GUID true string
skip query Skip the first amount of contacts false integer
take query Take an amount of contacts; 10 if omitted false integer
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string
groupIds query Comma separated list of group ids that the contact may belong in false string

Responses

http status description
200 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/contacts/?accountId='accountId'&skip=10&take=10&groupIds='groupIds'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/contacts/?accountId='accountId'&skip=10&take=10&groupIds='groupIds'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Create a contact

Create a contact

https://api.cmtelecom.com/addressbook/v1.0/contacts

POST Parameters

name in description required schema type
body body Contact object that you wish to create true
  • {
    • "id" : "string",
    • "legacy_id" : "integer",
    • "accountId" : "string",
    • "groupIds" : [],
    • "name" : "string",
    • "firstname" : "string",
    • "insertion" : "string",
    • "lastname" : "string",
    • "company" : "string",
    • "telephone_number" : "string",
    • "email_address" : "string",
    • "customfield1" : "string",
    • "customfield2" : "string",
    • "customfield3" : "string",
    • "customfield4" : "string",
    • "customfield5" : "string",
    • "customfield6" : "string",
    • "customfield7" : "string",
    • "customfield8" : "string",
    • "customfield9" : "string",
    • "customfield10" : "string",
    • "favorite" : false
    }
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
201 successful operation
400 Invalid request

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/contacts
     -X POST
     -H "Content-Type: application/json"
     -d "{
 'accountId' : 'string',
 'groupIds' : [],
 'name' : 'string',
 'firstname' : 'string',
 'insertion' : 'string',
 'lastname' : 'string',
 'company' : 'string',
 'telephone_number' : 'string',
 'email_address' : 'string',
 'customfield1' : 'string',
 'customfield2' : 'string',
 'customfield3' : 'string',
 'customfield4' : 'string',
 'customfield5' : 'string',
 'customfield6' : 'string',
 'customfield7' : 'string',
 'customfield8' : 'string',
 'customfield9' : 'string',
 'customfield10' : 'string',
 'favorite' : false
}"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'data' => json_encode(array(
               "accountId" => "string",
               "groupIds": array(
               ),
               "name" => "string",
               "firstname" => "string",
               "insertion" => "string",
               "lastname" => "string",
               "company" => "string",
               "telephone_number" => "string",
               "email_address" => "string",
               "customfield1" => "string",
               "customfield2" => "string",
               "customfield3" => "string",
               "customfield4" => "string",
               "customfield5" => "string",
               "customfield6" => "string",
               "customfield7" => "string",
               "customfield8" => "string",
               "customfield9" => "string",
               "customfield10" => "string",
               "favorite": false
              )          ),
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/contacts';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_POST           => true,
     CURLOPT_POSTFIELDS     => $data,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Update a contact

Update a contact

https://api.cmtelecom.com/addressbook/v1.0/contacts/{contactId}

PUT Parameters

name in description required type schema
contactId path Contact Id true string
body body Contact object that you wish to update true object
  • {
    • "id" : "string",
    • "legacy_id" : "integer",
    • "accountId" : "string",
    • "groupIds" : [],
    • "name" : "string",
    • "firstname" : "string",
    • "insertion" : "string",
    • "lastname" : "string",
    • "company" : "string",
    • "telephone_number" : "string",
    • "email_address" : "string",
    • "customfield1" : "string",
    • "customfield2" : "string",
    • "customfield3" : "string",
    • "customfield4" : "string",
    • "customfield5" : "string",
    • "customfield6" : "string",
    • "customfield7" : "string",
    • "customfield8" : "string",
    • "customfield9" : "string",
    • "customfield10" : "string",
    • "favorite" : false
    }
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
201 successful operation
400 Invalid request

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/contacts/{contactId}
     -X PUT
     -H "Content-Type: application/json"
     -d "{
 'id' : 'string',
 'legacy_id' : 'integer',
 'accountId' : 'string',
 'groupIds' : [],
 'name' : 'string',
 'firstname' : 'string',
 'insertion' : 'string',
 'lastname' : 'string',
 'company' : 'string',
 'telephone_number' : 'string',
 'email_address' : 'string',
 'customfield1' : 'string',
 'customfield2' : 'string',
 'customfield3' : 'string',
 'customfield4' : 'string',
 'customfield5' : 'string',
 'customfield6' : 'string',
 'customfield7' : 'string',
 'customfield8' : 'string',
 'customfield9' : 'string',
 'customfield10' : 'string',
 'createdAt' : 'string',
 'updatedAt' : 'string',
 'favorite' : false
}"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'contactId' => 'contactId',
    'data' => json_encode(array(
               "accountId" => "string",
               "groupIds" => [],
               "name" => "string",
               "firstname" => "string",
               "insertion" => "string",
               "lastname" => "string",
               "company" => "string",
               "telephone_number" => "string",
               "email_address" => "string",
               "customfield1" => "string",
               "customfield2" => "string",
               "customfield3" => "string",
               "customfield4" => "string",
               "customfield5" => "string",
               "customfield6" => "string",
               "customfield7" => "string",
               "customfield8" => "string",
               "customfield9" => "string",
               "customfield10" => "string",
               "favorite": false
              )          ),
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/contacts/'
         .$contactId;

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_CUSTOMREQUEST  => 'PUT',
     CURLOPT_POST           => true,
     CURLOPT_POSTFIELDS     => $data,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Delete contacts in bulk

Delete contacts in bulk

https://api.cmtelecom.com/addressbook/v1.0/contacts

DELETE Parameters

name in description required type schema
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string
accountId query Account Guid true string
body body List of contact guids to delete true object
  • {
    • "type" : "string"
    }

Responses

http status description
204 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/contacts?accountId='accountId'
     -X DELETE
     -H "Content-Type: application/json"
     -d "{
 'type' : 'string'
}"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/contacts?accountId='accountId'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_CUSTOMREQUEST  => 'DELETE',
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Delete a contact

Delete a contact

https://api.cmtelecom.com/addressbook/v1.0/contacts/{contactId}

DELETE Parameters

name in description required type
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string
contactId path Contact Id true string

Responses

http status description
204 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/contacts/{contactId}
     -X DELETE
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'contactId' => 'contactId',
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/contacts/'
         .$contactId;

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_CUSTOMREQUEST  => 'DELETE',
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Search for contacts

Search for contacts

https://api.cmtelecom.com/addressbook/v1.0/contacts/search

GET Parameters

name in description required type
accountId query Account GUID true string
query query Term to search for true string
take query Take n amount of results the default is 5 false string
groupIds query List of group ids separated with a comma to search for contacts that are part of these groups false string
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
200 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/contacts/search?accountId='accountId'&query='query'&take='take'&groupIds='groupIds'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/contacts/search?accountId='accountId'&query='query'&take='take'&groupIds='groupIds'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Favorites

Add contact to favorites

Favorite a contact

https://api.cmtelecom.com/addressbook/v1.0/favorites/contacts/{contactId}

POST Parameters

name in description required type
contactId path Contact Id true string
accountId query Account Id true string
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
200 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/favorites/contacts/{contactId}?accountId='accountId'
     -X POST
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'contactId' => 'contactId',
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/favorites/contacts/'
         .$contactId
         .'?accountId='accountId'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
Remove contact from favorites

Remove a contact as a favorite

https://api.cmtelecom.com/addressbook/v1.0/favorites/contacts/{contactId}

DELETE Parameters

name in description required type
contactId path Contact Id true string
accountId query Account Id true string
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
200 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/favorites/contacts/{contactId}?accountId='accountId'
     -X DELETE
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'contactId' => 'contactId',
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/favorites/contacts/'
         .$contactId
         .'?accountId='accountId'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_CUSTOMREQUEST  => 'DELETE',
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
Add group to favorites

Favorite a group

https://api.cmtelecom.com/addressbook/v1.0/favorites/groups/{groupId}

POST Parameters

name in description required type
groupId path Group Id true string
accountId query Account Id true string
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
200 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/favorites/groups/{groupId}?accountId='accountId'
     -X POST
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'groupId' => 'groupId',
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/favorites/groups/'
         .$groupId
         .'?accountId='accountId'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
Remove group from favorites

Remove a group as a favorite

https://api.cmtelecom.com/addressbook/v1.0/favorites/groups/{groupId}

DELETE Parameters

name in description required type
groupId path Group Id true string
accountId query Account Id true string
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
200 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/favorites/groups/{groupId}?accountId='accountId'
     -X DELETE
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'groupId' => 'groupId',
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/favorites/groups/'
         .$groupId
         .'?accountId='accountId'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_CUSTOMREQUEST  => 'DELETE',
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Groups

Get one group

Find a group by id

https://api.cmtelecom.com/addressbook/v1.0/groups/{groupId}

GET Parameters

name in description required type
accountId query Account GUID true string
groupId path group id true integer
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
200 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/groups/{groupId}?accountId='accountId'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'groupId' => 10,
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/groups/'
         .$groupId
         .'?accountId='accountId'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
Get groups

Find all groups by account

https://api.cmtelecom.com/addressbook/v1.0/groups/

GET Parameters

name in description required type default
accountId query Account GUID true string
skip query Skip the first amount of groups false integer
take query Take an amount of groups false integer
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string
nameLike query Find groups by name which start with this value false string
orderBy query field that will be used to order the collection on false string created_on
favorite query Either a 0 to fetch all groups that aren't favorites or 1 to fetch groups that are false boolean
order query The sorting method. Should be 'ASC' or 'DESC' false string

Responses

http status description
200 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/groups/?accountId='accountId'&skip=10&take=10&nameLike='nameLike'&orderBy='orderBy'&favorite='favorite'&order='order'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/groups/?accountId='accountId'&skip=10&take=10&nameLike='nameLike'&orderBy='orderBy'&favorite='favorite'&order='order'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
Create a group

Create a group

https://api.cmtelecom.com/addressbook/v1.0/groups

POST Parameters

name in description required schema type
body body Group object that you wish to create true
  • {
    • "id" : "string",
    • "legacy_id" : "integer",
    • "name" : "string",
    • "mapping" : {
      • "firstname" : "firstnameLabel",
      • "lastname" : "lastnameLabel",
      • "company" : "companyLabel",
      • "telephone_number" : "telephone_numberLabel",
      • "customfield1" : "customfield1Label",
      • "customfield2" : "customfield2Label",
      • "customfield3" : "customfield3Label",
      • "customfield4" : "customfield4Label",
      • "customfield5" : "customfield5Label",
      • "customfield6" : "customfield6Label",
      • "customfield7" : "customfield7Label",
      • "customfield8" : "customfield8Label",
      • "customfield9" : "customfield9Label",
      • "customfield10" : "customfield10Label"
      },
    • "accountId" : "string",
    • "favorite" : false
    }
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
201 successful operation
400 Invalid request

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/groups
     -X POST
     -H "Content-Type: application/json"
     -d "{
 'id' : 'string',
 'legacy_id' : 'integer',
 'name' : 'string',
 'mapping' : {
  'type' : 'object',
  'example' : {
   'firstname' : 'firstnameLabel',
   'lastname' : 'lastnameLabel',
   'company' : 'companyLabel',
   'telephone_number' : 'telephone_numberLabel',
   'customfield1' : 'customfield1Label',
   'customfield2' : 'customfield2Label',
   'customfield3' : 'customfield3Label',
   'customfield4' : 'customfield4Label',
   'customfield5' : 'customfield5Label',
   'customfield6' : 'customfield6Label',
   'customfield7' : 'customfield7Label',
   'customfield8' : 'customfield8Label',
   'customfield9' : 'customfield9Label',
   'customfield10' : 'customfield10Label'
  }
 },
 'accountId' : 'string',
 'createdAt' : 'string',
 'contacts' : 'integer',
 'favorite' : {
  'example' : '0'
 }
}"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'data' => json_encode(array(
               "id" => "string",
               "legacy_id" => "integer",
               "name" => "string",
               "mapping": array(
                "type" => "object",
                "example": array(
                 "firstname" => "firstnameLabel",
                 "lastname" => "lastnameLabel",
                 "company" => "companyLabel",
                 "telephone_number" => "telephone_numberLabel",
                 "customfield1" => "customfield1Label",
                 "customfield2" => "customfield2Label",
                 "customfield3" => "customfield3Label",
                 "customfield4" => "customfield4Label",
                 "customfield5" => "customfield5Label",
                 "customfield6" => "customfield6Label",
                 "customfield7" => "customfield7Label",
                 "customfield8" => "customfield8Label",
                 "customfield9" => "customfield9Label",
                 "customfield10" => "customfield10Label"
                )
               ),
               "accountId" => "string",
               "createdAt" => "string",
               "contacts" => "integer",
               "favorite": array(
                "example" => "0"
               )
              )          ),
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/groups';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_POST           => true,
     CURLOPT_POSTFIELDS     => $data,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
Update a group

Create a group

https://api.cmtelecom.com/addressbook/v1.0/groups/{groupId}

PUT Parameters

name in description required type schema
groupId path Group Id true string
body body Group object that you wish to update true object
  • {
    • "id" : "string",
    • "legacy_id" : "integer",
    • "name" : "string",
    • "mapping" : {
      • "firstname" : "firstnameLabel",
      • "lastname" : "lastnameLabel",
      • "company" : "companyLabel",
      • "telephone_number" : "telephone_numberLabel",
      • "customfield1" : "customfield1Label",
      • "customfield2" : "customfield2Label",
      • "customfield3" : "customfield3Label",
      • "customfield4" : "customfield4Label",
      • "customfield5" : "customfield5Label",
      • "customfield6" : "customfield6Label",
      • "customfield7" : "customfield7Label",
      • "customfield8" : "customfield8Label",
      • "customfield9" : "customfield9Label",
      • "customfield10" : "customfield10Label"
      },
    • "accountId" : "string",
    • "favorite" : false
    }
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
200 successful operation
400 Invalid request

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/groups/{groupId}
     -X PUT
     -H "Content-Type: application/json"
     -d "{
 'id' : 'string',
 'legacy_id' : 'integer',
 'name' : 'string',
 'mapping' : {
  'type' : 'object',
  'example' : {
   'firstname' : 'firstnameLabel',
   'lastname' : 'lastnameLabel',
   'company' : 'companyLabel',
   'telephone_number' : 'telephone_numberLabel',
   'customfield1' : 'customfield1Label',
   'customfield2' : 'customfield2Label',
   'customfield3' : 'customfield3Label',
   'customfield4' : 'customfield4Label',
   'customfield5' : 'customfield5Label',
   'customfield6' : 'customfield6Label',
   'customfield7' : 'customfield7Label',
   'customfield8' : 'customfield8Label',
   'customfield9' : 'customfield9Label',
   'customfield10' : 'customfield10Label'
  }
 },
 'accountId' : 'string',
 'createdAt' : 'string',
 'contacts' : 'integer',
 'favorite' : {
  'example' : '0'
 }
}"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'groupId' => 'groupId',
    'data' => json_encode(array(
               "id" => "string",
               "legacy_id" => "integer",
               "name" => "string",
               "mapping": array(
                "type" => "object",
                "example": array(
                 "firstname" => "firstnameLabel",
                 "lastname" => "lastnameLabel",
                 "company" => "companyLabel",
                 "telephone_number" => "telephone_numberLabel",
                 "customfield1" => "customfield1Label",
                 "customfield2" => "customfield2Label",
                 "customfield3" => "customfield3Label",
                 "customfield4" => "customfield4Label",
                 "customfield5" => "customfield5Label",
                 "customfield6" => "customfield6Label",
                 "customfield7" => "customfield7Label",
                 "customfield8" => "customfield8Label",
                 "customfield9" => "customfield9Label",
                 "customfield10" => "customfield10Label"
                )
               ),
               "accountId" => "string",
               "createdAt" => "string",
               "contacts" => "integer",
               "favorite": array(
                "example" => "0"
               )
              )          ),
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/groups/'
         .$groupId;

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_CUSTOMREQUEST  => 'PUT',
     CURLOPT_POST           => true,
     CURLOPT_POSTFIELDS     => $data,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
Delete groups in bulk

Delete groups in bulk

https://api.cmtelecom.com/addressbook/v1.0/groups

DELETE Parameters

name in description required type schema
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string
accountId query Account Guid true string
body body List of group guids to delete true object
  • {
    • "type" : "string"
    }

Responses

http status description
204 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/groups?accountId='accountId'
     -X DELETE
     -H "Content-Type: application/json"
     -d "{
 'type' : 'string'
}"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/groups?accountId='accountId'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_CUSTOMREQUEST  => 'DELETE',
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
Delete a group

Delete a group

https://api.cmtelecom.com/addressbook/v1.0/groups/{groupId}

DELETE Parameters

name in description required type
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string
groupId path Group Id true string

Responses

http status description
204 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/groups/{groupId}
     -X DELETE
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'groupId' => 'groupId',
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/groups/'
         .$groupId;

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_CUSTOMREQUEST  => 'DELETE',
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Mappings

Get default mappings

Fetch information about mappings

https://api.cmtelecom.com/addressbook/v1.0/mappings

Responses

http status description
200 Return the default mappings with additional information

Imports

Import contacts in bulk

Import contacts in bulk

https://api.cmtelecom.com/addressbook/v1.0/contacts/imports

POST Parameters

name in description required schema type
body body Contact object that you wish to create true
  • {
    • "id" : "string",
    • "accountId" : "string",
    • "groupId" : "string",
    • "phoneprefix" : "integer",
    • "contacts" : [{
      • "firstname" : "string",
      • "lastname" : "string",
      • "company" : "string",
      • "telephone_number" : "string",
      • "email_address" : "string",
      • "customfield1" : "string",
      • "customfield2" : "string",
      • "customfield3" : "string",
      • "customfield4" : "string",
      • "customfield5" : "string",
      • "customfield6" : "string",
      • "customfield7" : "string",
      • "customfield8" : "string",
      • "customfield9" : "string",
      • "customfield10" : "string"
      }]
    }
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com false string

Responses

http status description
201 successful operation
400 Invalid request

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/contacts/imports
     -X POST
     -H "Content-Type: application/json"
     -d "{
 'id' : 'string',
 'accountId' : 'string',
 'groupId' : 'string',
 'phoneprefix' : 'integer',
 'contacts' : {
  'firstname' : 'string',
  'lastname' : 'string',
  'company' : 'string',
  'telephone_number' : 'string',
  'email_address' : 'string',
  'customfield1' : 'string',
  'customfield2' : 'string',
  'customfield3' : 'string',
  'customfield4' : 'string',
  'customfield5' : 'string',
  'customfield6' : 'string',
  'customfield7' : 'string',
  'customfield8' : 'string',
  'customfield9' : 'string',
  'customfield10' : 'string'
 }
}"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'data' => json_encode(array(
               "id" => "string",
               "accountId" => "string",
               "groupId" => "string",
               "phoneprefix" => "integer",
               "contacts": array(
                "firstname" => "string",
                "lastname" => "string",
                "company" => "string",
                "telephone_number" => "string",
                "email_address" => "string",
                "customfield1" => "string",
                "customfield2" => "string",
                "customfield3" => "string",
                "customfield4" => "string",
                "customfield5" => "string",
                "customfield6" => "string",
                "customfield7" => "string",
                "customfield8" => "string",
                "customfield9" => "string",
                "customfield10" => "string"
               )
              )          ),
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/contacts/imports';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_POST           => true,
     CURLOPT_POSTFIELDS     => $data,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
Get running imports

Get details for imports that are present in the queue

https://api.cmtelecom.com/addressbook/v1.0/contacts/imports

GET Parameters

name in description required type
accountId query The account to fetch imports from true string
X-CM-PRODUCTTOKEN header The api key obtained from https://gateway.cmtelecom.com string string

Responses

http status description
200 successful operation

Code Examples:

cURL
curl -i https://api.cmtelecom.com/addressbook/v1.0/contacts/imports?accountId='accountId'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/addressbook/v1.0/contacts/imports?accountId='accountId'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-AUTHENTICATIONCOOKIE: '.$params['X-CM-AUTHENTICATIONCOOKIE']
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>