5.4: Retrieve a Tee Time by ID

In this section, we will guide you through the process of retrieving detailed information about a specific tee time using the Golfdigg OTA API. You will need the tee time ID to perform this operation.

5.4.1: Endpoint

To retrieve a tee time by its ID, you will use the following endpoint:

  • Endpoint: /api/v1/ext/tee-time/{TEE_TIME_ID}
  • Method: GET

5.4.2: Request Parameters

In your API request, include the following parameter:

  • Authorization (Header): Use Basic Authentication with your API credentials.

5.4.3: Response Format

This api will return tee time information.

Here's the response format:

interface Teetime {
  id: string;
  startDate: number;
  startDateString: string;
  price: number;
  courseId: string;
  priceType: string;
  minPerson: number;
  maxPerson: number;
  actualMaxPerson: number;
  persons: number;
  isParty: boolean;
  isPartyAble: boolean;
  caddyPrice: number;
  freeCaddy: false;
}
FieldTypeDescription
idstringUnique identifier for the teetime.
statusstringCurrent status of the teetime (e.g., OPEN).
startDatenumberStart date of the teetime in milliseconds.
startDateStringstringFormatted start date string with timezone.
pricenumberPrice for the teetime.
courseIdstringIdentifier of the associated golf club/course.
priceTypestringType of pricing (e.g., WEEKDAY).
minPersonnumberMinimum number of persons for the teetime.
maxPersonnumberMaximum number of persons for the teetime.
actualMaxPersonint-
personsint-
isPartybooleanIndicates whether the teetime is for a group or party booking (e.g., true if it's a party booking, false otherwise).
isPartyAblebooleanIndicates whether the teetime can accommodate party bookings (e.g., true if party bookings are allowed, false otherwise).

5.4.3: Request Example

Here's an example of how to structure your API request to retrieve a tee time by its ID:

GET /api/v1/ext/tee-time/1
Host: ota-api.golfdigg.com
Authorization: Basic base64_encoded(apiKey)

Replace 1 in the request URL with the actual tee time ID you want to retrieve.

5.4.4: Response Example

The API will respond with detailed information about the specified tee time. Here's a sample response:

  {
  "id": "653f6746e4b0fb16f3e2d292",
  "status": "OPEN",
  "startDate": 1700131800000,
  "startDateString": "2023-11-16T17:50:00+0700",
  "price": 172000,
  "courseId": "5c9c8252ef0ab53dcf12e8d2",
  "priceType": "WEEKDAY",
  "minPerson": 3,
  "maxPerson": 6,
  "actualMaxPerson": 0,
  "persons": 0,
  "isParty": false,
  "isPartyAble": false
}