Skip to content

Bookings API Reference

Bellow is a list of booking related endpoints along with their inputs and outputs. All API requests require a Bearer token. Refer to the Authentication section to see how to acquire one.

Note that parameers with an asterisk (*) at the end of their name are mandatory.

Search all bookings

Use this endpoint to search bookings using various criteria.

GET /api/bookings

Parameters

Name Type In Description
ids string array query One or more booking IDs
externalBookingIds string array query One or more external booking IDs
correlationIds string array query One or more correlation IDs
bayIds string array query One or more bay IDs
isActive bool query Whether to return only active bookings or inactive ones. If omitted, returns all bookings.
startDate datetime query Include all bookings that overlap with this UTC startDate and endDate
endDate string body Include all bookings that overlap with this UTC startDate and endDate
page integer query Return only the specified page
pageSize integer query Specify the size of each page in the result set

Response

Status: 200 OK
{
  "items": [
    {
      "id": "b683b97c-35de-4764-8eb6-0d5d49653d29",
      "externalBookingId": "B3212269",
      "correlationId": "d4151e2a-eeaa-471d-9e9e-4fba596433cb",
      "startDate": "2021-07-23T10:46:59.0274984Z",
      "endDate": "2021-07-23T11:46:59.0274984Z",
      "bayId": "6bed8066-3e02-4707-8c61-8dfde9455f3e",
      "userAlias": "golf-master",
      "createdAt": "2021-07-23T08:12:03.971808Z",
      "lastUpdatedAt": "2021-07-23T08:12:05.1029348Z",
      "_links": {
        "self": {
          "method": "GET",
          "href": "https://localsite.trackmanrange.com/api/bookings/b683b97c-35de-4764-8eb6-0d5d49653d29"
        }
      }
    }
  ],
  "_links": {
    "self": {
      "method": "GET",
      "href": "https://localsite.trackmanrange.com/api/bookings"
    },
    "first": {
      "method": "GET",
      "href": "https://localsite.trackmanrange.com/api/bookings"
    },
    "last": {
      "method": "GET",
      "href": "https://localsite.trackmanrange.com/api/bookings"
    }
  },
  "page": 1,
  "pageSize": 200,
  "pageCount": 1,
  "total": 1
}

Get upcoming bay bookings

Use this endpoint to get the upcoming bookings for a specific bay. The results will include any booking that is currently in-progress at the time of the query.

GET /api/bays/{id}/upcoming-bookings?todayOnly=true

Parameters

Name Type In Description
id string path The bay ID for which to return upcoming bookings
todayOnly bool query Whether to return only bookings for the current day
page integer query Return only the specified page
pageSize integer query Specify the size of each page in the result set

Response

Status: 200 OK
{
  "items": [
    {
      "id": "b683b97c-35de-4764-8eb6-0d5d49653d29",
      "externalBookingId": "B3212269",
      "correlationId": "d4151e2a-eeaa-471d-9e9e-4fba596433cb",
      "startDate": "2021-07-23T10:46:59.0274984Z",
      "endDate": "2021-07-23T11:46:59.0274984Z",
      "bayId": "6bed8066-3e02-4707-8c61-8dfde9455f3e",
      "userAlias": "golf-master",
      "createdAt": "2021-07-23T08:12:03.971808Z",
      "lastUpdatedAt": "2021-07-23T08:12:05.1029348Z",
      "_links": {
        "self": {
          "method": "GET",
          "href": "https://localsite.trackmanrange.com/api/bookings/b683b97c-35de-4764-8eb6-0d5d49653d29"
        }
      }
    }
  ],
  "_links": {
    "self": {
      "method": "GET",
      "href": "https://localsite.trackmanrange.com/api/bays/6bed8066-3e02-4707-8c61-8dfde9455f3e/upcoming-bookings?todayOnly=true"
    },
    "first": {
      "method": "GET",
      "href": "https://localsite.trackmanrange.com/api/bays/6bed8066-3e02-4707-8c61-8dfde9455f3e/upcoming-bookings?todayOnly=true"
    },
    "last": {
      "method": "GET",
      "href": "https://localsite.trackmanrange.com/api/bays/6bed8066-3e02-4707-8c61-8dfde9455f3e/upcoming-bookings?todayOnly=true"
    }
  },
  "page": 1,
  "pageSize": 10,
  "pageCount": 1,
  "total": 1
}