Messages
Obtain higher security with our messaging system, surpassing the vulnerabilities of email communication over public networks. Messages remain safeguarded and are seamlessly accessed through our REST API, allowing you to retrieve them on demand while upholding the utmost confidentiality.
Flow chart
The diagram below illustrates the information flow encompassing the ITX end user, ITX backend, your backend, and finally, your end user. It is crucial to note that direct communication between our servers and the end user must be avoided. Instead, your backend should manage all authentication processes, bridging interactions between your end user and backend, as well as between your backend and our own backend systems.
Sending messages
Messages are created by sending a multipart/form-data POST request to /rest/itxems/message
. The endpoint accepts two fields in the form: data
and files
. data
is required, must contain JSON and have Content-Type set to application/json. The expected data model is described in the Open API specification.
files
is an optional array of files (0-indexed) which can be used to add both inline and embedded attachments to the message. All embedded images must have a Content-Type that's included in the image/*
content type. For example image/jpeg
.
Embedded images must also be referred to within the body
field.
ITX will substitute all files[x]
origins with direct hyperlinks to our dedicated storage servers. An example of this is src="rest/core/corefile/i/388537"
. To access these resources, proper authentication is required. Consequently, you will need to employ your own backend as a proxy for GET requests, ensuring that authentication is added.
Example:
<img width="100px" src="files[0]" />
Example sending a message (from customer) with 1 embedded image and 1 PDF attachment:
POST <endpoint>/rest/itxems/message
Content-Type: multipart/form-data; boundary=7515efc9e7db416d86cea913c1a949ff
Content-Length: 8642
--7515efc9e7db416d86cea913c1a949ff
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"eeexId": 3378825,
"direction": 2,
"subject": "Jeg har et spørsmål",
"body": "<p>Hei!<br>Kan dere se på dette...?<br>Mvh. ITX<br><img width='100px' src='files[0]'></p>",
"createCase": true
}
--7515efc9e7db416d86cea913c1a949ff
Content-Disposition: form-data; name="files"; filename="itx_logo.png"
Content-Type: image/png
...DATA...
--7515efc9e7db416d86cea913c1a949ff
Content-Disposition: form-data; name="files"; filename="sample.pdf"
Content-Type: application/pdf
...DATA...
--7515efc9e7db416d86cea913c1a949ff--
Supported attributes
Name | Type | Required | Description |
---|---|---|---|
eactId | number | No | Primary identifier of the message. Should be provided when sending / updating message drafts |
conversationEactId | number | No | Primary identifier of the first message in the conversation |
replyToEactId | number | No | Primary identifier of the reply to activity. Should be provided when replying to a specific message |
corpId | number | No | Corporation corpId. Defaults to users selected corporation |
eeexId | number | yes | Entity extension eeexId (customer ID) |
contactEeexId | number | no | Contact person entity extension eeexId (contact person ID) |
direction | number | yes | Message direction. 1 - OUT, or to customer, 2 - IN, or from customer |
subject | string | yes | Message subject |
body | string | yes | HTML message body |
isDraft | boolean | no | Set to true when saving drafts. Drafts should not be delivered to the recipient on the API consumer side |
userId | number | no | Used ID of the message sender/receiver. Must be set when sending drafts created by another user than the executing user |
caseEactId | number | if createCase is false | Case eactId that the message should be connected to |
createCase | boolean | if caseEactId is not set | Automaticly create a new case connected to the sent message. Entity extension eeexId must be set |
caseStatusEmstId | number | no | Status for the case (emstId). Can be used to automaticly close the created case |
caseCategoryCtnoId | number | no | Defined which category (ctnoId) the created case should have |
caseQueueUcquId | number | no | Defined which queue (ucquId) the created case should have |
Retrieving messages
Used to search for messages. Check OpenAPI specification for complete data models
POST <endpoint>/rest/itxems/message/search
Supported attributes:
Attribute | Type | Required | Description |
---|---|---|---|
eactId | number | no | Primary identifier of the message |
conversationEactId | number | no | Primary identifier of the first message in the conversation, so that this id is equal to the eactId for the first message. Must be specified when retrieving messages in a specific conversation. |
corpId | number | no | Corporation |
eeexId | number | no | Entity extension (customer / prospect etc.) |
contactEeexId | number | no | Contact entity extension |
direction | number | no | Message direction. 1 - OUT, or to customer, 2 - IN, or from customer |
isDraft | boolean | no | If set, retrieves only drafts or delivered messages |
userId | number | no | Sender/reciever User |
getConversations | boolean | no | Defines if only first (conversation initating) messages should be retrieved |
getContent | boolean | no | Set to true if to retrieve HTML content |
limitFrom | number | no | Pagination, number of messages to skip from result |
limitTo | number | no | Pagination, page size |
getTotalActivityCount | boolean | no | If set, total found entries will be returned in response header ITX-Total-Found |