Sources

  1. Overview
  2. List sources
  3. Get a single source
  4. Create a new source
  5. Update a source

Overview

This resource represents Sources which usually represent Channels from which Bookings originate from.

Parameters

Name Type Read/Write Description
account Integer Read Account’s ID related to the Source
id Integer Read Source’s ID.
name String Read Source’s name.
position Integer Read Source’s position on the list.
internal Boolean Read Source’s internal status. When true, it is restricted for internal-only use (should not be used by the Partners for anything else than read). Every attempt to associate any record with such a source will result in 422 error.
created_at Time Read Source’s create time.
updated_at Time Read Source’s update time.
Name Type Read/Write Description Constraints
account Integer Read Account’s ID related to the Source  
id Integer Read Source’s ID.  
name String Read/Write Source’s name. Required, maximum length: 50, must not contain non-printing characters
position Integer Read/Write Source’s position on the list.  
internal Boolean Read Source’s internal status. When true, it is restricted for internal-only use (should not be used by the Partners for anything else than read). Every attempt to associate any record with such a source will result in 422 error.  
created_at Time Read Source’s create time.  
updated_at Time Read Source’s update time.  

List sources

List all sources for a given account.

GET /sources

Response

{
  "links": {
    "sources.account": "https://www.bookingsync.com/api/v3/accounts/{sources.account}",
    "sources.bookings": "https://www.bookingsync.com/api/v3/bookings/{sources.bookings}"
  },
  "sources": [
    {
      "id": 1,
      "internal": false,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2023-12-11T08:26:24Z",
      "updated_at": "2023-12-11T08:26:24Z",
      "links": {
        "account": 1,
        "bookings": [
          1,
          3
        ]
      }
    }
  ]
}

Get a single source

Returns a single source identified by ID.

GET /sources/:source_id

Response

{
  "links": {
    "sources.account": "https://www.bookingsync.com/api/v3/accounts/{sources.account}",
    "sources.bookings": "https://www.bookingsync.com/api/v3/bookings/{sources.bookings}"
  },
  "sources": [
    {
      "id": 1,
      "internal": false,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2023-12-11T08:26:24Z",
      "updated_at": "2023-12-11T08:26:24Z",
      "links": {
        "account": 1,
        "bookings": [
          1,
          3
        ]
      }
    }
  ]
}

Create a new source

Returns a newly created source.

POST /sources

Example JSON request

{
  "sources": [
    {
      "name": "Airbnb",
      "position": 1
    }
  ]
}

Response

{
  "links": {
    "sources.account": "https://www.bookingsync.com/api/v3/accounts/{sources.account}",
    "sources.bookings": "https://www.bookingsync.com/api/v3/bookings/{sources.bookings}"
  },
  "sources": [
    {
      "id": 1,
      "internal": false,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2023-12-11T08:26:24Z",
      "updated_at": "2023-12-11T08:26:24Z",
      "links": {
        "account": 1,
        "bookings": [
          1,
          3
        ]
      }
    }
  ]
}
{
  "links": {
    "sources.account": "https://www.bookingsync.com/api/v3/accounts/{sources.account}",
    "sources.bookings": "https://www.bookingsync.com/api/v3/bookings/{sources.bookings}"
  },
  "sources": [
    {
      "id": 1,
      "internal": false,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2023-12-11T08:26:24Z",
      "updated_at": "2023-12-11T08:26:24Z",
      "links": {
        "account": 1,
        "bookings": [
          1,
          3
        ]
      }
    }
  ]
}

Update a source

Returns an updated source identified by ID.

PUT /sources/:source_id

Example JSON request

{
  "sources": [
    {
      "name": "Airbnb",
      "position": 1
    }
  ]
}

Response

{
  "links": {
    "sources.account": "https://www.bookingsync.com/api/v3/accounts/{sources.account}",
    "sources.bookings": "https://www.bookingsync.com/api/v3/bookings/{sources.bookings}"
  },
  "sources": [
    {
      "id": 1,
      "internal": false,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2023-12-11T08:26:24Z",
      "updated_at": "2023-12-11T08:26:24Z",
      "links": {
        "account": 1,
        "bookings": [
          1,
          3
        ]
      }
    }
  ]
}
{
  "links": {
    "sources.account": "https://www.bookingsync.com/api/v3/accounts/{sources.account}",
    "sources.bookings": "https://www.bookingsync.com/api/v3/bookings/{sources.bookings}"
  },
  "sources": [
    {
      "id": 1,
      "internal": false,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2023-12-11T08:26:24Z",
      "updated_at": "2023-12-11T08:26:24Z",
      "links": {
        "account": 1,
        "bookings": [
          1,
          3
        ]
      }
    }
  ]
}