Messages

Available methods

All available methods for resource message.

HTTP method Endpoint Description
[badge-blue GET] /messages Get information about all messages
[badge-blue GET] /messages/{message_id} Get information about an message

Available methods with sub-resources

All available methods for sub-resources of resource message.

HTTP method Endpoint Description
[badge-blue GET] /messages/{message_id}/detail Get a message detail with customer data

Actions

Action methods for send message to customer.

HTTP method Endpoint Description
[badge-green POST] /messages/actions/send-message Send message to an customer.

Action methods are available only in Enterprise interface.


Get all messages

Get information about messages as a list.
[badge-blue GET] /messages

Query string

Parameter name Type Description Mandatory (Yes/No)
count integer The number of records to return.
Default value is 100.
No
offset integer The number of records from a collection to skip.
Default value is 0.
No
sort_field string One of the query string parameters for sorting.
Response is sorted by the specified field.
No
sort_direction string Direction of sorting the response list.
Possible values are: ASC / DESC
No
customer_id string The unique ID of the customer No
contact string Email of phone number that was used as a contact in message No
communication_channel_id string The unique id of the communication channel.
Possible values are: 1 - email / 2- SMS / 4 - PUSH notification (Apple or Google)/ 5 - internal system notification
No
send_time_from string Start date and time of the time interval
YYYY-MM-DD HH:MM:SS
No
send_time_to string End date and time of the time interval
YYYY-MM-DD HH:MM:SS
No

Response

Status code: 200 OK
Output structure : object

Parameter name Type Description
messages Message[] List of all messages
total_items integer Count of all found messages

Example Request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/messages?contact=happy_customer@crmcarecloud.com&count=5
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZV9pbnRlcmZhY2U6MzUyYjM2MThmODNkMmY0NmZlYmUwOTcwZTFiMDFhYWFiOTZiMTc2MjZhNzkzNTNjYTE3ZmUwZDQ4NTE5YzJkZg==

Example response

HTTP/1.1 200 OK
Date: Fri, 14 Aug 2020 09:36:23 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "messages": [
      {
        "message_id": "89ce2a1b9b01f5c939fb1e20cd",
        "status": 1,
        "message_template_id": "8cbb5886e1d68e07a6e0e393a0",
        "customer_id": null,
        "contact": "happy_customer@crmcarecloud.com",
        "title": "Newletter no. 30",
        "send_time": "2015-01-05 11:24:12",
        "opened_time": null,
        "mail_client_user_agent": null,
        "mail_client_language": null,
        "communication_channel_id": 1,
        "message_data": [],
        "last_change": "2015-01-05 11:24:12"
      },
      {
        "message_id": "8bc8ca16f9c5039951021700a2",
        "status": 1,
        "message_template_id": "8cbb5886e1d68e07a6e0e393a0",
        "customer_id": null,
        "contact": "happy_customer@crmcarecloud.com",
        "title": "Newletter no 29.",
        "send_time": "2015-01-05 11:31:12",
        "opened_time": null,
        "mail_client_user_agent": null,
        "mail_client_language": null,
        "communication_channel_id": 1,
        "message_data": [],
        "last_change": "2015-01-05 11:31:12"
      },
      {
        "message_id": "80cb4f1e9353dc4b814cebcdfe",
        "status": 1,
        "message_template_id": "8cbb5886e1d68e07a6e0e393a0",
        "customer_id": null,
        "contact": "happy_customer@crmcarecloud.com",
        "title": "Newletter no 31",
        "send_time": "2015-01-05 13:37:52",
        "opened_time": null,
        "mail_client_user_agent": null,
        "mail_client_language": null,
        "communication_channel_id": 1,
        "message_data": [],
        "last_change": "2015-01-05 13:37:52"
      }
    ],
    "total_items": 17
  }
}


Get a message

Get information about a specific message
[badge-blue GET] /messages/{message_id}

Path parameters

Parameter name Type Description
message_id string The unique id of the message

Response

Status code: 200 OK
Output structure : Message

Example Request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/messages/89ce2a1b9b01f5c939fb1e20cd
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzyYjM2McwZTFiMDFhYWFiOTZiMTc2MjZhNzkzNTNjYTE3ZmUwZDQ4NTE5YzJkZg==

Example response

HTTP/1.1 200 OK
Date: Fri, 14 Aug 2020 09:37:34 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "message_id": "89ce2a1b9b01f5c939fb1e20cd",
    "status": 1,
    "message_template_id": "8cbb5886e1d68e07a6e0e393a0",
    "customer_id": null,
    "contact": "happy_customer@crmcarecloud.com",
    "title": "Newletter",
    "send_time": "2015-01-05 11:24:12",
    "opened_time": null,
    "mail_client_user_agent": null,
    "mail_client_language": null,
    "communication_channel_id": 1,
    "message_data": [],
    "last_change": "2015-01-05 11:24:12"
  }
}


Send message

Send message (email, SMS or PUSH notification) to customer
[badge-green POST] /messages/actions/send-message

Request

Parameter name Type Description Mandatory (Yes/No)
message Message Message that will be send to customer Yes

Response

Status code: 204 No Content

Example Request

POST https://<projectURL>/rest-api/enterprise-interface/v1.0/messages/actions/send-message
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZV9pbnRlcmZhY2U6MzUyYjMZTFiMDFhYWFiOTZiMTc2MjZhNzkzNTNjYTE3ZmUwZDQ4NTE5YzJkZg==

{
 "message" : {
   "message_template_id" : "8cbb5886e1d68e07a6e0e393a0",
   "customer_id" : "83cb49bbef7be335eceee30b7c",
   "communication_channel_id" : "1",
   "title" : "customer message"
 }
}

Example response

HTTP/1.1 204 No Content
Date: Fri, 14 Aug 2020 09:41:52 GMT
Content-Type: application/json; charset=utf-8

<Response body is empty>