Contacts

  1. Overview
  2. List contacts
  3. Get a single contact
  4. Create a new contact
  5. Update a contact
  6. Destroy a contact

Overview

This resource represents the Contacts (people responsible for managing Rentals) that can be assigned to Rentals via Rental Contacts.

Parameters

Group Name Type Read/Write Description
  account Integer Read Account’s ID related to the Client
  id Integer Read Contact’s id.
  email String Read Contact’s email address.
  website String Read Contact’s website url.
  private_notes String Read Contact’s annotations.
  gender String Read Contact’s gender. List of possible values described in enums section.
  firstname String Read Contact’s firstname
  lastname String Read Contact’s lastname
  fullname String Read Contact’s fullname
  address1 String Read Contact’s address
  address2 String Read extension of Contact’s address
  city String Read Contact’s city
  country_code String Read Contact’s country code, list of codes is available at wikipedia.
  state String Read Contact’s state
  zip String Read Contact’s zip code
  spoken_languages Array Read List of all available languages is described in enums section.
phones   Array Read Array of contacts’s phone numbers.
  label String Read Phone label.
  number String Read Client’s number.
  created_at Time Read Contact’s create time.
  updated_at Time Read Contact’s update time.
  canceled_at Time Read Contact’s cancel time.
  forget_me_at Time Read Refer to GDPR guide
  processing_restricted_at Time Read Refer to GDPR guide
Group Name Type Read/Write Description Constraints
  account Integer Read Account’s ID related to the Client  
  id Integer Read Contact’s id.  
  email String Read/Write Contact’s email address. Required, must be in email format
  website String Read/Write Contact’s website url. Must be a URL
  private_notes String Read/Write Contact’s annotations.  
  gender String Read/Write Contact’s gender. List of possible values described in enums section. Must be one of genders enum
  firstname String Read/Write Contact’s firstname Required
  lastname String Read/Write Contact’s lastname Required
  fullname String Read Contact’s fullname  
  address1 String Read/Write Contact’s address Required, Maximum length: 100, cannot contain non-printable characters
  address2 String Read/Write extension of Contact’s address Maximum length: 100, cannot contain non-printable characters
  city String Read/Write Contact’s city Required, Maximum length: 100
  country_code String Read/Write Contact’s country code, list of codes is available at wikipedia. Required, Must be a country code enum
  state String Read/Write Contact’s state Maximum length: 100, cannot contain non-printable characters
  zip String Read/Write Contact’s zip code Required, Maximum length: 15, cannot contain non-printable characters
  spoken_languages Array Read/Write List of all available languages is described in enums section. Each item must be one of available locales, at least one element is required
phones   Array Read/Write Array of contacts’s phone numbers.  
  label String Read/Write Phone label. Required, must be in email format (if the element is present in phones array)
  number String Read/Write Contacts’s number. Required, must be in phone number format (if the element is present in phones array)
  created_at Time Read Contact’s create time.  
  updated_at Time Read Contact’s update time.  
  canceled_at Time Read Contact’s cancel time.  
  forget_me_at Time Read Contact’s forget time.  
  processing_restricted_at Time Read Contact’s processing restriction time.  

List contacts

List all contacts for a given account(s).

GET /contacts

Response

{
  "links": {
    "contacts.account": "https://www.bookingsync.com/api/v3/accounts/{contacts.account}"
  },
  "contacts": [
    {
      "id": 1,
      "address1": "Nilsa Crossroad",
      "address2": null,
      "city": "New Margarettafurt",
      "country_code": "US",
      "email": "cornelia@nienow.co.uk",
      "firstname": "FirstName1",
      "fullname": "FirstName1 LastName1",
      "gender": "male",
      "lastname": "LastName1",
      "phones": [
        {
          "label": "phone",
          "number": "+33 (0)6 123.123.123"
        },
        {
          "label": "mobile",
          "number": "+33 (0)6 123.123.123"
        },
        {
          "label": "fax",
          "number": "+33 (0)6 123.123.123"
        }
      ],
      "private_notes": "Lorem",
      "spoken_languages": [
        "en",
        "fr"
      ],
      "state": "Nevada",
      "website": "http://example.com",
      "zip": "44147",
      "created_at": "2021-01-22T08:40:20Z",
      "updated_at": "2021-01-22T08:40:20Z",
      "canceled_at": null,
      "forget_me_at": null,
      "processing_restricted_at": null,
      "links": {
        "account": 1
      }
    }
  ],
  "meta": {
    "Link": {
      "first": "https://www.bookingsync.com/api/v3/contacts?page=1",
      "last": "https://www.bookingsync.com/api/v3/contacts?page=1"
    },
    "X-Per-Page": "100",
    "X-Total-Count": "1",
    "X-Total-Pages": "1"
  }
}

Get a single contact

Returns a single contact identified by ID.

GET /contacts/:contact_id

Response

