Inbox Participants

  1. Overview
  2. List Participants
  3. Get a single Participant
  4. Create a new Participant
  5. Update a Participant

Overview

This resource represents Inbox Participants that can send Inbox Messages for a given Inbox Conversation.

Parameters

Name Type Read/Write Description
conversation Integer Read Conversation’s ID to which Participant belongs to
account Integer Read Account’s ID to which Participant is related to
member_id Integer Read ID of the resource that created the Participant (Client or Host - this is a polymorphic association)
member_type String Read Type of the resource that created the Participant (Client or Host - this is a polymorphic association)
id Integer Read Participant’s ID.
created_at Time Read Participant’s create time.
updated_at Time Read Participant’s update time.
last_message_sent_at Time Read Participant’s last sent message time.
read_at Time Read Time when Participant read last message.
Name Type Read/Write Description Constraints
conversation Integer Read Conversation’s ID to which Participant belongs to  
account Integer Read Account’s ID to which Participant is related to  
member_id Integer Read ID of the resource that created the Participant (Client or Host - this is a polymorphic association)  
member_type String Read Type of the resource that created the Participant (Client or Host - this is a polymorphic association)  
id Integer Read Participant’s id.  
member_id Integer Write (create-only) Participant’s Member id. Required
member_type Integer Write (create-only) Participant’s member type (Client or Host). Required, must be Client or Host.
conversation_id Integer Write (create-only) Participant’s Conversation id. Required
read Boolean Write An attribute for marking last message as read by Participant (and will assign read_at timestamp) Must be in the past
created_at Time Read Participant’s create time.  
updated_at Time Read Participant’s update time.  
last_message_sent_at Time Read Participant’s last sent message time.  
read_at Time Read Time when Participant read last message.  

List Participants

GET /inbox/participants

Response

{
  "links": {
    "participants.client": "https://www.bookingsync.com/api/v3/clients/{participants.member.id}",
    "participants.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{participants.conversation}",
    "participants.host": "https://www.bookingsync.com/api/v3/hosts/{participants.member.id}"
  },
  "participants": [
    {
      "id": 10,
      "created_at": "2018-12-21T10:42:17Z",
      "updated_at": "2018-12-21T10:42:17Z",
      "last_message_sent_at": "2018-12-15T10:42:17Z",
      "read_at": null,
      "links": {
        "conversation": 3,
        "member": {
          "id": 5,
          "type": "Host"
        }
      }
    }
  ],
  "meta": {
  }
}

Get a single Participant

Returns a single participant identified by ID.

GET /inbox/participants/:participant_id

Response

{
  "links": {
    "participants.client": "https://www.bookingsync.com/api/v3/clients/{participants.member.id}",
    "participants.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{participants.conversation}",
    "participants.host": "https://www.bookingsync.com/api/v3/hosts/{participants.member.id}"
  },
  "participants": [
    {
      "id": 10,
      "created_at": "2018-12-21T10:42:17Z",
      "updated_at": "2018-12-21T10:42:17Z",
      "last_message_sent_at": "2018-12-15T10:42:17Z",
      "read_at": null,
      "links": {
        "conversation": 3,
        "member": {
          "id": 5,
          "type": "Host"
        }
      }
    }
  ],
  "meta": {
  }
}

Create a new Participant

Creates a Participant.

POST /inbox/participants

Example JSON request

{
  "participants": [
    {
      "conversation_id": 3,
      "member_id": 5,
      "member_type": "Host",
      "read": "true",
      "last_message_sent_at": "2018-12-15T10:42:17Z"
    }
  ]
}

Response

{
  "links": {
    "participants.client": "https://www.bookingsync.com/api/v3/clients/{participants.member.id}",
    "participants.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{participants.conversation}",
    "participants.host": "https://www.bookingsync.com/api/v3/hosts/{participants.member.id}"
  },
  "participants": [
    {
      "id": 10,
      "created_at": "2018-12-21T10:42:17Z",
      "updated_at": "2018-12-21T10:42:17Z",
      "last_message_sent_at": "2018-12-15T10:42:17Z",
      "read_at": "2018-12-21T10:42:17Z",
      "links": {
        "conversation": 3,
        "member": {
          "id": 5,
          "type": "Host"
        }
      }
    }
  ],
  "meta": {
  }
}

Update a Participant

Returns an updated participant identified by ID.

PUT /inbox/participants/:participant_id

Restrictions on updatable parameters

Only :read attribute is allowed.

Example JSON request

{
  "participants": [
    {
      "read": "true"
    }
  ]
}

Response

{
  "links": {
    "participants.client": "https://www.bookingsync.com/api/v3/clients/{participants.member.id}",
    "participants.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{participants.conversation}",
    "participants.host": "https://www.bookingsync.com/api/v3/hosts/{participants.member.id}"
  },
  "participants": [
    {
      "id": 10,
      "created_at": "2018-12-21T10:42:17Z",
      "updated_at": "2018-12-21T10:42:17Z",
      "last_message_sent_at": "2018-12-15T10:42:17Z",
      "read_at": "2018-12-21T10:42:17Z",
      "links": {
        "conversation": 3,
        "member": {
          "id": 5,
          "type": "Host"
        }
      }
    }
  ],
  "meta": {
  }
}