{
  1. Introduction
    1. Sending Simple Message
    2. Advanced Message Features
  2. Channels
    1. Get Channels
  3. Messages
    1. Add Message
    2. Get Messages
    3. Delete Messages
    4. Search Messages
    5. Get Message
    6. Update Message
    7. Delete Message
    8. Cancel Message
    9. Get Message Cost
    10. Duplicate Message
    11. Pause Message
    12. Resume Message
    13. Send Test Message
  4. Senders
    1. Add Sender
    2. Get Senders
    3. Update Sender
    4. Delete Sender

Introduction

CM's Messages API enables you to send individual messages or message campaigns . You can integrate this in your application by communicating with our api.

The Messages API is a REST API that uses JSON to communicate.

In getting started section current API functionality within initial release is described briefly. Some features like Analytics, Recurrence, Advanced Spread settings will be available later but they are included in request/response models.

Authentication

Authentication and authorization is done via a product token. You can obtain your product token from the messaging gateway app (https://gateway.cmtelecom.com). If you don't see that app you might have got it via your account manager or you can contact support to obtain one.

For all methods described in this api, the product token should be provided by including it in the X-CM-PRODUCTTOKEN header.

Getting your accountID

In all methods you need to provide the accountID. This is a guid that identifies your account. This identifier can be found on the url of the addressbook application (https://addressbook.cmtelecom.com), after the language indicator. Below you can find some url examples and the corresponding accountID.

Url AccountID
https://addressbook.cmtelecom.com/en/a66b6ba2-7b13-4caf-abf6-c736c977c1d4 a66b6ba2-7b13-4caf-abf6-c736c977c1d4
https://addressbook.cmtest.nl/fr/fe266716-d8ff-4aba-bddb-c61f8f40c656#/Templates fe266716-d8ff-4aba-bddb-c61f8f40c656

Getting Started

In below section current API functionality within initial release is described briefly. Some features like Analytics, Recurrence, Advanced Spread settings will be available later but they are included in request/response models.

1 - How to send a basic message

POST https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages

Example post body:

{
    "body": "This is a test message",
    "recipients": [
                    { "group": "b99f6d4f-243a-11e7-9742-005056b0187a" },
                    { "contact": "0b7bf29a-2439-11e7-9742-005056b0187a" },
                    { "msisdn": "+31765727000" }
                  ],
    "senders": ["TEST"]
}

recipients : Contains an array of recipient objects, for any given phone number msisdn must be specified. If you want to send to Addressbook groups/contacts you need to specify the guids.

senders : Contains an array of string(s), specifies the message sender.

Message will be sent immediately.


Example curl request :

curl -X POST \
  https://api.cmtelecom.com/messages/v1/accounts/z9761684-b8d0-440f-8508-72ec36766069/messages \
  -H 'Accept: application/json, text/json' \
  -H 'Content-Type: application/json' \
  -H 'X-CM-PRODUCTTOKEN: ce4e6c52-5696-405b-9524-e478468f1907' \
  -d '{
    "body": "This is a test message",
    "recipients": [
                    { "group": "b99f6d4f-243a-11e7-9742-005056b0187a" },
                    { "contact": "0b7bf29a-2439-11e7-9742-005056b0187a" },
                    { "msisdn": "+31765727000" }
                  ],
    "senders": ["TEST"]
}'

2 - How to send a message with more advanced settings

POST https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages

Example post body:

{
    "body": "Hello {{1}}, this is an advanced test message. This can contain a link => [[http://www.cm.com]] or CM Pages [[page:b99f6d4f-243a-11e7-9742-005056b0187a]] or OptOut instructions [[optout]]",
    "ignoreUnsubscribes" : false,
    "scheduledAtUtc": "2018-08-15T13:09:43.715Z",
    "recipients": [
                    { "group": "b99f6d4f-243a-11e7-9742-005056b0187a" },
                    { "contact": "0b7bf29a-2439-11e7-9742-005056b0187a" },
                    { "msisdn": "+31627142592", "data": { "1": "John", "3": "Doe", "5":"john.doe@cm.nl","6": "CM.com" } }
                  ],
    "senders": ["TEST"],
    "countrySpecificSenders": {
        "NL": "CM.com",
        "BE": "0032496448785",
        "UK": "88882"
    },
    "senderPreset": "B29C91D4-E429-477E-9308-B17BB0F91F1F",
    "spread": {
        "timeFrames": [
            {
                "days": [
                    "Mon",
                    "Tue",
                    "Wed",
                    "Thu",
                    "Fri",
                    "Sat",
                    "Sun"
                ],
                "startTime": "09:00",
                "endTime": "12:00"
            },
            {
                "days": [
                    "Mon",
                    "Tue",
                    "Wed",
                    "Thu",
                    "Fri",
                    "Sat",
                    "Sun"
                ],
                "startTime": "13:00",
                "endTime": "17:30"
            }
        ],
        "until" : "2019-03-14T15:00:26.9932482Z"
    }
}

scheduledAtUtc : defines when the message will be sent, timezone is UTC, please make sure you adjust your time before supplying values.

Data tags like {{1}} are placeholders for custom data retrieved from Addressbook or msisdn data.

Links enclosed in double square brackets like [[http://www.cm.com]] will be converted into shortlinks like http://cm.to/sH012tL which are 21 characters long.

Links must start with http:// or https://

CM Pages tags are enclosed in double square brackets, starts with page: and includes page the related page guid. They are also translated into shortlinks (21 chars).

Optout tag inserts optout instructions per recipient, if recipient's country has a predefined shortcode for STOP messages it will translate into STOP shortcode otherwise it will translated into an optout link like http://NO-S.MS/OptOut

ignoreUnsubscribes : By default Messages API filters recipients using the Unsubscribes list in Addressbook. If this setting is set to true, unsubscribes will not be filtered.

Msisdn with data : It is possible to add a data dictionary to msisdn recipients so data tags in the body can be rendered also for msisdn recipients.

Senders : Specifies the default sender to use unless a specific sender is defined for recipients country in countrySpecificSenders setting or in a senderPreset. It is possible to define a set of countrySpecificSenders senders as use it via senderPreset setting.

Please note that countrySpecificSenders setting precedes senderPreset

spread : Spread until setting makes sure that messages are delivered in batches over a certain amount of time between scheduled time and spread until setting. Value must be in UTC

timeFrames : Defines the allowed days and time periods where the messages are allowed to be sent.

Time frame startTime and endTime values must be in UTC


Below are the list of default data tags, if you have other custom fields defined in addressbook/msisdn data, you have to use relevant custom field ids.

Name FieldId Tag
FirstName 1 {{1}}
Insertion 2 {{2}}
LastName 3 {{3}}
PhoneNumber 4 {{4}}
EmailAddress 5 {{5}}
Company 6 {{6}}

Channels

Gets available channels.

GET https://api.cmtelecom.com/messages/v1/accounts/{accountId}/channels

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)

Responses

HTTP Code Description Schema
200 OK < < string, CM.Platform.Messages.Models.ApiChannelInfo > map > array

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/channels

Example HTTP response

Response 200
{
    "SMS": {
        "disabled": false,
        "name": "SMS",
        "options": {
            "allowImages": false
        },
        "type": "SMS"
    },
    "Viber": {
        "disabled": false,
        "name": "Viber",
        "options": {
            "allowImages": true
        },
        "type": "Viber"
    },
    "WhatsApp": {
        "disabled": true,
        "name": "WhatsApp",
        "options": {
            "allowImages": true
        },
        "type": "WhatsApp"
    }
}

Messages

Adds a Message.

POST https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)

Body parameter

The Message.

Name : message
Flags : required
Type : CM.Platform.Messages.Models.ApiMessageRequest

Responses

HTTP Code Description Schema
201 Created CM.Platform.Messages.Models.ApiMessageResponse

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages
Request body
{
  "body" : "test",
  "channels" : ["SMS"] ,
  "countrySpecificSenders" : {
    "NL" : "CM.com"
  },
  "ignoreUnsubscribes" : false,
  "name" : "My Test Message",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "1" : "Data is only allowed when using msisdn"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "+3163710000"
  } ],
  "recurrence" : "not yet implemented",
  "scheduledAtUtc" : "2019-01-11T13:15",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "CM.com" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "currently not available" ],
      "startTime" : "currently not available",
      "endTime" : "currently not available"
    } ],
    "until" : "2019-01-12T13:15"
  }
}