{
  "links": {
    "contacts.account": "https://www.bookingsync.com/api/v3/accounts/{contacts.account}"
  },
  "contacts": [
    {
      "id": 1,
      "address1": "Nilsa Crossroad",
      "address2": null,
      "city": "New Margarettafurt",
      "country_code": "US",
      "email": "cornelia@nienow.co.uk",
      "firstname": "FirstName1",
      "fullname": "FirstName1 LastName1",
      "gender": "male",
      "lastname": "LastName1",
      "phones": [
        {
          "label": "phone",
          "number": "+33 (0)6 123.123.123"
        },
        {
          "label": "mobile",
          "number": "+33 (0)6 123.123.123"
        },
        {
          "label": "fax",
          "number": "+33 (0)6 123.123.123"
        }
      ],
      "private_notes": "Lorem",
      "spoken_languages": [
        "en",
        "fr"
      ],
      "state": "Nevada",
      "website": "http://example.com",
      "zip": "44147",
      "created_at": "2021-01-22T08:40:20Z",
      "updated_at": "2021-01-22T08:40:20Z",
      "canceled_at": null,
      "forget_me_at": null,
      "processing_restricted_at": null,
      "links": {
        "account": 1
      }
    }
  ],
  "meta": {
    "Link": {
      "first": "https://www.bookingsync.com/api/v3/contacts?page=1",
      "last": "https://www.bookingsync.com/api/v3/contacts?page=1"
    },
    "X-Per-Page": "100",
    "X-Total-Count": "1",
    "X-Total-Pages": "1"
  }
}

Create a new contact

Creates a contact

POST /contacts

Example JSON request

{
  "contacts": [
    {
      "address1": "Nilsa Crossroad",
      "address2": null,
      "city": "New Margarettafurt",
      "country_code": "US",
      "email": "some@email.com",
      "firstname": "FirstName1",
      "gender": "male",
      "lastname": "LastName1",
      "phones": [
        {
          "label": "phone",
          "number": "+33 (0)6 123.123.123"
        },
        {
          "label": "mobile",
          "number": "+33 (0)6 123.123.123"
        },
        {
          "label": "fax",
          "number": "+33 (0)6 123.123.123"
        }
      ],
      "private_notes": "Lorem",
      "spoken_languages": [
        "en",
        "fr"
      ],
      "state": "Nevada",
      "website": "http://example.com",
      "zip": "44147"
    }
  ]
}

Response

{
  "links": {
    "contacts.account": "https://www.bookingsync.com/api/v3/accounts/{contacts.account}"
  },
  "contacts": [
    {
      "id": 1,
      "address1": "Nilsa Crossroad",
      "address2": null,
      "city": "New Margarettafurt",
      "country_code": "US",
      "email": "cornelia@nienow.co.uk",
      "firstname": "FirstName1",
      "fullname": "FirstName1 LastName1",
      "gender": "male",
      "lastname": "LastName1",
      "phones": [
        {
          "label": "phone",
          "number": "+33 (0)6 123.123.123"
        },
        {
          "label": "mobile",
          "number": "+33 (0)6 123.123.123"
        },
        {
          "label": "fax",
          "number": "+33 (0)6 123.123.123"
        }
      ],
      "private_notes": "Lorem",
      "spoken_languages": [
        "en",
        "fr"
      ],
      "state": "Nevada",
      "website": "http://example.com",
      "zip": "44147",
      "created_at": "2021-01-22T08:40:20Z",
      "updated_at": "2021-01-22T08:40:20Z",
      "canceled_at": null,
      "forget_me_at": null,
      "processing_restricted_at": null,
      "links": {
        "account": 1
      }
    }
  ],
  "meta": {
  }
}

Update a contact

Returns an updated contact identified by ID.

PUT /contact/:contact_id

Example JSON request

{
  "contacts": [
    {
      "city": "New Margarettafurt",
      "private_notes": "Lorem",
      "state": "Nevada",
      "zip": "44147"
    }
  ]
}

Response

{
  "links": {
    "contacts.account": "https://www.bookingsync.com/api/v3/accounts/{contacts.account}"
  },
  "contacts": [
    {
      "id": 1,
      "address1": "Nilsa Crossroad",
      "address2": null,
      "city": "New Margarettafurt",
      "country_code": "US",
      "email": "cornelia@nienow.co.uk",
      "firstname": "FirstName1",
      "fullname": "FirstName1 LastName1",
      "gender": "male",
      "lastname": "LastName1",
      "phones": [
        {
          "label": "phone",
          "number": "+33 (0)6 123.123.123"
        },
        {
          "label": "mobile",
          "number": "+33 (0)6 123.123.123"
        },
        {
          "label": "fax",
          "number": "+33 (0)6 123.123.123"
        }
      ],
      "private_notes": "Lorem",
      "spoken_languages": [
        "en",
        "fr"
      ],
      "state": "Nevada",
      "website": "http://example.com",
      "zip": "44147",
      "created_at": "2021-01-22T08:40:20Z",
      "updated_at": "2021-01-22T08:40:20Z",
      "canceled_at": null,
      "forget_me_at": null,
      "processing_restricted_at": null,
      "links": {
        "account": 1
      }
    }
  ],
  "meta": {
  }
}

Destroy a contact

Required OAuth scope: :rentals_write

Returns empty response with ‘204 No Content’ status code on success.

DELETE /contacts/:contact_id