/get/resort_type/{id} - Get resort type by ID

Overview

The /get/resort_type/{id} endpoint retrieves detailed information about a specific resort type category by its ID.

Purpose

Endpoint

GET /get/resort_type/{id}

Parameters

Path parameters

id (string, required)

The resort type's WordPress ID. Can be provided with or without the "1_" prefix.

Formats:

Examples:

Validation: Must be numeric or in format "1{number}". The "1" prefix is automatically removed if present.


Query parameters

sourceFields (string, optional)

Return only specific fields from the _source object using dot notation (comma-separated).

Purpose: Optimize response payload size by requesting only needed fields

Examples:


Response format

Success response structure

{
  "_index": "fnugg_blog",
  "_type": "resort_type",
  "_id": "1_456",
  "_version": 1,
  "found": true,
  "_source": {
    "id": 456,
    "title": "Alpint",
    "type": "resort_type",
    "resorts": [14, 12, 89, 102, 73],
    "images": [
      {
        "url": "https://example.com/alpine-skiing.jpg",
        "caption": "Alpint skiløping",
        "width": 1920,
        "height": 1080
      }
    ],
    "automatic": "alpine"
  }
}

Error response (not found)

{
  "error": "Resort type with ID '999' was not found.",
  "error_key": "resort_type_not_found",
  "id": "999"
}

Response fields

Top level fields

_source fields

Basic information

Media

Categorization


Example requests

Get complete resort type data

GET /get/resort_type/456

Returns all fields for resort type with WordPress ID 456.


Get resort type with legacy ID format

GET /get/resort_type/1_456

Returns same result as above (the "1_" prefix is automatically stripped).


Get resort type with specific fields only

GET /get/resort_type/456?sourceFields=title,resorts

Returns only title and list of resort IDs.


Get resort type basic info

GET /get/resort_type/456?sourceFields=title,automatic,images

Returns basic information with categorization and images.


Example resort types

Common resort type categories in the Norwegian ski resort context:


Use Cases

  1. Filter resorts by type: Use the resorts array to get all resorts of a specific type
  2. Category navigation: Use sourceFields=title,automatic for filtering UI
  3. Resort type statistics: Combine with resort data using the resorts array
  4. Display resort type pages: Use complete data for category landing pages
  5. Faceted search: Use automatic field value for search filtering
  6. Resort categorization: Show which types each resort belongs to

Notes