This API provides insight into every individual message sent through your account. A lot of details about every message are available, like deliverytime and the delivery status.
You can authenticate your calls to this API endpoint by using your producttoken or with the CM SSO cookie.
https://api.cmtelecom.com/v1.2/transactions/
For authenticating with your Producttoken provide the header X-CM-PRODUCTTOKEN with your producttoken as value.
For CM SSO authentication send your cookie along with the request.
All requests to the Transactions API are GET requests.
The resultset is encapsulated in an envelope which contains information about the resultset.
This object holds all applied filtering information, and some aggregate information
This object holds pagination information
This array holds the resultset
https://api.cmtelecom.com/v1.2/transactions/
OUT is the default direction for transactions in this API. These are messages send to a mobilephone.
http status | content-type | description |
---|---|---|
200 | application/json | { |
curl -i https://api.cmtelecom.com/v1.0/transactions/ -G -H "X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000" -d startdate=2017-02-01 -d enddate=2017-02-02
$headers = @{"X-CM-PRODUCTTOKEN"="my-cm-producttoken"} $filters = @{ startdate = "2017-02-22T17:00" enddate = "2017-02-22T18:00" } Invoke-RestMethod -Uri "https://api.cmtelecom.com/v1.0/transactions/" ` -Method Get ` -Headers $headers ` -Body $filters
https://api.cmtelecom.com/v1.2/transactions/?direction=in
IN is the other direction for transactions in this API. These are messages send from a mobilephone.
http status | content-type | description |
---|---|---|
200 | application/json | { |
curl -i https://api.cmtelecom.com/v1.0/transactions/ -G -H "X-CM-PRODUCTTOKEN: 0000000-0000-0000-0000-000000000000" -d startdate=2017-02-01 -d enddate=2017-02-02 -d direction=in
$headers = @{"X-CM-PRODUCTTOKEN"="my-cm-producttoken"} $filters = @{ startdate = "2017-02-22T17:00" enddate = "2017-02-22T18:00" direction = "in" } Invoke-RestMethod -Uri "https://api.cmtelecom.com/v1.0/transactions/" ` -Method Get ` -Headers $headers ` -Body $filters
filter for a date range with these parameters :
startdate={ISO8601}
enddate={ISO8601}
These are the only required parameters for calls to this API.
When the Time is omitted in the startdate or enddate it will be filled out with zeroes. 2017-05-05 will be treated as 2017-05-05T00:00:00.
A maximum range of 1 month is allowed.
use the analyticserror parameter to filter by errorcode used in the analytics api for readable errors
analyticserror=3
accepts comma separated list of integers
analyticserrors list
use channel for filtering transactions per Channel.
channel=SMS
available channels
use converted to filter by converted messages
converted=true
accepts a boolean value
use countryiso to filter by recipients in specific countries
countryiso=nl
accepts a comma separated list of country iso codes
use the customgrouping parameters to filters on all provided customgroupings
customgrouping=some-kind-of-reference
customgrouping2=some-kind-of-reference
customgrouping3=some-kind-of-reference
Use the direction parameter to get transactions from a certain direction.
direction=out
direction=in
Available values
OUT will filter outgoing messages (MT)
IN will filter incoming messages (MO)
use errorcode to filter by errorcodes as returned by this api
errorcode=5
accepts a comma separated list of integers
use mccmnc to filter by recipients at specific operators
mccmnc=20404
accepts a comma separated list of operator identification codes
it stands for Mobile Country Code Mobile Network Code, 204 identifies the country (the Netherlands) and 04 identifies the operator (Vodafone) in this example
use the message parameter to filter for specific messages, works in both directions
message=This very specific message
Messages may consist of multiple parts, for example when the SMS text is over 160 characters. In this case the message object has a multipart property set, containing an identifier and a part number.
For your viewing pleasure it is possible to filter the message list to show only messages consisting of one part and only the first part of messages consisting of multiple parts. This way you get an overview of your "Full Messages".
multipart=firstpartonly
You can also get all parts of a specific multipart message by filtering for a specific identifier. It is adviced to use the Recipient filter in combination with this filter, since the multipart identifier are not universally unique.
multipart={multipart.identifier}
use omit to skip specific properties that are of no use in the applicable context.
omit=totalprice,totaltariff,result
accepts a comma separated list of values
Omitting some of these properties can result in smaller and faster responses.
use recipient to filter by receiver of a transaction
recipient=0031601234567
accepts a comma separated list of recipients
use reference to filter by customer provided reference
reference=customer-known-identifier
accepts comma separated list of references
use sender to filter by sendername of a transaction
sender=3669
sender=0031601234567
accepts comma separated list of senders
Getting all transactions that belong to a certain SMS-Campaign can be filtered using this parameter.
smscampaign={smscampaign.identifier}
Your SMS Campaign identifier is a GUID, which you can find in the URL of the campaign-edit-view before hand, and in the CustomGrouping property of messages that are sent out (and in) for a specific campaign.
use statuscode to filter by statuscode as returned by this api
statuscode=20
accepts comma separated list of integers
analyticserrors list
use pagesize to set the pageSize property in the pagination object
pagesize=10
use startat to set the currentPage property in the pagination object
startat=7
use the pagination object to determine the max value
use negate to invert a filter
negate=statuscode
accepts a comma separated list of parameter keys
For example, to filter for all messages to recipients outside The Netherlands, supply the countryiso parameter with the value you want to negate, and supply the negate parameter with that parameter-key.
?startdate=...&endate=...&countryiso=nl&negate=countryiso
On this API there is not only a /transactions/ resource available, but also a few extra resources to help you out with getting values for a few filters.
In this resource you can find all known countries with their ISO code for us in the country filters
/transactions/countries
[ { "iso": "AD", "name": "Andorra" }, ... ]
All errorcodes to filter on.
/transactions/errorcodes
[ { "id": 0, "description": "Unknown recipient" }, ... ]
All known Mediums aka Channels
/transactions/mediums
[ { "id": 1, "name": "SMS" }, ... ]
All known Operators with their MCC MNC
/transactions/operators
[ { "iso": "US", "mccmnc": "200053", "name": "Virgin Mobile" }, ... ]
All known Status codes
/transactions/statuscodes
It currently produces this list of status codes
[ {
"id": 19,
"description": "Sent"
},
{
"id": 20,
"description": "Delivered"
},
{
"id": 21,
"description": "Failed"
},
{
"id": 22,
"description": "Cancelled"
},
{
"id": 37,
"description": "Accepted"
},
{
"id": 40,
"description": "Rejected"
}]