Inbox Messages
Overview
This resource represents Inbox Messages sent in the Inbox Conversations.
Parameters
- OAuth Scopes:
- inbox_read
- inbox_write
Name | Type | Read/Write | Description |
---|---|---|---|
attachments | Array | Read | Attachments IDs related to Message |
conversation | Integer | Read | Conversation's ID to which Message belongs to |
sender | Integer | Read | Sender's ID (Inbox Participant) to which Message is related to |
account | Integer | Read | Account's ID to which Message is related to |
created_by_id | Integer | Read | ID of the resource that created the Message (User or Application - this is a polymorphic association) |
created_by_type | String | Read | Type of the resource that created the Message (User or Application - this is a polymorphic association) |
id | Integer | Read | Message's ID. |
channel | String | Read | Message's channel, list of Channels described in enums section |
content | Text | Read | Message's content. |
origin | String | Read | Message's origin, list of Origins described in enums section |
visibility | String | Read | Message's visibility, list of Visibilities described in enums section |
created_at | Time | Read | Message's create time. |
updated_at | Time | Read | Message's update time. |
sent_at | Time | Read | Time when Message was sent. |
Name | Type | Read/Write | Description | Constraints |
---|---|---|---|---|
attachments | Array | Read | Attachments IDs related to Message | |
conversation | Integer | Read | Conversation's ID to which Message belongs to | |
sender | Integer | Read | Sender's ID (Inbox Participant) to which Message is related to | |
account | Integer | Read | Account's ID (Inbox Participant) to which Message is related to | |
created_by_id | Integer | Read | ID of the resource that created the Message (User or Application - this is a polymorphic association) | |
created_by_type | String | Read | Type of the resource that created the Message (User or Application - this is a polymorphic association) | |
id | Integer | Read | Message's id. | |
conversation_id | String | Write | Message's Conversation ID. | Required |
sender_id | String | Write | Message's Sender ID (Inbox Participant). | Required |
attachment_ids | Array | Write | Message's Attachments IDs. | |
channel | String | Read/Write | Message's channel, list of Channels described in enums section | Must be one of Channels if present |
content | String | Read/Write | Message's content. | Required |
origin | String | Read/Write | Message's origin, list of Origins described in enums section | Required, Must be one of Origins |
visibility | String | Read/Write | Message's visibility, list of Visibilities described in enums section | Required, Must be one of Visibilities, internal cannot be used for Client Participants or when channel is present |
created_at | Time | Read | Message's create time. | |
updated_at | Time | Read | Message's update time. | |
sent_at | Time | Read/Write | Time when Message was sent. | Required |
List Messages
GET /inbox/messages
- OAuth Scopes:
- inbox_read / inbox_write
response.json
{
"links": {
"messages.attachments": "https://www.bookingsync.com/api/v3/inbox/attachments/{messages.attachments}",
"messages.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{messages.conversation}",
"messages.sender": "https://www.bookingsync.com/api/v3/inbox/participants/{messages.sender}"
},
"messages": [
{
"links": {
"attachments": [],
"conversation": 7,
"sender": 5
},
"channel": null,
"content": "Some content.",
"created_at": "2018-12-21T09:21:52Z",
"id": 5,
"origin": "email",
"sent_at": null,
"updated_at": "2018-12-21T09:21:52Z",
"visibility": "external"
}
],
"meta": {}
}
Get a single Message
Returns a single message identified by ID.
GET /inbox/messages/:message_id
- OAuth Scopes:
- inbox_read / inbox_write
response.json
{
"links": {
"messages.attachments": "https://www.bookingsync.com/api/v3/inbox/attachments/{messages.attachments}",
"messages.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{messages.conversation}",
"messages.sender": "https://www.bookingsync.com/api/v3/inbox/participants/{messages.sender}"
},
"messages": [
{
"links": {
"attachments": [],
"conversation": 7,
"sender": 5
},
"channel": null,
"content": "Some content.",
"created_at": "2018-12-21T09:21:52Z",
"id": 5,
"origin": "email",
"sent_at": null,
"updated_at": "2018-12-21T09:21:52Z",
"visibility": "external"
}
],
"meta": {}
}
Create a new Message
Returns a created message identified by ID.
POST /inbox/messages
- OAuth Scopes:
- inbox_write
request.json
{
"messages": [
{
"content": "Message Content",
"origin": "email",
"visibility": "external",
"conversation_id": 7,
"sender_id": 5,
"channel": "email",
"sent_at": "2018-12-21T09:21:52Z",
"attachment_ids": [
1,
3,
6
]
}
]
}
response.json
{
"links": {
"messages.attachments": "https://www.bookingsync.com/api/v3/inbox/attachments/{messages.attachments}",
"messages.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{messages.conversation}",
"messages.sender": "https://www.bookingsync.com/api/v3/inbox/participants/{messages.sender}"
},
"messages": [
{
"links": {
"attachments": [],
"conversation": 7,
"sender": 5
},
"channel": "email",
"content": "Message Content",
"created_at": "2018-12-21T09:21:52Z",
"id": 5,
"origin": "email",
"sent_at": "2018-12-21T09:21:52Z",
"updated_at": "2018-12-21T09:21:52Z",
"visibility": "external"
}
],
"meta": {}
}
Update a Message
Returns an updated message identified by ID.
PUT /inbox/messages/:message_id
- OAuth Scopes:
- inbox_write
request.json
{
"messages": [
{
"origin": "email",
"visibility": "external",
"channel": "email",
"attachment_ids": [
1,
3,
6
]
}
]
}
response.json
{
"links": {
"messages.attachments": "https://www.bookingsync.com/api/v3/inbox/attachments/{messages.attachments}",
"messages.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{messages.conversation}",
"messages.sender": "https://www.bookingsync.com/api/v3/inbox/participants/{messages.sender}"
},
"messages": [
{
"links": {
"attachments": [],
"conversation": 7,
"sender": 5
},
"channel": "email",
"content": "Message Content",
"created_at": "2018-12-21T09:21:52Z",
"id": 5,
"origin": "email",
"sent_at": "2018-12-21T09:21:52Z",
"updated_at": "2018-12-21T09:21:52Z",
"visibility": "external"
}
],
"meta": {}
}
Add Attachment to a Message
Returns an updated message identified by ID.
PUT inbox/messages/:id/add_attachment
- OAuth Scopes:
- inbox_write
request.json
{
"attachments": [
{
"id": 5
}
]
}
response.json
{
"links": {
"messages.attachments": "https://www.bookingsync.com/api/v3/inbox/attachments/{messages.attachments}",
"messages.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{messages.conversation}",
"messages.sender": "https://www.bookingsync.com/api/v3/inbox/participants/{messages.sender}"
},
"messages": [
{
"links": {
"attachments": [
5
],
"conversation": 7,
"sender": 5
},
"channel": "email",
"content": "Message Content",
"created_at": "2018-12-21T09:21:52Z",
"id": 5,
"origin": "email",
"sent_at": "2018-12-21T09:21:52Z",
"updated_at": "2018-12-21T09:21:52Z",
"visibility": "external"
}
],
"meta": {}
}