Inbox Conversations

  1. Overview
  2. List Conversations
  3. Get a single Conversation
  4. Create a new Conversation
  5. Update a Conversation
  6. Add Bookings to a Conversation
  7. Remove Bookings from a Conversation

Overview

This resource represents Inbox Conversations - a thread within each Inbox Messages can be created.

Parameters

Name Type Read/Write Description
account Integer Read Account’s ID related to Conversation
assignee (host) Integer Read Assignee’s ID related to Conversation (Host’s ID who is responsible for handling this conversation)
source Integer Read Source’s ID related to Conversation
bookings Array Read Bookings IDs related to Conversation
inquiries Array Read Inquiries IDs related to Conversation
messages Array Read Messages IDs related to Conversation
participants Array Read Participants ID related to Conversation
created_by_id Integer Read ID of the resource that created the Conversation (User or Application - this is a polymorphic association)
created_by_type String Read Type of the resource that created the Conversation (User or Application - this is a polymorphic association)
id Integer Read Conversation’s id.
default_channel String Read Conversation’s default channel, list of Channels described in enums section
subject String Read Conversation’s subject (for email-based Conversations).
created_at Time Read Conversation’s create time.
updated_at Time Read Conversation’s update time.
closed_at Time Read Time when Conversation was closed at.
deadline_response_at Time Read Conversation’s deadline response time.
last_message_at Time Read Conversation’s last message time.
marked_as_spam_at Time Read Time when Conversation was marked as spam.
read_at Time Read Time when conversations was viewed
Name Type Read/Write Description Constraints
account Integer Read Account’s ID related to Conversation  
assignee (host) Integer Read Assignee’s ID related to Conversation (Host’s ID who is responsible for handling this conversation)  
source Integer Read Source’s ID related to Conversation  
bookings Array Read Bookings IDs related to Conversation  
inquiries Array Read Inquiries IDs related to Conversation  
messages Array Read Messages IDs related to Conversation  
participants Array Read Participants ID related to Conversation  
created_by_id Integer Read ID of the resource that created the Conversation (User or Application - this is a polymorphic association)  
created_by_type String Read Type of the resource that created the Conversation (User or Application - this is a polymorphic association)  
id Integer Read Conversation’s id.  
default_channel String Read/Write Conversation’s default channel,list of Channels described in enums section Must be one of the Channels
subject String Read/Write (create-only) Conversation’s subject (for email-based Conversations).  
closed Boolean Write Conversation is closed if set to true.  
source_id Integer Write (create-only) Source id related to the Conversation.  
assignee_id Integer Write Assignee’s ID related to Conversation (Host’s ID who is responsible for handling this conversation)  
closed Boolean Write An attribute for marking Conversation as closed (and will assign closed_at timestamp)  
marked_as_spam Boolean Write An attribute for marking Conversation as spam (and will assign marked_as_spam_at timestamp)  
created_at Time Read Conversation’s create time.  
updated_at Time Read Conversation’s update time.  
closed_at Time Read Time when Converstation was closed at.  
deadline_response_at Time Read/Write (create-only) Conversation’s deadline response time.  
last_message_at Time Read Conversation’s last message time.  
marked_as_spam_at Time Read Time when Conversation was marked as spam.  
read_at Time Read Time when conversations was viewed  

List Conversations

GET /inbox/conversations

Response

{
  "links": {
    "conversations.account": "https://www.bookingsync.com/api/v3/accounts/{conversations.account}",
    "conversations.assignee": "https://www.bookingsync.com/api/v3/hosts/{conversations.assignee}",
    "conversations.bookings": "https://www.bookingsync.com/api/v3/bookings/{conversations.bookings}",
    "conversations.inquiries": "https://www.bookingsync.com/api/v3/inquiries/{conversations.inquiries}",
    "conversations.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{conversations.messages}",
    "conversations.participants": "https://www.bookingsync.com/api/v3/inbox/participants/{conversations.participants}",
    "conversations.source": "https://www.bookingsync.com/api/v3/sources/{conversations.source}"
  },
  "conversations": [
    {
      "id": 5,
      "default_channel": null,
      "subject": "Here goes subject of conversation.",
      "created_at": "2018-12-20T14:25:57Z",
      "updated_at": "2018-12-20T14:25:57Z",
      "closed_at": null,
      "deadline_response_at": null,
      "last_message_at": "2018-11-22T12:19:57Z",
      "marked_as_spam_at": null,
      "read_at": "2018-12-22T14:25:57Z",
      "links": {
        "account": 1,
        "assignee": null,
        "bookings": [

        ],
        "inquiries": [

        ],
        "messages": [

        ],
        "participants": [

        ],
        "source": null
      }
    }
  ],
  "meta": {
  }
}

