Inbox Messages

  1. Overview
  2. List Messages
  3. Get a single Message
  4. Create a new Message
  5. Update a Message
  6. Add Attachment to a Message

Overview

This resource represents Inbox Messages sent in the Inbox Conversations.

Parameters

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 at.
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 at. Required

List Messages

GET /inbox/messages

Response

{
  "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": [
    {
      "id": 5,
      "channel": null,
      "content": "Some content.",
      "origin": "email",
      "visibility": "external",
      "created_at": "2018-12-21T09:21:52Z",
      "updated_at": "2018-12-21T09:21:52Z",
      "sent_at": null,
      "links": {
        "attachments": [

        ],
        "conversation": 7,
        "sender": 5
      }
    }
  ],
  "meta": {
  }
}

Get a single Message

Returns a single message identified by ID.

GET /inbox/messages/:message_id

Response

{
  "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": [
    {
      "id": 5,
      "channel": null,
      "content": "Some content.",
      "origin": "email",
      "visibility": "external",
      "created_at": "2018-12-21T09:21:52Z",
      "updated_at": "2018-12-21T09:21:52Z",
      "sent_at": null,
      "links": {
        "attachments": [

        ],
        "conversation": 7,
        "sender": 5
      }
    }
  ],
  "meta": {
  }
}

Create a new Message

Returns a created message identified by ID.

POST /inbox/messages

Example JSON request

{
  "messages": [
    {
      "attachment_ids": [
        1,
        3,
        6
      ],
      "channel": "email",
      "content": "Message Content",
      "conversation_id": 7,
      "origin": "email",
      "sender_id": 5,
      "visibility": "external",
      "sent_at": "2018-12-21T09:21:52Z"
    }
  ]
}

Response

{
  "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": [
    {
      "id": 5,
      "channel": "email",
      "content": "Message Content",
      "origin": "email",
      "visibility": "external",
      "created_at": "2018-12-21T09:21:52Z",
      "updated_at": "2018-12-21T09:21:52Z",
      "sent_at": "2018-12-21T09:21:52Z",
      "links": {
        "attachments": [

        ],
        "conversation": 7,
        "sender": 5
      }
    }
  ],
  "meta": {
  }
}

Update a Message

Returns an updated message identified by ID.

PUT /inbox/messages/:message_id

Example JSON request

{
  "messages": [
    {
      "attachment_ids": [
        1,
        3,
        6
      ],
      "channel": "email",
      "origin": "email",
      "visibility": "external"
    }
  ]
}

Response

{
  "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": [
    {
      "id": 5,
      "channel": "email",
      "content": "Message Content",
      "origin": "email",
      "visibility": "external",
      "created_at": "2018-12-21T09:21:52Z",
      "updated_at": "2018-12-21T09:21:52Z",
      "sent_at": "2018-12-21T09:21:52Z",
      "links": {
        "attachments": [

        ],
        "conversation": 7,
        "sender": 5
      }
    }
  ],
  "meta": {
  }
}

Add Attachment to a Message

Returns an updated message identified by ID.

PUT inbox/messages/:id/add_attachment

Example JSON request

{
  "attachments": [
    {
      "id": 5
    }
  ]
}

Response

{
  "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": [
    {
      "id": 5,
      "channel": "email",
      "content": "Message Content",
      "origin": "email",
      "visibility": "external",
      "created_at": "2018-12-21T09:21:52Z",
      "updated_at": "2018-12-21T09:21:52Z",
      "sent_at": "2018-12-21T09:21:52Z",
      "links": {
        "attachments": [
          5
        ],
        "conversation": 7,
        "sender": 5
      }
    }
  ],
  "meta": {
  }
}