The Message object
Property | Type | Description | Editable |
id |
| Vitally's unique ID for the Message | No |
type |
| The type of Message. Inferred from the sender type. | No |
externalId |
| The unique ID of the message in your system | Only on create |
timestamp |
| The ISO-formatted string timestamp of when the message was sent | Yes |
message |
| Required The HTML content of the message. | Yes |
from |
| Required A JSON object describing the sender Participant. | Yes |
to |
| Required An array of JSON objects describing the recipient Participants. | Yes |
cc |
| An array of JSON objects describing the cc recipient Participants. | Yes |
bcc |
| An array of JSON objects describing the bcc recipient Participants. | Yes |
The Participant Object
Property | Type | Description |
type |
|
|
id |
| The unique Vitally ID of the Admin or User |
Replace {subdomain}
in the endpoints below with your Vitally subdomain.
You can find your subdomain in the URL used to log into Vitally (i.e., https://yoursubdomain.vitally.io
Create A Message POST
US Data Center (default):
https://{subdomain}.rest.vitally.io/resources/conversations/:conversationId/messages
EU Data Center:
https://rest.vitally-eu.io/resources/conversations/:conversationId/messages
Request Body
Property | Type | Description |
externalId |
| Required The unique ID of the message in your system |
message |
| Required The HTML content of the message. |
from |
| Required A JSON object describing the sender Participant. |
to |
| Required An array of JSON objects describing the recipient Participants. |
timestamp |
| The ISO-formatted string timestamp of when the message was sent |
cc |
| An array of JSON objects describing the cc recipient Participants. |
bcc |
| An array of JSON objects describing the bcc recipient Participants. |
Participant
Property | Type | Description |
type |
|
|
id |
| The ID of the Admin or User |
Example Request
POST https://{subdomain}.rest.vitally.io/resources/conversations/:id/messages
{
"externalId": "message-1",
"conversationId": "thread-1",
"message": "<p>Hello there</p>",
"timestamp": "2020-12-11T20:16:27.370Z",
"from": {
"type": "admin",
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
},
"to": [
{
"type": "user",
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
]
}
Example Response
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"type": "outbound",
"externalId": "message-1",
"externalUrl": null,
"conversationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"message": "<p>Hello there</p>",
"timestamp": "2020-12-11T20:16:27.370Z",
"from": {
"type": "admin",
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
},
"to": [
{
"type": "user",
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
],
"cc": [],
"bcc": []
}
Get a Message GET
US Data Center (default):
https://{subdomain}.rest.vitally.io/resources/messages/:id
EU Data Center:
https://rest.vitally-eu.io/resources/messages/:id
Request Parameters
Property | Type | Description |
id |
| The message ID assigned by Vitally |
Delete A Message DELETE
US Data Center (default):
https://{subdomain}.rest.vitally.io/resources/messages/:id
EU Data Center:
https://rest.vitally-eu.io/resources/messages/:id
Request Params
Property | Type | Description |
id |
| The message ID assigned by Vitally |