Inbox Messages

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

Parameters

Name Type Read/Write Description
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
id Integer Read Message’s id.
conversation_id String Write Message’s conversation id.
sender_id String Write Message’s sender id.
channel String Read/Write Message’s channel, list of Channels described in enums section
content String Read/Write Message’s content.
origin String Read/Write Message’s origin, list of Origins described in enums section
visibility String Read/Write 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/Write Time when Message was sent at.

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": [
    {
      "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": [
    {
      "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": {
  }
}