Send
Send
PHP

Introduction

The Send Api provides an easy way to send messages and campaigns. This API is used for SMS Campaigns and Send

Channels

getChannels

Find all channels

https://api.cmtelecom.com/send/v2.0/channels

GET Parameters

name in description required type
accountGuid query Account GUID true string
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful operation

<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/channels?accountGuid='accountGuid'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>
curl -i https://api.cmtelecom.com/send/v2.0/channels?accountGuid='accountGuid'
     -X GET
     -H "Content-Type: application/json"

getAChannel

Find a channel by value/appKey

https://api.cmtelecom.com/send/v2.0/channels/{value}

GET Parameters

name in description required type
accountGuid query Account GUID true string
value path value or app key true string
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful operation

curl -i https://api.cmtelecom.com/send/v2.0/channels/{value}?accountGuid='accountGuid'
     -X GET
     -H "Content-Type: application/json"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'value' => 'value',
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/channels/'
         .$value
         .'?accountGuid='accountGuid'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>

Costs

getExpectedCosts

Get expected costs

https://api.cmtelecom.com/send/v1.0/costs/expected

GET Parameters

name in description required type items
accountGuid query Account GUID true string
msisdns query MSISDN phone numbers false array
  • "string"
contacts query Contact guids false array
  • "string"
groups query Group guids false array
  • "string"
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful operation
400 Error: 4003, This account has no price plan, probably uses credits instead

curl -i https://api.cmtelecom.com/send/v1.0/costs/expected?accountGuid='accountGuid'&msisdns='msisdns'&contacts='contacts'&groups='groups'
     -X GET
     -H "Content-Type: application/json"
     -d "'string'"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v1.0/costs/expected?accountGuid='accountGuid'&msisdns='msisdns'&contacts='contacts'&groups='groups'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>

getRealisedCosts

Get realised costs

https://api.cmtelecom.com/send/v1.0/costs/realised

GET Parameters

