Skip to content

API Reference

Jevex edited this page May 25, 2022 · 1 revision

Search Maps

Searches the CTM Repository for maps that best match the given query.

URL Format

GET /search/maps?q={query}{&page,perPage,strict}

Request Form Data

Parameter Type Requirement Type Description
q string Required The search query string
page integer Optional The page number of results to return
[Default: 1]
perPage integer Optional A number of results to return per page
[Default: 1] [Range: 1-100]
strict boolean Optional When false, search will also return close matches
[Default: true]

Example Request

GET http://localhost:8080/search/maps?q=divinity&page=1&perPage=1

Example Response

{
    "maxPage": 1,
    "data": [
        {
            "id": 2,
            "name": "Divinity's End",
            "author": "The DE Team",
            "series": "Pantheon",
            "length": "Long",
            "difficulty": "Medium",
            "descriptionShort": "Divinity's End is a massive collaborative CTM map...",
            "downloadCount": 21850,
            "type": "Branching",
            "imageUrl": "/images/div.webp",
            "minecraftVersion": "1.16.5",
            "published": true,
            "upload_date": 0,
            "objectiveMain": 13,
            "objectiveBonus": 16
        }
    ]
}

Get Map by ID

This request queries a single map specified by id.

URL Format

GET /map/{id}

Request Form Data

Parameter Type Requirement Type Description
id integer Required The database identifier for the requested map

Example Request

GET http://localhost:8080/maps/1

Example Response

{
    "id": 1,
    "name": "Moonlight",
    "author": "The CTMC",
    "series": "Rookiewreck",
    "length": "Long",
    "difficulty": "Medium",
    "descriptionShort": "Moonlight is the lovechild of the Rookiewreck mapping event...",
    "downloadCount": 899,
    "type": "Linear Branching",
    "imageUrl": "/images/5886020644119590.webp",
    "minecraftVersion": "1.17.1",
    "uploadDate": 0,
    "objectiveMain": 17,
    "objectiveBonus": 54
}