Example HTTP response

Response 201
{
  "id" : "00000000-0000-0000-0000-000000000000",
  "analytics" : {
    "accepted" : 0,
    "converted" : 0,
    "delivered" : 0,
    "euroPrice" : 0.0,
    "failed" : 0,
    "localCurrency" : "string",
    "localPrice" : 0.0,
    "optedOut" : 0,
    "recipients" : 0,
    "test" : 0
  },
  "body" : "string",
  "channels" : ["SMS"] ,
  "countrySpecificSenders" : {
    "string" : "string"
  },
  "ignoreUnsubscribes" : false,
  "name" : "string",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "string" : "string"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "string"
  } ],
  "recurrence" : "string",
  "scheduledAtUtc" : "string",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "string" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "string" ],
      "startTime" : "string",
      "endTime" : "string"
    } ],
    "until" : "string"
  },
  "status" : "string",
  "createdAtUtc" : "string",
  "createdBy" : "00000000-0000-0000-0000-000000000000"
}

Gets Messages paged.

GET https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages

Parameters

Type Name Description Schema
Path accountId
required
The account id. string (uuid)
Query orderby
optional
Column names (date, price, recipients, name) to order messages. add desc to
order descending (ex: date desc)
< string > array(multi)
Query skip
optional
The skip. integer (int32)
Query status
optional
Message status id. string
Query take
optional
The take. integer (int32)

