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.
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.
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,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "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,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "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,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "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,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "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,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "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,
      "name": "Airbnb",
      "position": 1,
      "created_at": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "links": {
        "account": 1,
        "bookings": [
          1,
          3
        ]
      }
    }
  ]
}