Sources

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

Parameters

Name Type Read/Write Description
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 partner 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
id Integer Read Source’s id.
name String Read/Write Required. Source’s name. (50 characters max)
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 partner 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": "2021-07-14T12:30:45Z",
      "updated_at": "2021-07-14T12:30:45Z",
      "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": "2021-07-14T12:30:45Z",
      "updated_at": "2021-07-14T12:30:45Z",
      "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": "2021-07-14T12:30:45Z",
      "updated_at": "2021-07-14T12:30:45Z",
      "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": "2021-07-14T12:30:45Z",
      "updated_at": "2021-07-14T12:30:45Z",
      "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": "2021-07-14T12:30:45Z",
      "updated_at": "2021-07-14T12:30:45Z",
      "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": "2021-07-14T12:30:45Z",
      "updated_at": "2021-07-14T12:30:45Z",
      "links": {
        "account": 1,
        "bookings": [
          1,
          3
        ]
      }
    }
  ]
}