Responses

HTTP Code Description Schema
200 OK < CM.Platform.Messages.Models.ApiMessageResponse > array

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages

Example HTTP response

Response 200
[ {
  "id" : "00000000-0000-0000-0000-000000000000",
  "analytics" : {
    "accepted" : 0,
    "converted" : 0,
    "delivered" : 0,
    "euroPrice" : 0.0,
    "failed" : 0,
    "localCurrency" : "string",
    "localPrice" : 0.0,
    "optedOut" : 0,
    "recipients" : 0,
    "test" : 0
  },
  "body" : "string",
  "channels" : ["SMS"] ,
  "countrySpecificSenders" : {
    "string" : "string"
  },
  "ignoreUnsubscribes" : true,
  "name" : "string",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "string" : "string"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "string"
  } ],
  "recurrence" : "string",
  "scheduledAtUtc" : "string",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "string" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "string" ],
      "startTime" : "string",
      "endTime" : "string"
    } ],
    "until" : "string"
  },
  "status" : "string",
  "tariff" : 0,
  "createdAtUtc" : "string",
  "createdBy" : "00000000-0000-0000-0000-000000000000"
} ]

Deletes multiple Messages.

DELETE https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Query messageIds
optional
The identifier. < string (uuid) > array(multi)

Responses

HTTP Code Description Schema
204 NoContent No Content

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages

Search messages with specified terms.

GET https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages/search/{term}

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path term
required
The search terms string
Query skip
optional
The skip. integer (int32)
Query take
optional
The take. integer (int32)

Responses

HTTP Code Description Schema
200 OK < CM.Platform.Messages.Models.ApiMessageResponse > array

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages/search/searchterm

Example HTTP response

Response 200
[ {
  "id" : "00000000-0000-0000-0000-000000000000",
  "analytics" : {
    "accepted" : 0,
    "converted" : 0,
    "delivered" : 0,
    "euroPrice" : 0.0,
    "failed" : 0,
    "localCurrency" : "string",
    "localPrice" : 0.0,
    "optedOut" : 0,
    "recipients" : 0,
    "test" : 0
  },
  "body" : "string",
  "channels" : ["SMS"] ,
  "countrySpecificSenders" : {
    "string" : "string"
  },
  "ignoreUnsubscribes" : true,
  "name" : "string",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "string" : "string"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "string"
  } ],
  "recurrence" : "string",
  "scheduledAtUtc" : "string",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "string" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "string" ],
      "startTime" : "string",
      "endTime" : "string"
    } ],
    "until" : "string"
  },
  "status" : "string",
  "createdAtUtc" : "string",
  "createdBy" : "00000000-0000-0000-0000-000000000000"
} ]

Gets a Message by id.

GET https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages/{messageId}

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path messageId
required
The identifier. string (uuid)

Responses

HTTP Code Description Schema
200 OK CM.Platform.Messages.Models.ApiMessageResponse

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000

Example HTTP response

Response 200
{
  "id" : "00000000-0000-0000-0000-000000000000",
  "analytics" : {
    "accepted" : 0,
    "converted" : 0,
    "delivered" : 0,
    "euroPrice" : 0.0,
    "failed" : 0,
    "localCurrency" : "string",
    "localPrice" : 0.0,
    "optedOut" : 0,
    "recipients" : 0,
    "test" : 0
  },
  "body" : "string",
  "channels" : ["SMS"] ,
  "countrySpecificSenders" : {
    "string" : "string"
  },
  "ignoreUnsubscribes" : true,
  "name" : "string",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "string" : "string"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "string"
  } ],
  "recurrence" : "string",
  "scheduledAtUtc" : "string",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "string" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "string" ],
      "startTime" : "string",
      "endTime" : "string"
    } ],
    "until" : "string"
  },
  "status" : "string",
  "createdAtUtc" : "string",
  "createdBy" : "00000000-0000-0000-0000-000000000000"
}