name in description required type
accountGuid query Account GUID true string
messageId query Message id false string
messageGuid query Message guid false string
startDate query Start date (requires: endDate) false string
endDate query End date (requires: startDate false string
reference query Reference (requires: startDate and endDate) false string
customGrouping1 query Custom grouping 1 (requires: startDate and endDate) false string
customGrouping2 query Custom grouping 2 (requires: startDate and endDate) false string
customGrouping3 query Custom grouping 3 (requires: startDate and endDate) false string
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful operation
400 Error: 4004, Failed to calculate costs

curl -i https://api.cmtelecom.com/send/v1.0/costs/realised?accountGuid='accountGuid'&messageId='messageId'&messageGuid='messageGuid'&startDate='startDate'&endDate='endDate'&reference='reference'&customGrouping1='customGrouping1'&customGrouping2='customGrouping2'&customGrouping3='customGrouping3'
     -X GET
     -H "Content-Type: application/json"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v1.0/costs/realised?accountGuid='accountGuid'&messageId='messageId'&messageGuid='messageGuid'&startDate='startDate'&endDate='endDate'&reference='reference'&customGrouping1='customGrouping1'&customGrouping2='customGrouping2'&customGrouping3='customGrouping3'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>

Messages

createAMessage

Create a message

https://api.cmtelecom.com/send/v2.0/messages

POST Parameters

name in description required schema type
body body Message object true
  • {
    • "Guid" : "integer",
    • "AccountGuid" : "string",
    • "Template" : {
      • "Name" : "string"
      }, "Campaign" : {
      • "Name" : "string",
      • "ConversionLink" : "string",
      • "CreatedAt" : "string",
      • "UpdatedAt" : "string"
      }, "LandingPage" : {
      • "TemplateGuid" : "string",
      • "CampaignGuid" : "string",
      • "Mappings" : {
        • "example" : ""
        }
      }, "Status" : "string",
    • "Name" : "string",
    • "From" : {
      • "Type" : {
        • "example" : ""
        }, "Name" : "string",
      • "Value" : "string",
      • "CountryCode" : "string",
      • "AllowReply" : {
        • "type" : "boolean",
        • "example" : ""
        }
      }, "To" : {
      • "Type" : {
        • "example" : ""
        }, "Name" : "string",
      • "Value" : "string",
      • "CountryCode" : "string",
      • "RecipientCount" : "integer",
      • "IsTestRecipient" : {
        • "type" : "boolean",
        • "example" : ""
        }
      }, "Body" : "string",
    • "Channel" : {
      • "Type" : {
        • "example" : ""
        }, "Name" : "string",
      • "Value" : "string"
      }, "CustomGrouping1" : "string",
    • "CustomGrouping2" : "string",
    • "CustomGrouping3" : "string",
    • "SendWindow" : "string",
    • "SendAt" : "string",
    • "QueuedAt" : "string",
    • "ProcessedAt" : "string",
    • "FailedAt" : "string",
    • "Report" : {
      • "RecipientCount" : "integer",
      • "SentCount" : "integer",
      • "FailedCount" : "integer"
      }, "ProductToken" : "string",
    • "CreatedAt" : "string",
    • "UpdatedAt" : "string"
    }
accountGuid query Account Guid true string
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
201 successful operation
400 Invalid request
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'data' => json_encode(array(
               "Guid" => "integer",
               "AccountGuid" => "string",
               "Template": array(
                "Name" => "string"
               ),
               "Campaign": array(
                "Name" => "string",
                "ConversionLink" => "string",
                "CreatedAt" => "string",
                "UpdatedAt" => "string"
               ),
               "LandingPage": array(
                "TemplateGuid" => "string",
                "CampaignGuid" => "string",
                "Mappings": array(
                 "example" => ""
                )
               ),
               "Status" => "string",
               "Name" => "string",
               "From": array(
                "Type": array(
                 "example" => ""
                ),
                "Name" => "string",
                "Value" => "string",
                "CountryCode" => "string",
                "AllowReply": array(
                 "type" => "boolean",
                 "example" => ""
                )
               ),
               "To": array(
                "Type": array(
                 "example" => ""
                ),
                "Name" => "string",
                "Value" => "string",
                "CountryCode" => "string",
                "RecipientCount" => "integer",
                "IsTestRecipient": array(
                 "type" => "boolean",
                 "example" => ""
                )
               ),
               "Body" => "string",
               "Channel": array(
                "Type": array(
                 "example" => ""
                ),
                "Name" => "string",
                "Value" => "string"
               ),
               "CustomGrouping1" => "string",
               "CustomGrouping2" => "string",
               "CustomGrouping3" => "string",
               "SendWindow" => "string",
               "SendAt" => "string",
               "QueuedAt" => "string",
               "ProcessedAt" => "string",
               "FailedAt" => "string",
               "Report": array(
                "RecipientCount" => "integer",
                "SentCount" => "integer",
                "FailedCount" => "integer"
               ),
               "ProductToken" => "string",
               "CreatedAt" => "string",
               "UpdatedAt" => "string"
              )          ),
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/message';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>
curl -i https://api.cmtelecom.com/send/v2.0/message
     -X POST
     -H "Content-Type: application/json"
     -d "{
 'Guid' : 'integer',
 'AccountGuid' : 'string',
 'Template' : {
  'Name' : 'string'
 },
 'Campaign' : {
  'Name' : 'string',
  'ConversionLink' : 'string',
  'CreatedAt' : 'string',
  'UpdatedAt' : 'string'
 },
 'LandingPage' : {
  'TemplateGuid' : 'string',
  'CampaignGuid' : 'string',
  'Mappings' : {
   'example' : ''
  }
 },
 'Status' : 'string',
 'Name' : 'string',
 'From' : {
  'Type' : {
   'example' : ''
  },
  'Name' : 'string',
  'Value' : 'string',
  'CountryCode' : 'string',
  'AllowReply' : {
   'type' : 'boolean',
   'example' : ''
  }
 },
 'To' : {
  'Type' : {
   'example' : ''
  },
  'Name' : 'string',
  'Value' : 'string',
  'CountryCode' : 'string',
  'RecipientCount' : 'integer',
  'IsTestRecipient' : {
   'type' : 'boolean',
   'example' : ''
  }
 },
 'Body' : 'string',
 'Channel' : {
  'Type' : {
   'example' : ''
  },
  'Name' : 'string',
  'Value' : 'string'
 },
 'CustomGrouping1' : 'string',
 'CustomGrouping2' : 'string',
 'CustomGrouping3' : 'string',
 'SendWindow' : 'string',
 'SendAt' : 'string',
 'QueuedAt' : 'string',
 'ProcessedAt' : 'string',
 'FailedAt' : 'string',
 'Report' : {
  'RecipientCount' : 'integer',
  'SentCount' : 'integer',
  'FailedCount' : 'integer'
 },
 'ProductToken' : 'string',
 'CreatedAt' : 'string',
 'UpdatedAt' : 'string'
}"
getMessages

