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;
}
FieldTypeDescription
idstringUnique identifier for the golf club.
namestringName of the golf club.
nameTHstringThai name of the golf club.
placestringLocation of the golf club.
statusstringCurrent status of the golf club (e.g., OPEN).
typestringType of the golf club (e.g., NORMAL).
timeZonestringTime zone of the golf club.
latstringLatitude of the golf club location.
lonstringLongitude of the golf club location.
imagesstring[]Array of image URLs associated with the club.
openingHoursstringOperating hours of the golf club.
addressstringAddress of the golf club.
websitestringWebsite 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.