Updates a Message.

PUT https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages/{messageId}

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path messageId
required
The identifier. string (uuid)

Body parameter

The Message.

Name : message
Flags : required
Type : CM.Platform.Messages.Models.ApiMessageRequest

Responses

HTTP Code Description Schema
200 OK CM.Platform.Messages.Models.ApiMessageResponse

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000
Request body
{
  "body" : "string",
  "channels" : ["SMS"] ,
  "countrySpecificSenders" : {
    "string" : "string"
  },
  "ignoreUnsubscribes" : true,
  "name" : "string",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "string" : "string"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "string"
  } ],
  "recurrence" : "string",
  "scheduledAtUtc" : "string",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "string" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "string" ],
      "startTime" : "string",
      "endTime" : "string"
    } ],
    "until" : "string"
  },
  "status" : "string"
}

Example HTTP response

Response 200
{
  "id" : "00000000-0000-0000-0000-000000000000",
  "analytics" : {
    "accepted" : 0,
    "converted" : 0,
    "delivered" : 0,
    "euroPrice" : 0.0,
    "failed" : 0,
    "localCurrency" : "string",
    "localPrice" : 0.0,
    "optedOut" : 0,
    "recipients" : 0,
    "test" : 0
  },
  "body" : "string",
  "channels" : ["SMS"] ,
  "countrySpecificSenders" : {
    "string" : "string"
  },
  "ignoreUnsubscribes" : true,
  "name" : "string",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "string" : "string"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "string"
  } ],
  "recurrence" : "string",
  "scheduledAtUtc" : "string",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "string" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "string" ],
      "startTime" : "string",
      "endTime" : "string"
    } ],
    "until" : "string"
  },
  "status" : "string",
  "createdAtUtc" : "string",
  "createdBy" : "00000000-0000-0000-0000-000000000000"
}

Deletes a Message.

DELETE https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages/{messageId}

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path messageId
required
The identifier. string (uuid)

Responses

HTTP Code Description Schema
204 NoContent No Content

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000

Cancels a message, prevents the delivery of the remaining messages.

POST https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages/{messageId}/cancel

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path messageId
required
The identifier. string (uuid)

Responses

HTTP Code Description Schema
200 OK CM.Platform.Messages.Models.ApiMessageResponse

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000/cancel

Example HTTP response

Response 200
{
  "id" : "00000000-0000-0000-0000-000000000000",
  "analytics" : {
    "accepted" : 0,
    "converted" : 0,
    "delivered" : 0,
    "euroPrice" : 0.0,
    "failed" : 0,
    "localCurrency" : "string",
    "localPrice" : 0.0,
    "optedOut" : 0,
    "recipients" : 0,
    "test" : 0
  },
  "body" : "string",
  "channels" : ["SMS"] ,
  "countrySpecificSenders" : {
    "string" : "string"
  },
  "ignoreUnsubscribes" : true,
  "name" : "string",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "string" : "string"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "string"
  } ],
  "recurrence" : "string",
  "scheduledAtUtc" : "string",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "string" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "string" ],
      "startTime" : "string",
      "endTime" : "string"
    } ],
    "until" : "string"
  },
  "status" : "string",
  "createdAtUtc" : "string",
  "createdBy" : "00000000-0000-0000-0000-000000000000"
}

Gets cost estimation for specified message

GET https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages/{messageId}/cost

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path messageId
required
The group ids to fetch string (uuid)

Responses

HTTP Code Description Schema
200 OK CM.Platform.Messages.Models.ApiMessageCost

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000/cost

Example HTTP response

Response 200
{
  "countryCosts" : [ {
    "cost" : 0.0,
    "countryCode" : "string",
    "messageCount" : 0,
    "recipientCount" : 0,
    "isMultipart" : false
  } ],
  "currency" : "string",
  "messageCount" : 0,
  "recipientCount" : 0,
  "isMultipart" : false,
  "totalCost" : 0.0
}

Duplicates a Message and returns the new message.