Find all messages

https://api.cmtelecom.com/send/v2.0/messages

GET Parameters

name in description required type items default enum
accountGuid query Account GUID true string
type query Filter by message type false array
  • "string"
search query Search on sender, recipient and message body false string
status query Filter result on status false array
  • "string"
test path Show only test messages false boolean
orderBy query Field that will be used to order the collection on false string send_at
  • [
    • "send_at",
    • "processed_at",
    • "created_at",
    • "updated_at"
    ]
order query The sorting method. Should be 'DESC' or 'ASC' false string desc
  • [
    • "desc",
    • "asc"
    ]
skip query Skip the first amount of messages false integer
take query Take an amount of messages false integer
recipientCount path count recipients false boolean
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful operation
curl -i https://api.cmtelecom.com/send/v2.0/messages?accountGuid='accountGuid'&type='type'&search='search'&status='status'&orderBy='orderBy'&order='order'&skip=10&take=10
     -X GET
     -H "Content-Type: application/json"
     -d "[
 'desc',
 'asc'
]"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'test' => 'test',
    'recipientCount' => 'recipientCount',
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/messages?accountGuid='accountGuid'&type='type'&search='search'&status='status'&orderBy='orderBy'&order='order'&skip=10&take=10';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>
getMessage

Find a message by guid

https://api.cmtelecom.com/send/v2.0/messages/{messageGuid}

GET Parameters

name in description required type
accountGuid query Account GUID true string
messageGuid path message guid true string
recipientCount path count recipients false boolean
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful operation
curl -i https://api.cmtelecom.com/send/v2.0/messages/{messageGuid}?accountGuid='accountGuid'
     -X GET
     -H "Content-Type: application/json"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'messageGuid' => 'messageGuid',
    'recipientCount' => 'recipientCount',
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/messages/'
         .$messageGuid
         .'?accountGuid='accountGuid'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>
updateMessage

Update a message

https://api.cmtelecom.com/send/v2.0/messages/{messageGuid}

PUT Parameters

name in description required schema type
body body Message object that you wish to create true
  • {
    • "Guid" : "integer",
    • "AccountGuid" : "string",
    • "Template" : {
      • "Name" : "string"
      }, "Campaign" : {
      • "Name" : "string",
      • "ConversionLink" : "string",
      • "CreatedAt" : "string",
      • "UpdatedAt" : "string"
      }, "LandingPage" : {
      • "TemplateGuid" : "string",
      • "CampaignGuid" : "string",
      • "Mappings" : {
        • "example" : ""
        }
      }, "Status" : "string",
    • "Name" : "string",
    • "From" : {
      • "Type" : {
        • "example" : ""
        }, "Name" : "string",
      • "Value" : "string",
      • "CountryCode" : "string",
      • "AllowReply" : {
        • "type" : "boolean",
        • "example" : ""
        }
      }, "To" : {
      • "Type" : {
        • "example" : ""
        }, "Name" : "string",
      • "Value" : "string",
      • "CountryCode" : "string",
      • "RecipientCount" : "integer",
      • "IsTestRecipient" : {
        • "type" : "boolean",
        • "example" : ""
        }
      }, "Body" : "string",
    • "Channel" : {
      • "Type" : {
        • "example" : ""
        }, "Name" : "string",
      • "Value" : "string"
      }, "CustomGrouping1" : "string",
    • "CustomGrouping2" : "string",
    • "CustomGrouping3" : "string",
    • "SendWindow" : "string",
    • "SendAt" : "string",
    • "QueuedAt" : "string",
    • "ProcessedAt" : "string",
    • "FailedAt" : "string",
    • "Report" : {
      • "RecipientCount" : "integer",
      • "SentCount" : "integer",
      • "FailedCount" : "integer"
      }, "ProductToken" : "string",
    • "CreatedAt" : "string",
    • "UpdatedAt" : "string"
    }
