Skip to content

Temple APIs

Base path: /api/temples

Temple responses include mapUrl when latitude and longitude are available.

Create Temple

http
POST /api/temples

Body

json
{
  "nameEn": "Angkor Wat",
  "nameKm": "អង្គរវត្ត",
  "description": "Temple description",
  "imageUrl": "https://example.com/angkor.jpg",
  "provinceId": "17",
  "districtId": "1702",
  "communeId": "170201",
  "villageId": "17020101",
  "latitude": 13.4125,
  "longitude": 103.867
}
FieldTypeRequiredNotes
nameEnstringYesEnglish name.
nameKmstringNoKhmer name.
descriptionstringNoTemple description.
imageUrlstringNoPublic image URL.
provinceIdstringNoProvince ID.
districtIdstringNoDistrict ID.
communeIdstringNoCommune ID.
villageIdstringNoVillage ID.
latitudenumber or stringNoMust be numeric when provided.
longitudenumber or stringNoMust be numeric when provided.

Response

Returns 201.

json
{
  "success": true,
  "message": "Temple created successfully",
  "data": {
    "id": 1,
    "nameEn": "Angkor Wat",
    "nameKm": "អង្គរវត្ត",
    "description": "Temple description",
    "imageUrl": "https://example.com/angkor.jpg",
    "provinceId": "17",
    "districtId": "1702",
    "communeId": "170201",
    "villageId": "17020101",
    "latitude": 13.4125,
    "longitude": 103.867,
    "mapUrl": "https://www.google.com/maps/search/?api=1&query=13.4125,103.867"
  }
}

List Temples

http
GET /api/temples?q=angkor&provinceId=17&limit=20&offset=0

Query Parameters

NameTypeRequiredNotes
qstringNoSearch text.
provinceIdstringNoFilter by province.
districtIdstringNoFilter by district.
communeIdstringNoFilter by commune.
villageIdstringNoFilter by village.
limitstringNoPage size.
offsetstringNoRow offset.

Get Temple By ID

http
GET /api/temples/:id

Parameters

NameInTypeRequired
idpathnumberYes

Invalid IDs return 400. Missing temples return 404.