POST https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages/{messageId}/duplicate

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path messageId
required
The identifier. string (uuid)
Query duplicateAs
required
Specifies if message should be duplicated as a template or a draft. string

Responses

HTTP Code Description Schema
200 OK CM.Platform.Messages.Models.ApiMessageResponse

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000/duplicate?duplicateAs=template

Example HTTP response

Response 200
{
  "id" : "00000000-0000-0000-0000-000000000000",
  "analytics" : {
    "accepted" : 0,
    "converted" : 0,
    "delivered" : 0,
    "euroPrice" : 0.0,
    "failed" : 0,
    "localCurrency" : "string",
    "localPrice" : 0.0,
    "optedOut" : 0,
    "recipients" : 0,
    "test" : 0
  },
  "body" : "string",
  "channels" :  ["SMS"] ,
  "countrySpecificSenders" : {
    "string" : "string"
  },
  "ignoreUnsubscribes" : true,
  "name" : "string",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "string" : "string"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "string"
  } ],
  "recurrence" : "string",
  "scheduledAtUtc" : "string",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "string" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "string" ],
      "startTime" : "string",
      "endTime" : "string"
    } ],
    "until" : "string"
  },
  "status" : "string",
  "createdAtUtc" : "string",
  "createdBy" : "00000000-0000-0000-0000-000000000000"
}

Pause sending a message.

POST https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages/{messageId}/pause

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path messageId
required
The identifier. string (uuid)

Responses

HTTP Code Description Schema
200 OK CM.Platform.Messages.Models.ApiMessageResponse

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000/pause

Example HTTP response

Response 200
{
  "id" : "00000000-0000-0000-0000-000000000000",
  "analytics" : {
    "accepted" : 0,
    "converted" : 0,
    "delivered" : 0,
    "euroPrice" : 0.0,
    "failed" : 0,
    "localCurrency" : "string",
    "localPrice" : 0.0,
    "optedOut" : 0,
    "recipients" : 0,
    "test" : 0
  },
  "body" : "string",
  "channels" :  ["SMS"] ,
  "countrySpecificSenders" : {
    "string" : "string"
  },
  "ignoreUnsubscribes" : true,
  "name" : "string",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "string" : "string"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "string"
  } ],
  "recurrence" : "string",
  "scheduledAtUtc" : "string",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "string" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "string" ],
      "startTime" : "string",
      "endTime" : "string"
    } ],
    "until" : "string"
  },
  "status" : "string",
  "createdAtUtc" : "string",
  "createdBy" : "00000000-0000-0000-0000-000000000000"
}

Resume sending a message.

POST https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages/{messageId}/resume

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path messageId
required
The identifier. string (uuid)

Responses

HTTP Code Description Schema
200 OK CM.Platform.Messages.Models.ApiMessageResponse

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000/resume

Example HTTP response

Response 200
{
  "id" : "00000000-0000-0000-0000-000000000000",
  "analytics" : {
    "accepted" : 0,
    "converted" : 0,
    "delivered" : 0,
    "euroPrice" : 0.0,
    "failed" : 0,
    "localCurrency" : "string",
    "localPrice" : 0.0,
    "optedOut" : 0,
    "recipients" : 0,
    "test" : 0
  },
  "body" : "string",
  "channels" :  ["SMS"] ,
  "countrySpecificSenders" : {
    "string" : "string"
  },
  "ignoreUnsubscribes" : true,
  "name" : "string",
  "recipients" : [ {
    "contact" : "00000000-0000-0000-0000-000000000000",
    "data" : {
      "string" : "string"
    },
    "group" : "00000000-0000-0000-0000-000000000000",
    "msisdn" : "string"
  } ],
  "recurrence" : "string",
  "scheduledAtUtc" : "string",
  "senderPreset" : "00000000-0000-0000-0000-000000000000",
  "senders" : [ "string" ],
  "spread" : {
    "timeFrames" : [ {
      "days" : [ "string" ],
      "startTime" : "string",
      "endTime" : "string"
    } ],
    "until" : "string"
  },
  "status" : "string",
  "createdAtUtc" : "string",
  "createdBy" : "00000000-0000-0000-0000-000000000000"
}

Sends a test message.

POST https://api.cmtelecom.com/messages/v1/accounts/{accountId}/messages/{messageId}/test

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path messageId
required
The identifier. string (uuid)

Body parameter

The test message recipients.

Name : recipients
Flags : required
Type : < CM.Platform.Messages.Models.ApiRecipient > array

Responses