Get a single Conversation

Returns a single conversation identified by ID.

GET /inbox/conversations/:conversation_id

Response

{
  "links": {
    "conversations.account": "https://www.bookingsync.com/api/v3/accounts/{conversations.account}",
    "conversations.assignee": "https://www.bookingsync.com/api/v3/hosts/{conversations.assignee}",
    "conversations.bookings": "https://www.bookingsync.com/api/v3/bookings/{conversations.bookings}",
    "conversations.inquiries": "https://www.bookingsync.com/api/v3/inquiries/{conversations.inquiries}",
    "conversations.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{conversations.messages}",
    "conversations.participants": "https://www.bookingsync.com/api/v3/inbox/participants/{conversations.participants}",
    "conversations.source": "https://www.bookingsync.com/api/v3/sources/{conversations.source}"
  },
  "conversations": [
    {
      "id": 5,
      "default_channel": null,
      "subject": "Here goes subject of conversation.",
      "created_at": "2018-12-20T14:25:57Z",
      "updated_at": "2018-12-20T14:25:57Z",
      "closed_at": null,
      "deadline_response_at": null,
      "last_message_at": "2018-11-22T12:19:57Z",
      "marked_as_spam_at": null,
      "read_at": "2018-12-22T14:25:57Z",
      "links": {
        "account": 1,
        "assignee": null,
        "bookings": [

        ],
        "inquiries": [

        ],
        "messages": [

        ],
        "participants": [

        ],
        "source": null
      }
    }
  ],
  "meta": {
  }
}

Create a new Conversation

Creates a Conversation.

POST /inbox/conversations

Example JSON request

{
  "conversations": [
    {
      "default_channel": "channelname",
      "subject": "Subject.",
      "last_message_at": "2018-12-20T14:25:57Z"
    }
  ]
}

Response

{
  "links": {
    "conversations.account": "https://www.bookingsync.com/api/v3/accounts/{conversations.account}",
    "conversations.assignee": "https://www.bookingsync.com/api/v3/hosts/{conversations.assignee}",
    "conversations.bookings": "https://www.bookingsync.com/api/v3/bookings/{conversations.bookings}",
    "conversations.inquiries": "https://www.bookingsync.com/api/v3/inquiries/{conversations.inquiries}",
    "conversations.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{conversations.messages}",
    "conversations.participants": "https://www.bookingsync.com/api/v3/inbox/participants/{conversations.participants}",
    "conversations.source": "https://www.bookingsync.com/api/v3/sources/{conversations.source}"
  },
  "conversations": [
    {
      "id": 5,
      "default_channel": "channelname",
      "subject": "Subject.",
      "created_at": "2018-12-20T14:25:57Z",
      "updated_at": "2018-12-20T14:25:57Z",
      "closed_at": null,
      "deadline_response_at": null,
      "last_message_at": "2018-12-20T14:25:57Z",
      "marked_as_spam_at": null,
      "read_at": "2018-12-22T14:25:57Z",
      "links": {
        "account": 1,
        "assignee": null,
        "bookings": [

        ],
        "inquiries": [

        ],
        "messages": [

        ],
        "participants": [

        ],
        "source": null
      }
    }
  ],
  "meta": {
  }
}

Update a Conversation

Returns an updated conversation identified by ID.

PUT /inbox/conversations/:conversation_id

Restrictions on updatable parameters

Only :assignee_id, :closed, :default_channel, :marked_as_spam attributes are allowed.

Example JSON request

{
  "conversations": [
    {
      "default_channel": "channelname"
    }
  ]
}

Response

