5.2: Retrieve a Course by ID
In this section, we will guide you through the process of retrieving detailed information about a specific golf course using the Golfdigg OTA API.
You will need the course ID to perform this operation.
5.2.1: Endpoint
To retrieve a golf course by its ID, you will use the following endpoint:
- Endpoint:
/api/v1/ext/course/{COURSE_ID} - Method: GET
5.2.2: Request Parameters
In your API request, include the following parameter:
Authorization(Header): Use Basic Authentication with your API credentials.
5.2.3: Response Format
interface GolfClub {
id: string;
name: string;
nameTH: string;
place: string;
status: string;
type: string;
timeZone: string;
lat: string;
lon: string;
images: string[];
openingHours: string;
address: string;
website: string;
}
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier for the golf club. |
| name | string | Name of the golf club. |
| nameTH | string | Thai name of the golf club. |
| place | string | Location of the golf club. |
| status | string | Current status of the golf club (e.g., OPEN). |
| type | string | Type of the golf club (e.g., NORMAL). |
| timeZone | string | Time zone of the golf club. |
| lat | string | Latitude of the golf club location. |
| lon | string | Longitude of the golf club location. |
| images | string[] | Array of image URLs associated with the club. |
| openingHours | string | Operating hours of the golf club. |
| address | string | Address of the golf club. |
| website | string | Website URL of the golf club. |
5.2.4: Request Example
Here's an example of how to structure your API request to retrieve a golf course by its ID:
GET /api/v1/ext/course/5c9c8252ef0ab53dcf12e8d2
Host: ota-api.golfdigg.com
Authorization: Basic base64_encoded(apiKey)
Replace 5c9c8252ef0ab53dcf12e8d2 in the request URL with the actual course ID you want to retrieve.
5.2.4: Response Example
Here's a sample response:
{
"id":"5c9c8252ef0ab53dcf12e8d2",
"name":"331 GOLF CLUB-test",
"nameTH":"สนามกอล์ฟ 331 กอล์ฟ คลับ",
"place":"Amphoe Plaeng Yao, Chachoengsao",
"status":"OPEN",
"type":"NORMAL",
"timeZone":"Asia/Bangkok",
"lat":"13.654125",
"lon":"101.277686",
"images":[
"https://storage.googleapis.com/gds/pro/co/5eae4810ef0a2b6e681b0514",
"https://storage.googleapis.com/gds/pro/co/5e5cb2cbef0a66dd36c1788c",
"https://storage.googleapis.com/gds/pro/co/5e5cb2cbef0a66dd36c1788f",
"https://storage.googleapis.com/gds/pro/co/5c9c8252ef0ab53dcf12e8ce"
],
"openingHours":"07:00 - 20:00",
"address":"89 Tambon Hua Samrong, Amphoe Plaeng Yao, Chang Wat Chachoengsao 24190",
"website":"https://www.facebook.com/pages/category/Golf-Course---Country-Club/331-Golf-Club-691075080978424/"
}
The API will respond with detailed information about the specified golf course.