HTTP Code Description Schema
200 OK No Content

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000/test
Request body
[ {
  "data" : {
    "1" : "firstname"
  },
  "msisdn" : "+3163710000"
} ]

Senders

Adds a Sender.

POST https://api.cmtelecom.com/messages/v1/accounts/{accountId}/senders

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)

Body parameter

The sender.

Name : sender
Flags : required
Type : CM.Platform.Messages.Models.ApiSenderPresetRequest

Responses

HTTP Code Description Schema
201 Created CM.Platform.Messages.Models.ApiSenderPresetResponse

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/senders
Request body
{
  "isFavorite" : true,
  "name" : "string",
  "senders" : {
    "string" : "string"
  }
}

Example HTTP response

Response 201
{
  "id" : "00000000-0000-0000-0000-000000000000",
  "isFavorite" : true,
  "name" : "string",
  "senders" : {
    "string" : "string"
  }
}

Gets senders.

GET https://api.cmtelecom.com/messages/v1/accounts/{accountId}/senders

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)

Responses

HTTP Code Description Schema
200 OK < CM.Platform.Messages.Models.ApiSenderPresetResponse > array

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/string/senders

Example HTTP response

Response 200
[ {
  "id" : "00000000-0000-0000-0000-000000000000",
  "isFavorite" : true,
  "name" : "string",
  "senders" : {
    "string" : "string"
  }
} ]

Updates a Sender.

PUT https://api.cmtelecom.com/messages/v1/accounts/{accountId}/senders/{senderId}

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path senderId
required
The identifier. string (uuid)

Body parameter

The sender.

Name : senderPreset
Flags : required
Type : CM.Platform.Messages.Models.ApiSenderPresetRequest

Responses

HTTP Code Description Schema
200 OK CM.Platform.Messages.Models.ApiSenderPresetResponse

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/senders/00000000-0000-0000-0000-000000000000
Request body
{
  "isFavorite" : true,
  "name" : "string",
  "senders" : {
    "string" : "string"
  }
}

Example HTTP response

Response 200
{
  "id" : "00000000-0000-0000-0000-000000000000",
  "isFavorite" : true,
  "name" : "string",
  "senders" : {
    "string" : "string"
  }
}

Deletes a Sender.

DELETE https://api.cmtelecom.com/messages/v1/accounts/{accountId}/senders/{senderId}

Parameters

Type Name Description Schema
Path accountId
required
The accountId. string (uuid)
Path senderId
required
The identifier. string (uuid)

Responses

HTTP Code Description Schema
204 NoContent No Content

Example HTTP request

Request path
https://api.cmtelecom.com/messages/v1/accounts/00000000-0000-0000-0000-000000000000/senders/00000000-0000-0000-0000-000000000000

Model Definitions

CM.Common.Web.Api.Shared.ActionResults.PaginatedResult[CM.Platform.Messages.Models.ApiMessageResponse]

Returns a paginated result set, setting X-CM-PAGINATION-xxx headers on the response.

Name Description Schema
Content
optional
read-only
Gets the content value to negotiate and format in the entity body.
Example : [ "[cm-platform-messages-models-apimessageresponse](#cm-platform-messages-models-apimessageresponse)" ]
< CM.Platform.Messages.Models.ApiMessageResponse > array
ContentNegotiator
optional
read-only
Gets the content negotiator to handle content negotiation.
Example : "[system-net-http-formatting-icontentnegotiator](#system-net-http-formatting-icontentnegotiator)"
System.Net.Http.Formatting.IContentNegotiator
Formatters
optional
read-only
Gets the formatters to use to negotiate and format the content.
Example : [ "[system-net-http-formatting-mediatypeformatter](#system-net-http-formatting-mediatypeformatter)" ]
< System.Net.Http.Formatting.MediaTypeFormatter > array
Request
optional
read-only
Gets the request message which led to this result.
Example : "object"
object

CM.Platform.Messages.Models.ApiChannelInfo

Name Description Schema
disabled
optional
Example : true boolean
name
optional
Example : "string" string
options
optional
Example : {<br> "string" : "object"<br>} < string, object > map
type
optional
Example : "string" string

CM.Platform.Messages.Models.ApiCountryCost

Container for the message cost per country

Name Description Schema
cost
optional
Gets or sets the cost of the messages for country.
Example : 0.0
number (double)
countryCode
optional
Gets or sets the country code.
Example : "string"
string
isMultipart
optional
Gets or sets if there are Multipart messages
Example : true
boolean
messageCount
optional
Gets or sets the count of the messages for country.
Example : 0
integer (int32)
recipientCount
optional
Gets or sets the count of the recipient for country.
Example : 0
integer (int32)

