Hosts

  1. Overview
  2. List Hosts
  3. Get a single Host
  4. Create a new Host
  5. Update a Host

Overview

This resource represents Hosts which are the representations of Users of the particular Account that can be used in the Inbox context to create Inbox Participants.

Parameters

Name Type Read/Write Description
id Integer Read Host’s id.
firstname String Read Host’s first name.
lastname String Read Host’s last name.
email String Read Host’s email.
created_at Time Read Host’s create time.
updated_at Time Read Host’s update time.
forget_me_at Time Read Refer to GDPR guide
processing_restricted_at Time Read Refer to GDPR guide
Name Type Read/Write Description Constraints
id Integer Read Host’s id.  
user_id Integer Read/Write Host’s user id.  
source_id Integer Read/Write Host’s source id.  
firstname String Read/Write Host’s first name. Required
lastname String Read/Write Host’s last name. Required
email String Read/Write Host’s email. Must be of email format if present
created_at Time Read Host’s create time.  
updated_at Time Read Host’s update time.  
forget_me_at Time Read Host’s forget time. Refer to GDPR guide.  
processing_restricted_at Time Read Host’s processing restriction time. Refer to GDPR guide.  

List Hosts

GET /hosts

Response

{
  "links": {
    "hosts.account": "https://www.bookingsync.com/api/v3/accounts/{hosts.account}",
    "hosts.participants": "https://www.bookingsync.com/api/v3/inbox/participants/{hosts.participants}",
    "hosts.source": "https://www.bookingsync.com/api/v3/sources/{hosts.source}",
    "hosts.user": "https://www.bookingsync.com/api/v3/users/{hosts.user}"
  },
  "hosts": [
    {
      "id": 2,
      "email": "host1@example.com",
      "firstname": "Jan",
      "lastname": "Kowalski",
      "created_at": "2018-12-26T19:51:24Z",
      "updated_at": "2018-12-26T19:51:24Z",
      "forget_me_at": null,
      "processing_restricted_at": null,
      "links": {
        "account": 1,
        "participants": [

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

Get a single Host

Returns a single host identified by ID.

GET /hosts/:host_id

Response

{
  "links": {
    "hosts.account": "https://www.bookingsync.com/api/v3/accounts/{hosts.account}",
    "hosts.participants": "https://www.bookingsync.com/api/v3/inbox/participants/{hosts.participants}",
    "hosts.source": "https://www.bookingsync.com/api/v3/sources/{hosts.source}",
    "hosts.user": "https://www.bookingsync.com/api/v3/users/{hosts.user}"
  },
  "hosts": [
    {
      "id": 2,
      "email": "host1@example.com",
      "firstname": "Jan",
      "lastname": "Kowalski",
      "created_at": "2018-12-26T19:51:24Z",
      "updated_at": "2018-12-26T19:51:24Z",
      "forget_me_at": null,
      "processing_restricted_at": null,
      "links": {
        "account": 1,
        "participants": [

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

Create a new Host

Creates an host.

POST /hosts

Example JSON request

{
  "hosts": [
    {
      "email": "host1@example.com",
      "firstname": "Jan",
      "lastname": "Kowalski",
      "user_id": 2
    }
  ]
}

Response

{
  "links": {
    "hosts.account": "http://test.host/api/v3/accounts/{hosts.account}",
    "hosts.participants": "http://test.host/api/v3/inbox/participants/{hosts.participants}",
    "hosts.source": "http://test.host/api/v3/sources/{hosts.source}",
    "hosts.user": "http://test.host/api/v3/users/{hosts.user}"
  },
  "hosts": [
    {
      "id": 2,
      "email": "host1@example.com",
      "firstname": "Jan",
      "lastname": "Kowalski",
      "created_at": "2018-12-26T20:03:54Z",
      "updated_at": "2018-12-26T20:03:54Z",
      "forget_me_at": null,
      "processing_restricted_at": null,
      "links": {
        "account": 1,
        "participants": [

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

Update a Host

Returns an updated host identified by ID.

PUT /hosts/:host_id

Example JSON request

{
  "hosts": [
    {
      "email": "host1@example.com",
      "firstname": "Jan",
      "lastname": "Kowalski",
      "user_id": 2
    }
  ]
}

Response

{
  "links": {
    "hosts.account": "http://test.host/api/v3/accounts/{hosts.account}",
    "hosts.participants": "http://test.host/api/v3/inbox/participants/{hosts.participants}",
    "hosts.source": "http://test.host/api/v3/sources/{hosts.source}",
    "hosts.user": "http://test.host/api/v3/users/{hosts.user}"
  },
  "hosts": [
    {
      "id": 2,
      "email": "host1@example.com",
      "firstname": "Jan",
      "lastname": "Kowalski",
      "created_at": "2018-12-26T20:03:54Z",
      "updated_at": "2018-12-26T20:03:54Z",
      "forget_me_at": null,
      "processing_restricted_at": null,
      "links": {
        "account": 1,
        "participants": [

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