Inbox Messages

  1. List Messages
  2. Get a single Message
  3. Create a new Message
  4. Update a Conversation

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 conversation 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

Creates a Conversation.

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 Conversation

Returns an updated conversation 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": {
  }
}