CM.Platform.Messages.Models.ApiMessageAnalytics

The message analytics model.

Name Description Schema
accepted
optional
Gets or sets the accepted.
Example : 0
integer (int32)
converted
optional
Gets or sets the converted.
Example : 0
integer (int32)
delivered
optional
Gets or sets the delivered.
Example : 0
integer (int32)
euroPrice
optional
Gets or sets the euroPrice.
Example : 0.0
number (double)
failed
optional
Gets or sets the failed.
Example : 0
integer (int32)
localCurrency
optional
Gets or sets the localCurrency.
Example : "string"
string
localPrice
optional
Gets or sets the localPrice.
Example : 0.0
number (double)
optedOut
optional
Gets or sets the optedOut.
Example : 0
integer (int32)
recipients
optional
Gets or sets the recipients.
Example : 0
integer (int32)
test
optional
Gets or sets test message count.
Example : 0
integer (int32)

CM.Platform.Messages.Models.ApiMessageCost

Container for the Message cost.

Name Description Schema
countryCosts
optional
Gets or sets the count and cost of the messages per country.
Example : [ "[cm-platform-messages-models-apicountrycost](#cm-platform-messages-models-apicountrycost)" ]
< CM.Platform.Messages.Models.ApiCountryCost > array
currency
optional
Gets or sets the currency.
Example : "string"
string
isMultipart
optional
Gets or sets if there are Multipart messages
Example : true
boolean
messageCount
optional
Gets or sets the count of the messages
Example : 0
integer (int32)
recipientCount
optional
Gets or sets the count of the recipients
Example : 0
integer (int32)
totalCost
optional
Gets or sets the total cost of the message.
Example : 0.0
number (double)

CM.Platform.Messages.Models.ApiMessageRequest

Data model for message requests

Name Description Schema
body
optional
Gets or sets the body.
Example : "string"
string
channels
optional
Gets or sets the channels.
Example : [ "string" ]
< string > array
countrySpecificSenders
optional
Gets or sets the senders.
Example : {<br> "string" : "string"<br>}
< string, string > map
grouping
optional
Gets or sets the grouping.
Example : "string"
string
ignoreUnsubscribes
optional
Gets or sets the ignore unsubscribes setting.
Example : true
boolean
name
optional
Gets or sets the name.
Example : "string"
string
recipients
optional
Gets or sets the recipients.
Example : [ "[cm-platform-messages-models-apirecipient](#cm-platform-messages-models-apirecipient)" ]
< CM.Platform.Messages.Models.ApiRecipient > array
recurrence
optional
Gets or sets the recurring interval.
Example : "string"
string
richContent
optional
Gets or sets the recurring interval.
Example : "[cm-platform-messages-models-richcontent](#cm-platform-messages-models-richcontent)"
CM.Platform.Messages.Models.RichContent
scheduledAtUtc
optional
Gets or sets the process at utc.
Example : "string"
string (date-time)
senderPreset
optional
Gets or sets the sender preset id.
Example : "00000000-0000-0000-0000-000000000000"
string (uuid)
senders
optional
Gets or sets the sender.
Example : [ "string" ]
< string > array
spread
optional
Gets or sets the spread settings.
Example : "[cm-platform-messages-models-apispreadsettings](#cm-platform-messages-models-apispreadsettings)"
CM.Platform.Messages.Models.ApiSpreadSettings
status
optional
Gets or sets the status.
Example : "string"
string
tariff
optional
Gets or sets the tariff.
Example : 0
integer (int32)

CM.Platform.Messages.Models.ApiMessageResponse

Data model for message response