accountGuid query Account GUID true string
messageGuid path message guid true string
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful deleted
curl -i https://api.cmtelecom.com/send/v2.0/messages/{messageGuid}?accountGuid='accountGuid'
     -X PUT
     -H "Content-Type: application/json"
     -d "{
 'Guid' : 'integer',
 'AccountGuid' : 'string',
 'Template' : {
  'Name' : 'string'
 },
 'Campaign' : {
  'Name' : 'string',
  'ConversionLink' : 'string',
  'CreatedAt' : 'string',
  'UpdatedAt' : 'string'
 },
 'LandingPage' : {
  'TemplateGuid' : 'string',
  'CampaignGuid' : 'string',
  'Mappings' : {
   'example' : ''
  }
 },
 'Status' : 'string',
 'Name' : 'string',
 'From' : {
  'Type' : {
   'example' : ''
  },
  'Name' : 'string',
  'Value' : 'string',
  'CountryCode' : 'string',
  'AllowReply' : {
   'type' : 'boolean',
   'example' : ''
  }
 },
 'To' : {
  'Type' : {
   'example' : ''
  },
  'Name' : 'string',
  'Value' : 'string',
  'CountryCode' : 'string',
  'RecipientCount' : 'integer',
  'IsTestRecipient' : {
   'type' : 'boolean',
   'example' : ''
  }
 },
 'Body' : 'string',
 'Channel' : {
  'Type' : {
   'example' : ''
  },
  'Name' : 'string',
  'Value' : 'string'
 },
 'CustomGrouping1' : 'string',
 'CustomGrouping2' : 'string',
 'CustomGrouping3' : 'string',
 'SendWindow' : 'string',
 'SendAt' : 'string',
 'QueuedAt' : 'string',
 'ProcessedAt' : 'string',
 'FailedAt' : 'string',
 'Report' : {
  'RecipientCount' : 'integer',
  'SentCount' : 'integer',
  'FailedCount' : 'integer'
 },
 'ProductToken' : 'string',
 'CreatedAt' : 'string',
 'UpdatedAt' : 'string'
}"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'messageGuid' => 'messageGuid',
    'data' => json_encode(array(
               "Guid" => "integer",
               "AccountGuid" => "string",
               "Template": array(
                "Name" => "string"
               ),
               "Campaign": array(
                "Name" => "string",
                "ConversionLink" => "string",
                "CreatedAt" => "string",
                "UpdatedAt" => "string"
               ),
               "LandingPage": array(
                "TemplateGuid" => "string",
                "CampaignGuid" => "string",
                "Mappings": array(
                 "example" => ""
                )
               ),
               "Status" => "string",
               "Name" => "string",
               "From": array(
                "Type": array(
                 "example" => ""
                ),
                "Name" => "string",
                "Value" => "string",
                "CountryCode" => "string",
                "AllowReply": array(
                 "type" => "boolean",
                 "example" => ""
                )
               ),
               "To": array(
                "Type": array(
                 "example" => ""
                ),
                "Name" => "string",
                "Value" => "string",
                "CountryCode" => "string",
                "RecipientCount" => "integer",
                "IsTestRecipient": array(
                 "type" => "boolean",
                 "example" => ""
                )
               ),
               "Body" => "string",
               "Channel": array(
                "Type": array(
                 "example" => ""
                ),
                "Name" => "string",
                "Value" => "string"
               ),
               "CustomGrouping1" => "string",
               "CustomGrouping2" => "string",
               "CustomGrouping3" => "string",
               "SendWindow" => "string",
               "SendAt" => "string",
               "QueuedAt" => "string",
               "ProcessedAt" => "string",
               "FailedAt" => "string",
               "Report": array(
                "RecipientCount" => "integer",
                "SentCount" => "integer",
                "FailedCount" => "integer"
               ),
               "ProductToken" => "string",
               "CreatedAt" => "string",
               "UpdatedAt" => "string"
              )          ),
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/messages/'
         .$messageGuid
         .'?accountGuid='accountGuid'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>