{
  "links": {
    "conversations.account": "https://www.bookingsync.com/api/v3/accounts/{conversations.account}",
    "conversations.assignee": "https://www.bookingsync.com/api/v3/hosts/{conversations.assignee}",
    "conversations.bookings": "https://www.bookingsync.com/api/v3/bookings/{conversations.bookings}",
    "conversations.inquiries": "https://www.bookingsync.com/api/v3/inquiries/{conversations.inquiries}",
    "conversations.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{conversations.messages}",
    "conversations.participants": "https://www.bookingsync.com/api/v3/inbox/participants/{conversations.participants}",
    "conversations.source": "https://www.bookingsync.com/api/v3/sources/{conversations.source}"
  },
  "conversations": [
    {
      "id": 5,
      "default_channel": "channelname",
      "subject": "Subject.",
      "created_at": "2018-12-20T14:25:57Z",
      "updated_at": "2018-12-20T14:25:57Z",
      "closed_at": null,
      "deadline_response_at": null,
      "last_message_at": "2018-12-20T14:25:57Z",
      "marked_as_spam_at": null,
      "read_at": "2018-12-22T14:25:57Z",
      "links": {
        "account": 1,
        "assignee": null,
        "bookings": [

        ],
        "inquiries": [

        ],
        "messages": [

        ],
        "participants": [

        ],
        "source": null
      }
    }
  ],
  "meta": {
  }
}

Add Bookings to a Conversation

Returns an updated conversation identified by ID.

PUT /inbox/conversations/:conversation_id/connect_booking

Example JSON request

{
  "bookings": [
    {
      "id": 15
    }
  ]
}

Response

{
  "links": {
    "conversations.account": "https://www.bookingsync.com/api/v3/accounts/{conversations.account}",
    "conversations.assignee": "https://www.bookingsync.com/api/v3/hosts/{conversations.assignee}",
    "conversations.bookings": "https://www.bookingsync.com/api/v3/bookings/{conversations.bookings}",
    "conversations.inquiries": "https://www.bookingsync.com/api/v3/inquiries/{conversations.inquiries}",
    "conversations.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{conversations.messages}",
    "conversations.participants": "https://www.bookingsync.com/api/v3/inbox/participants/{conversations.participants}",
    "conversations.source": "https://www.bookingsync.com/api/v3/sources/{conversations.source}"
  },
  "conversations": [
    {
      "id": 5,
      "default_channel": "channelname",
      "subject": "Subject.",
      "created_at": "2018-12-20T14:25:57Z",
      "updated_at": "2018-12-20T14:25:57Z",
      "closed_at": null,
      "deadline_response_at": null,
      "last_message_at": "2018-12-20T14:25:57Z",
      "marked_as_spam_at": null,
      "read_at": "2018-12-22T14:25:57Z",
      "links": {
        "account": 1,
        "assignee": null,
        "bookings": [
          15
        ],
        "inquiries": [

        ],
        "messages": [

        ],
        "participants": [

        ],
        "source": null
      }
    }
  ],
  "meta": {
  }
}

Remove Bookings from a Conversation

Returns an updated conversation identified by ID.

PUT /inbox/conversations/:conversation_id/disconnect_booking

Example JSON request

{
  "bookings": [
    {
      "id": 15
    }
  ]
}

Response

{
  "links": {
    "conversations.account": "https://www.bookingsync.com/api/v3/accounts/{conversations.account}",
    "conversations.assignee": "https://www.bookingsync.com/api/v3/hosts/{conversations.assignee}",
    "conversations.bookings": "https://www.bookingsync.com/api/v3/bookings/{conversations.bookings}",
    "conversations.inquiries": "https://www.bookingsync.com/api/v3/inquiries/{conversations.inquiries}",
    "conversations.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{conversations.messages}",
    "conversations.participants": "https://www.bookingsync.com/api/v3/inbox/participants/{conversations.participants}",
    "conversations.source": "https://www.bookingsync.com/api/v3/sources/{conversations.source}"
  },
  "conversations": [
    {
      "id": 5,
      "default_channel": "channelname",
      "subject": "Subject.",
      "created_at": "2018-12-20T14:25:57Z",
      "updated_at": "2018-12-20T14:25:57Z",
      "closed_at": null,
      "deadline_response_at": null,
      "last_message_at": "2018-12-20T14:25:57Z",
      "marked_as_spam_at": null,
      "read_at": "2018-12-22T14:25:57Z",
      "links": {
        "account": 1,
        "assignee": null,
        "bookings": [

        ],
        "inquiries": [

        ],
        "messages": [

        ],
        "participants": [

        ],
        "source": null
      }
    }
  ],
  "meta": {
  }
}