Name Description Schema
analytics
optional
Gets or sets the message analytics.
Example : "[cm-platform-messages-models-apimessageanalytics](#cm-platform-messages-models-apimessageanalytics)"
CM.Platform.Messages.Models.ApiMessageAnalytics
body
optional
Gets or sets the body.
Example : "string"
string
channels
optional
Gets or sets the channels.
Example : [ "string" ]
< string > array
countrySpecificSenders
optional
Gets or sets the senders.
Example : {<br> "string" : "string"<br>}
< string, string > map
createdAtUtc
optional
Gets or sets the created at utc.
Example : "string"
string (date-time)
createdBy
optional
Gets or sets the created by.
Example : "00000000-0000-0000-0000-000000000000"
string (uuid)
grouping
optional
Gets or sets the grouping.
Example : "string"
string
id
optional
Gets the id.
Example : "00000000-0000-0000-0000-000000000000"
string (uuid)
ignoreUnsubscribes
optional
Gets or sets the ignore unsubscribes setting.
Example : true
boolean
name
optional
Gets or sets the name.
Example : "string"
string
recipients
optional
Gets or sets the recipients.
Example : [ "[cm-platform-messages-models-apirecipient](#cm-platform-messages-models-apirecipient)" ]
< CM.Platform.Messages.Models.ApiRecipient > array
recurrence
optional
Gets or sets the recurring interval.
Example : "string"
string
richContent
optional
Gets or sets the recurring interval.
Example : "[cm-platform-messages-models-richcontent](#cm-platform-messages-models-richcontent)"
CM.Platform.Messages.Models.RichContent
scheduledAtUtc
optional
Gets or sets the process at utc.
Example : "string"
string (date-time)
senderPreset
optional
Gets or sets the sender preset id.
Example : "00000000-0000-0000-0000-000000000000"
string (uuid)
senders
optional
Gets or sets the sender.
Example : [ "string" ]
< string > array
spread
optional
Gets or sets the spread settings.
Example : "[cm-platform-messages-models-apispreadsettings](#cm-platform-messages-models-apispreadsettings)"
CM.Platform.Messages.Models.ApiSpreadSettings
status
optional
Gets or sets the status.
Example : "string"
string
tariff
optional
Gets or sets the tariff.
Example : 0
integer (int32)

CM.Platform.Messages.Models.ApiRecipient

Basic model for message recipients

Name Description Schema
contact
optional
Gets or sets the contactId.
Example : "00000000-0000-0000-0000-000000000000"
string (uuid)
data
optional
Gets or sets the json data for recipient.
Example : {<br> "string" : "string"<br>}
< string, string > map
group
optional
Gets or sets the groupId.
Example : "00000000-0000-0000-0000-000000000000"
string (uuid)
msisdn
optional
Gets or sets the msisdn.
Example : "string"
string

CM.Platform.Messages.Models.ApiSenderPresetRequest

Data model for Senders Preset Requests

Name Description Schema
isFavorite
optional
Gets or sets the isFavorite.
Example : true
boolean
name
optional
Gets or sets the name.
Example : "string"
string
senders
optional
Gets or sets the senders.
Example : {<br> "string" : "string"<br>}
< string, string > map

CM.Platform.Messages.Models.ApiSenderPresetResponse

Data model for Senders Preset Responses

Name Description Schema
id
optional
Gets or sets the id.
Example : "00000000-0000-0000-0000-000000000000"
string (uuid)
isFavorite
optional
Gets or sets the isFavorite.
Example : true
boolean
name
optional
Gets or sets the name.
Example : "string"
string
senders
optional
Gets or sets the senders.
Example : {<br> "string" : "string"<br>}
< string, string > map

CM.Platform.Messages.Models.ApiSpreadSettings

Model for Spread settings

Name Description Schema
timeFrames
optional
Gets or sets the spread amount.
Example : [ "[cm-platform-messages-models-apitimeframe](#cm-platform-messages-models-apitimeframe)" ]
< CM.Platform.Messages.Models.ApiTimeFrame > array
until
optional
Gets or sets the time messages will be spread until.
Example : "string"
string (date-time)

CM.Platform.Messages.Models.ApiTimeFrame

Model for Spread TimeFrame setting

Name Description Schema
days
optional
Gets or sets the allowed days.
Example : [ "string" ]
< string > array
endTime
optional
Gets or sets the time send window ends.
Example : "string"
string
startTime
optional
Gets or sets the time send window starts.
Example : "string"
string

CM.Platform.Messages.Models.Conversation

Name Description Schema
media
optional
Example : "[cm-platform-messages-models-media](#cm-platform-messages-models-media)" CM.Platform.Messages.Models.Media
text
optional
Example : "string" string

CM.Platform.Messages.Models.Media

Name Description Schema
mediaName
optional
Example : "string" string
mediaUri
optional
Example : "string" string
mimeType
optional
Example : "string" string

CM.Platform.Messages.Models.RichContent

Name Description Schema
conversation
optional
Example : [ "[cm-platform-messages-models-conversation](#cm-platform-messages-models-conversation)" ] < CM.Platform.Messages.Models.Conversation > array