deleteMessage

Delete a message

https://api.cmtelecom.com/send/v2.0/messages/{messageGuid}

DELETE Parameters

name in description required type
accountGuid query Account GUID true string
messageGuid path message guid true string
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful deleted
curl -i https://api.cmtelecom.com/send/v2.0/messages/{messageGuid}?accountGuid='accountGuid'
     -X DELETE
     -H "Content-Type: application/json"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'messageGuid' => 'messageGuid',
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/messages/'
         .$messageGuid
         .'?accountGuid='accountGuid'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>

Recipients

getRecipients

Find valid recipients

https://api.cmtelecom.com/send/v2.0/recipients

GET Parameters

name in description required type items
accountGuid query Account GUID true string
value query Phone number value true array
  • "string"
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string
X-CM-AUTHENTICATIONCOOKIE header SSO Authentication Cookie false string

Responses

http status description
200 successful operation
curl -i https://api.cmtelecom.com/send/v2.0/recipients?accountGuid='accountGuid'&value='value'
     -X GET
     -H "Content-Type: application/json"
     -d "'string'"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID',
    'X-CM-AUTHENTICATIONCOOKIE' => 'X-CM-AUTHENTICATIONCOOKIE'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/recipients?accountGuid='accountGuid'&value='value'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID'],
                                 '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
  ));
?>

Senders

getSenders

Find all senders

https://api.cmtelecom.com/send/v2.0/senders

GET Parameters

name in description required type
accountGuid query Account GUID true string
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful operation
curl -i https://api.cmtelecom.com/send/v2.0/senders?accountGuid='accountGuid'
     -X GET
     -H "Content-Type: application/json"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/senders?accountGuid='accountGuid'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>
getASender

Find a sender by value

https://api.cmtelecom.com/send/v2.0/senders/{value}

GET Parameters

name in description required type
accountGuid query Account GUID true string
value path value true string
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful operation
curl -i https://api.cmtelecom.com/send/v2.0/senders/{value}?accountGuid='accountGuid'
     -X GET
     -H "Content-Type: application/json"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'value' => 'value',
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/senders/'
         .$value
         .'?accountGuid='accountGuid'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>
getLastUsedSender

Find last used sender

https://api.cmtelecom.com/send/v2.0/senders/lastused

GET Parameters

name in description required type
accountGuid query Account GUID true string
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful operation
curl -i https://api.cmtelecom.com/send/v2.0/senders/lastused?accountGuid='accountGuid'
     -X GET
     -H "Content-Type: application/json"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/senders/lastused?accountGuid='accountGuid'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>

Validate

validateAccount

Validate account details. Checks if a producttoken is present and the trust score is high enough.

https://api.cmtelecom.com/send/v2.0/validate/account

GET Parameters

name in description required type
accountGuid query Account GUID true string
X-CM-SSO-ACCOUNTGUID header SSO Account Guid true string

Responses

http status description
200 successful operation
403 Error: ERROR_4032, Not enough privileges
404 Error: ERROR_4041, Missing product token
curl -i https://api.cmtelecom.com/send/v2.0/validate/account?accountGuid='accountGuid'
     -X GET
     -H "Content-Type: application/json"
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'X-CM-SSO-ACCOUNTGUID' => 'X-CM-SSO-ACCOUNTGUID'
  );

  $url = 'https://api.cmtelecom.com/send/v2.0/validate/account?accountGuid='accountGuid'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json',
                                 'X-CM-SSO-ACCOUNTGUID: '.$params['X-CM-SSO-ACCOUNTGUID']
                                 ),
     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
  ));
?>