5.3: Retrieve a List of Tee Times
In this section, we will guide you through the process of retrieving a list of available tee times for a specific golf course on a given date using the Golfdigg OTA API.
5.3.1: Endpoint
To retrieve a list of tee times, you will use the following endpoint:
- Endpoint:
/api/v1/ext/tee-time?courseId={COURSE_ID}&date={DATE} - Method: GET
5.3.2: Request Parameters
Include the following parameters in your API request:
Authorization(Header): Use Basic Authentication with your API credentials.Content-Type(Header): Set toapplication/json.courseId(Query Parameter): Specify the course ID for which you want to retrieve tee times.date(Query Parameter): Provide the desired date in the format YYYY-MM-DD.
5.3.3: Response Format
This api will return a list of tee times for the specified course and date.
Here's the response format:
interface Teetime {
id: string;
status: string;
startDate: number;
startDateString: string;
price: number;
courseId: string;
priceType: string;
minPerson: number;
maxPerson: number;
freeCaddy: boolean;
caddyPrice: number;
}
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier for the teetime. |
| status | string | Current status of the teetime (e.g., OPEN). |
| startDate | number | Start date of the teetime in milliseconds. |
| startDateString | string | Formatted start date string with timezone. |
| price | number | Price for the teetime. |
| courseId | string | Identifier of the associated golf club/course. |
| priceType | string | Type of pricing (e.g., WEEKDAY). |
| minPerson | number | Minimum number of persons for the teetime. |
| maxPerson | number | Maximum number of persons for the teetime. |
| freeCaddy | boolean | Indicates whether a free caddy is included with the teetime booking. |
| caddyPrice | int | Price for caddy |
5.3.4: Request Example
Here's an example of how to structure your API request to retrieve a list of tee times for a specific golf course on a particular date:
GET /api/v1/ext/tee-time?courseId=5c9c8252ef0ab53dcf12e8d2&date=2023-11-10
Host: ota-api.golfdigg.com
Authorization: Basic base64_encoded(apiKey)
Content-Type: application/json
Make sure to replace 5c9c8252ef0ab53dcf12e8d2 with the actual course ID and 2023-11-10 with the desired date.
5.3.5: Response Example
The API will respond with a list of available tee times for the specified course and date. 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
},
{
"id": "653f6746e4b0fb16f3e2d28d",
"status": "OPEN",
"startDate": 1700128800000,
"startDateString": "2023-11-16T17:00:00+0700",
"price": 172000,
"courseId": "5c9c8252ef0ab53dcf12e8d2",
"priceType": "WEEKDAY",
"minPerson": 3,
"maxPerson": 6
}
]