Overview

The Dungeons of Kollchap from What Is Dungeons & Dragons? published 1982

HTTP verbs

RESTful Kollchap tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP verbs.

Verb Usage

GET

Used to retrieve a resource

POST

Used to create a new resource

PATCH

Used to update an existing resource, including partial updates

DELETE

Used to delete an existing resource

HTTP status codes

RESTful characters tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP status codes.

Status code Usage

200 OK

The request completed successfully

201 Created

A new resource has been created successfully. The resource’s URI is available from the response’s Location header

204 No Content

An update to an existing resource has been applied successfully

400 Bad Request

The request was malformed. The response body will include an error providing further information

404 Not Found

The requested resource did not exist

Headers

Every response has the following header(s):

Name Description

Content-Type

The Content-Type of the payload application/hal+json

Errors

Whenever an error response (status code >= 400) is returned, the body will contain a JSON object that describes the problem. The error object has the following structure:

Path Type Description

error

String

The HTTP error that occurred, e.g. Bad Request

path

String

The path to which the request was made

status

Number

The HTTP status code, e.g. 400

timestamp

String

The time, in milliseconds, at which the error occurred

For example, a request that attempts to apply a non-existent tag to a character will produce a 400 Bad Request response:

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 101

{"timestamp":"2023-07-09T11:48:46.936+00:00","status":400,"error":"Bad Request","path":"/characters"}

Hypermedia

RESTful Kollchap uses hypermedia and resources include links to other resources in their responses. Responses are in Hypertext Application Language (HAL) format. Links can be found beneath the _links key. Users of the API should not create URIs themselves, instead they should use the above-described links to navigate from resource to resource.

Resources

Index

The index provides the entry point into the service.

Accessing the index

A GET request is used to access the index

Response fields

Path Type Description

_links

Object

Links to other resources

Example response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 239

{
  "_links" : {
    "characters" : {
      "href" : "http://localhost:8080/characters"
    },
    "rooms" : {
      "href" : "http://localhost:8080/rooms"
    },
    "profile" : {
      "href" : "http://localhost:8080/profile"
    }
  }
}
Relation Description

characters

The Characters resource

rooms

The Rooms resource

profile

The ALPS resource

Characters

The Characters resources is used to create and list characters

Listing characters

A GET request will list all of the service’s characters.

Response fields

Path Type Description

_embedded.characters

Array

An array of Character resources

_links

Object

Links to other resources

Example request

$ curl 'http://localhost:8080/characters' -i -X GET \
    -H 'Accept: application/hal+json'

Example response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 5521

{
  "_embedded" : {
    "characters" : [ {
      "name" : "Slammer Kyntire",
      "background" : "First-level Fighter searching for the Sword of the Sorcerer.",
      "race" : "Human",
      "class" : "Fighter",
      "alignment" : "Lawful",
      "level" : 1,
      "armourClass" : 3,
      "hitPoints" : 7,
      "characteristics" : {
        "str" : 18,
        "int" : 10,
        "wis" : 10,
        "dex" : 9,
        "con" : 11,
        "chr" : 10
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/characters/S3OT4QlQgTX6"
        },
        "gameCharacter" : {
          "href" : "http://localhost:8080/characters/S3OT4QlQgTX6"
        }
      }
    }, {
      "name" : "Hotfa Nap",
      "background" : "First-level Sorceress from a nomad tribe in the Mesta Desert.",
      "race" : "Human",
      "class" : "MagicUser",
      "alignment" : "Neutral",
      "level" : 1,
      "armourClass" : 9,
      "hitPoints" : 5,
      "characteristics" : {
        "str" : 5,
        "int" : 10,
        "wis" : 8,
        "dex" : 18,
        "con" : 13,
        "chr" : 9
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/characters/72FSiCMDE11b"
        },
        "gameCharacter" : {
          "href" : "http://localhost:8080/characters/72FSiCMDE11b"
        }
      }
    }, {
      "name" : "Gripper 'The Skin' Longshank",
      "background" : "First-level Thief from a tribe on the Albine empire border.",
      "race" : "Halfling",
      "class" : "Thief",
      "alignment" : "Neutral",
      "level" : 1,
      "armourClass" : 4,
      "hitPoints" : 5,
      "characteristics" : {
        "str" : 5,
        "int" : 10,
        "wis" : 8,
        "dex" : 18,
        "con" : 13,
        "chr" : 9
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/characters/0OE2tYmFNn86"
        },
        "gameCharacter" : {
          "href" : "http://localhost:8080/characters/0OE2tYmFNn86"
        }
      }
    }, {
      "name" : "Zhod Thobi",
      "background" : "First-level Cleric N.P.C joins party and receives equal share of treasure.",
      "race" : "Human",
      "class" : "Cleric",
      "alignment" : "Lawful",
      "level" : 1,
      "armourClass" : 3,
      "hitPoints" : 6,
      "characteristics" : {
        "str" : 11,
        "int" : 14,
        "wis" : 15,
        "dex" : 10,
        "con" : 7,
        "chr" : 10
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/characters/3keCCPdJU1Al"
        },
        "gameCharacter" : {
          "href" : "http://localhost:8080/characters/3keCCPdJU1Al"
        }
      }
    }, {
      "name" : "Belisarius",
      "background" : "First-level Thief N.P.C survivor. Currently hiding, if located will join party.",
      "race" : "Halfling",
      "class" : "Thief",
      "alignment" : "Neutral",
      "level" : 1,
      "armourClass" : 7,
      "hitPoints" : 2,
      "characteristics" : {
        "str" : 5,
        "int" : 10,
        "wis" : 8,
        "dex" : 18,
        "con" : 13,
        "chr" : 9
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/characters/xl9FfHCXO6UC"
        },
        "gameCharacter" : {
          "href" : "http://localhost:8080/characters/xl9FfHCXO6UC"
        }
      }
    }, {
      "name" : "Rosa Dobbit",
      "background" : "First-level Fighter N.P.C survivor. Currently captive, if released will join party.",
      "race" : "Halfling",
      "class" : "Fighter",
      "alignment" : "Lawful",
      "level" : 1,
      "armourClass" : 9,
      "hitPoints" : 4,
      "characteristics" : {
        "str" : 8,
        "int" : 9,
        "wis" : 8,
        "dex" : 14,
        "con" : 13,
        "chr" : 12
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/characters/nmo4lNJX5Qzc"
        },
        "gameCharacter" : {
          "href" : "http://localhost:8080/characters/nmo4lNJX5Qzc"
        }
      }
    }, {
      "name" : "Odric",
      "background" : "Third-level Cleric N.P.C enemy. Currently in possession of the stolen Statue of Tranfax.",
      "race" : "Human",
      "class" : "Cleric",
      "alignment" : "Chaotic",
      "level" : 1,
      "armourClass" : 3,
      "hitPoints" : 9,
      "characteristics" : {
        "str" : 5,
        "int" : 10,
        "wis" : 8,
        "dex" : 18,
        "con" : 13,
        "chr" : 9
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/characters/on32sMVRJ48W"
        },
        "gameCharacter" : {
          "href" : "http://localhost:8080/characters/on32sMVRJ48W"
        }
      }
    }, {
      "name" : "Bobert",
      "background" : "Merchant in the dungeon",
      "race" : "Human",
      "class" : "Thief",
      "alignment" : "Neutral",
      "level" : 2,
      "armourClass" : 3,
      "hitPoints" : 6,
      "characteristics" : {
        "str" : 13,
        "int" : 17,
        "wis" : 18,
        "dex" : 12,
        "con" : 12,
        "chr" : 17
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/characters/sQua7xtze2Dq"
        },
        "gameCharacter" : {
          "href" : "http://localhost:8080/characters/sQua7xtze2Dq"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/characters"
    },
    "profile" : {
      "href" : "http://localhost:8080/profile/characters"
    }
  }
}

Creating a character

A POST request is used to create a character.

Request fields

Path Type Description Constraints

name

String

Full name of character

Must not be blank

background

String

Background history and motivation

Must not be blank

race

String

One of Dwarf, Elf, Halfling, Human

Must not be null

class

String

One of Cleric, Fighter, MagicUser, Thief

Must not be null

level

Number

Experience and abilities scale. Higher is better

Must be at least 1 and at most 20

armourClass

Number

Armour and hit protection scale. Lower is better

Must be at least 0 and at most 9

hitPoints

Number

Damage a character can take. Higher is better

Must be at least 0

alignment

String

One of Chaotic, Lawful, Neutral

Must not be null

characteristics

Object

STR INT WIS DEX CON CHR

Must not be null

Example request

$ curl 'http://localhost:8080/characters' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{"name":"Bobert","background":"Merchant in the dungeon","race":"Human","class":"Thief","alignment":"Neutral","level":2,"armourClass":3,"hitPoints":6,"characteristics":{"str":13,"int":17,"wis":18,"dex":12,"con":12,"chr":17}}'

Example response

HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: http://localhost:8080/characters/sQua7xtze2Dq
Path Type Description Constraints

str

Number

Strength attribute

Must be at least 3 and at most 18

int

Number

Intelligence attribute

Must be at least 3 and at most 18

wis

Number

Wisdom attribute

Must be at least 3 and at most 18

dex

Number

Dexterity attribute

Must be at least 3 and at most 18

con

Number

Constitution attribute

Must be at least 3 and at most 18

chr

Number

Charisma attribute

Must be at least 3 and at most 18

Character

The Character resource is used to retrieve, update, and delete individual characters

Relation Description

self

This character

gameCharacter

Link to the gameCharacter resource

Retrieve a character

A GET request will retrieve the details of a character

Response fields

Path Type Description

name

String

Full name of character

background

String

Background history and motivation

race

String

One of Dwarf, Elf, Halfling, Human

class

String

One of Cleric, Fighter, MagicUser, Thief

level

Number

Experience and abilities scale. Higher is better

armourClass

Number

Armour and hit protection scale. Lower is better

hitPoints

Number

Damage a character can take. Higher is better

alignment

String

One of Chaotic, Lawful, Neutral

characteristics

Object

STR INT WIS DEX CON CHR

_links

Object

Links to other resources

Example request

$ curl 'http://localhost:8080/characters/S3OT4QlQgTX6' -i -X GET \
    -H 'Accept: application/hal+json'

Example response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 558

{
  "name" : "Slammer Kyntire",
  "background" : "First-level Fighter searching for the Sword of the Sorcerer.",
  "race" : "Human",
  "class" : "Fighter",
  "alignment" : "Lawful",
  "level" : 1,
  "armourClass" : 3,
  "hitPoints" : 7,
  "characteristics" : {
    "str" : 18,
    "int" : 10,
    "wis" : 10,
    "dex" : 9,
    "con" : 11,
    "chr" : 10
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/characters/S3OT4QlQgTX6"
    },
    "gameCharacter" : {
      "href" : "http://localhost:8080/characters/S3OT4QlQgTX6"
    }
  }
}

Update a Character

A PATCH request is used to update a Character

Request fields

Path Type Description Constraints

name

String

Full name of character

Must not be blank

background

String

Background history and motivation

Must not be blank

race

String

One of Dwarf, Elf, Halfling, Human

Must not be null

class

String

One of Cleric, Fighter, MagicUser, Thief

Must not be null

level

Number

Experience and abilities scale. Higher is better

Must be at least 1 and at most 20

armourClass

Number

Armour and hit protection scale. Lower is better

Must be at least 0 and at most 9

hitPoints

Number

Damage a character can take. Higher is better

Must be at least 0

alignment

String

One of Chaotic, Lawful, Neutral

Must not be null

characteristics

Object

STR INT WIS DEX CON CHR

Must not be null

Example request

$ curl 'http://localhost:8080/characters/cIJV57zPHJUr' -i -X PATCH \
    -H 'Content-Type: application/hal+json;charset=UTF-8' \
    -d '{"name":"Update name","background":"Update background","race":"Dwarf","class":"Cleric","alignment":"Chaotic","level":3,"armourClass":2,"hitPoints":1,"characteristics":{"str":8,"int":17,"wis":6,"dex":3,"con":8,"chr":13}}'

Example response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

Rooms

The Rooms resources is used to create and list rooms

Listing rooms

A GET request will list all of the service’s rooms.

Response fields

Path Type Description

_embedded.rooms

Array

An array of Room resources

_links

Object

Links to other resources

Example request

$ curl 'http://localhost:8080/rooms' -i -X GET \
    -H 'Accept: application/hal+json'

Example response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 22902

{
  "_embedded" : {
    "rooms" : [ {
      "key" : "1",
      "name" : "Orc Guardroom",
      "description" : "In this room are two sets of bunk beds...In the centre is a large battered table...",
      "egress" : [ "2", "4", "5", "6" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/BgfHfvlFGzNz"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/BgfHfvlFGzNz"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/2",
          "name" : "Rubbish Dump"
        }, {
          "href" : "http://localhost:8080/rooms/keys/4",
          "name" : "Corridor Trap"
        }, {
          "href" : "http://localhost:8080/rooms/keys/5",
          "name" : "Storeroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/6",
          "name" : "Healing Pool"
        } ]
      }
    }, {
      "key" : "2",
      "name" : "Rubbish Dump",
      "description" : "This room is used by the inhabitants...It is filled with broken furniture, bones...",
      "egress" : [ "1", "4", "5", "6" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/MnI1xzPOvmea"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/MnI1xzPOvmea"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/1",
          "name" : "Orc Guardroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/4",
          "name" : "Corridor Trap"
        }, {
          "href" : "http://localhost:8080/rooms/keys/5",
          "name" : "Storeroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/6",
          "name" : "Healing Pool"
        } ]
      }
    }, {
      "key" : "3",
      "name" : "Floorless Room",
      "description" : "This room was once the entrance to the main part of the shrine...",
      "egress" : [ "4", "16", "17", "18" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/jqZ8GWqH9t0G"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/jqZ8GWqH9t0G"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/4",
          "name" : "Corridor Trap"
        }, {
          "href" : "http://localhost:8080/rooms/keys/16",
          "name" : "Old Waiting Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/17",
          "name" : "Oracle Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/18",
          "name" : "Pit Trap"
        } ]
      }
    }, {
      "key" : "4",
      "name" : "Corridor Trap",
      "description" : "The Slime is clinging to the west wall and will...fall on a party member...",
      "egress" : [ "1", "2", "3", "5", "6" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/ZNzjIyKiDhz4"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/ZNzjIyKiDhz4"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/1",
          "name" : "Orc Guardroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/2",
          "name" : "Rubbish Dump"
        }, {
          "href" : "http://localhost:8080/rooms/keys/3",
          "name" : "Floorless Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/5",
          "name" : "Storeroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/6",
          "name" : "Healing Pool"
        } ]
      }
    }, {
      "key" : "5",
      "name" : "Storeroom",
      "description" : "This room was once a storeroom for the temple...some moldy food remains...",
      "egress" : [ "1", "2", "3", "5", "6" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/TSnZ81r5cokh"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/TSnZ81r5cokh"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/1",
          "name" : "Orc Guardroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/2",
          "name" : "Rubbish Dump"
        }, {
          "href" : "http://localhost:8080/rooms/keys/3",
          "name" : "Floorless Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/5",
          "name" : "Storeroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/6",
          "name" : "Healing Pool"
        } ]
      }
    }, {
      "key" : "6",
      "name" : "Healing Pool",
      "description" : "This pool is circular with a radius of about three feet...and has a greenish tint...",
      "egress" : [ "1", "2", "4", "5", "7", "8" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/UW17Cjx8XE2P"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/UW17Cjx8XE2P"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/1",
          "name" : "Orc Guardroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/2",
          "name" : "Rubbish Dump"
        }, {
          "href" : "http://localhost:8080/rooms/keys/4",
          "name" : "Corridor Trap"
        }, {
          "href" : "http://localhost:8080/rooms/keys/5",
          "name" : "Storeroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/7",
          "name" : "Coffin Storeroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/8",
          "name" : "Odric's Bedroom"
        } ]
      }
    }, {
      "key" : "7",
      "name" : "Coffin Storeroom",
      "description" : "This room is bare except for fifteen plain wooden coffins...stacked in threes...",
      "egress" : [ "6", "8" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/MxXCFzbZYCaf"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/MxXCFzbZYCaf"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/6",
          "name" : "Healing Pool"
        }, {
          "href" : "http://localhost:8080/rooms/keys/8",
          "name" : "Odric's Bedroom"
        } ]
      }
    }, {
      "key" : "8",
      "name" : "Odric's Bedroom",
      "description" : "This room has a sumptuously furnished bed with silk sheets...",
      "egress" : [ "6", "7", "10", "12" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/jSDQywgi7u5k"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/jSDQywgi7u5k"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/6",
          "name" : "Healing Pool"
        }, {
          "href" : "http://localhost:8080/rooms/keys/7",
          "name" : "Coffin Storeroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/10",
          "name" : "UnderPriests' Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/12",
          "name" : "Great Sacrifice Chamber"
        } ]
      }
    }, {
      "key" : "9",
      "name" : "The Office",
      "description" : "This room serves as Odric's office...On the table is a mass of papers...",
      "egress" : [ "6", "7", "9a", "10", "12" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/ZXcI4uSEVBH7"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/ZXcI4uSEVBH7"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/6",
          "name" : "Healing Pool"
        }, {
          "href" : "http://localhost:8080/rooms/keys/7",
          "name" : "Coffin Storeroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/9a",
          "name" : "Collapsed Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/10",
          "name" : "UnderPriests' Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/12",
          "name" : "Great Sacrifice Chamber"
        } ]
      }
    }, {
      "key" : "9a",
      "name" : "Collapsed Room",
      "description" : "The Rockmen are rummaging around in this room...",
      "egress" : [ "9" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/Ei5ab7aO9PSA"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/Ei5ab7aO9PSA"
        },
        "egress" : {
          "href" : "http://localhost:8080/rooms/keys/9",
          "name" : "The Office"
        }
      }
    }, {
      "key" : "10",
      "name" : "UnderPriests' Room",
      "description" : "This room is used by the three Clerics as a base...",
      "egress" : [ "8", "9", "11", "12" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/U2RLhgE5qvXy"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/U2RLhgE5qvXy"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/8",
          "name" : "Odric's Bedroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/9",
          "name" : "The Office"
        }, {
          "href" : "http://localhost:8080/rooms/keys/11",
          "name" : "Room of Absolution"
        }, {
          "href" : "http://localhost:8080/rooms/keys/12",
          "name" : "Great Sacrifice Chamber"
        } ]
      }
    }, {
      "key" : "11",
      "name" : "Room of Absolution",
      "description" : "This room is almost wholly bare except for six large urns...",
      "egress" : [ "10", "12", "21", "22", "23" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/TL2q6qYZluIz"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/TL2q6qYZluIz"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/10",
          "name" : "UnderPriests' Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/12",
          "name" : "Great Sacrifice Chamber"
        }, {
          "href" : "http://localhost:8080/rooms/keys/21",
          "name" : "Statue Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/22",
          "name" : "Meditation Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/23",
          "name" : "Flooded Storeroom"
        } ]
      }
    }, {
      "key" : "12",
      "name" : "Great Sacrifice Chamber",
      "description" : "This room is vast...There is a pole in the centre...",
      "egress" : [ "8", "9", "10", "11", "13", "15", "21", "22", "23" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/rpxyUp1FUAwc"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/rpxyUp1FUAwc"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/8",
          "name" : "Odric's Bedroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/9",
          "name" : "The Office"
        }, {
          "href" : "http://localhost:8080/rooms/keys/10",
          "name" : "UnderPriests' Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/11",
          "name" : "Room of Absolution"
        }, {
          "href" : "http://localhost:8080/rooms/keys/13",
          "name" : "The Cells"
        }, {
          "href" : "http://localhost:8080/rooms/keys/15",
          "name" : "Changing Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/21",
          "name" : "Statue Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/22",
          "name" : "Meditation Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/23",
          "name" : "Flooded Storeroom"
        } ]
      }
    }, {
      "key" : "13",
      "name" : "The Cells",
      "description" : "There are three cells...The cells are all locked...",
      "egress" : [ "12" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/7Bx4Wo7v80EJ"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/7Bx4Wo7v80EJ"
        },
        "egress" : {
          "href" : "http://localhost:8080/rooms/keys/12",
          "name" : "Great Sacrifice Chamber"
        }
      }
    }, {
      "key" : "14",
      "name" : "Treasure Chamber",
      "description" : "The door to this room is locked...",
      "egress" : [ "8", "15" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/0PlZ23MbVGYW"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/0PlZ23MbVGYW"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/8",
          "name" : "Odric's Bedroom"
        }, {
          "href" : "http://localhost:8080/rooms/keys/15",
          "name" : "Changing Room"
        } ]
      }
    }, {
      "key" : "15",
      "name" : "Changing Room",
      "description" : "This room is used by Odric for changing into his sacrifice robes...",
      "egress" : [ "10", "12", "21", "22", "23" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/F66aCModENQh"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/F66aCModENQh"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/10",
          "name" : "UnderPriests' Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/12",
          "name" : "Great Sacrifice Chamber"
        }, {
          "href" : "http://localhost:8080/rooms/keys/21",
          "name" : "Statue Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/22",
          "name" : "Meditation Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/23",
          "name" : "Flooded Storeroom"
        } ]
      }
    }, {
      "key" : "16",
      "name" : "Old Waiting Room",
      "description" : "This room was once a waiting room for the oracle...",
      "egress" : [ "3", "17", "18", "19", "21" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/rsw84Bm8OWGA"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/rsw84Bm8OWGA"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/3",
          "name" : "Floorless Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/17",
          "name" : "Oracle Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/18",
          "name" : "Pit Trap"
        }, {
          "href" : "http://localhost:8080/rooms/keys/19",
          "name" : "Goblins' Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/21",
          "name" : "Statue Room"
        } ]
      }
    }, {
      "key" : "17",
      "name" : "Oracle Room",
      "description" : "This room used to be an oracle room...There is a statue of a seven-foot-high human...",
      "egress" : [ "3", "16", "18", "19", "20", "21" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/QYVLdPnH263j"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/QYVLdPnH263j"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/3",
          "name" : "Floorless Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/16",
          "name" : "Old Waiting Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/18",
          "name" : "Pit Trap"
        }, {
          "href" : "http://localhost:8080/rooms/keys/19",
          "name" : "Goblins' Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/20",
          "name" : "Cave"
        }, {
          "href" : "http://localhost:8080/rooms/keys/21",
          "name" : "Statue Room"
        } ]
      }
    }, {
      "key" : "18",
      "name" : "Pit Trap",
      "description" : "At this point the floor is covering a pit...The pit used to be a tunnel...",
      "egress" : [ "3", "16", "17", "19", "20", "21" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/gLCiC2WhDMZU"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/gLCiC2WhDMZU"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/3",
          "name" : "Floorless Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/16",
          "name" : "Old Waiting Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/17",
          "name" : "Oracle Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/19",
          "name" : "Goblins' Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/20",
          "name" : "Cave"
        }, {
          "href" : "http://localhost:8080/rooms/keys/21",
          "name" : "Statue Room"
        } ]
      }
    }, {
      "key" : "19",
      "name" : "Goblins' Room",
      "description" : "This room is very stark, with only straw for bedding, on the floor...",
      "egress" : [ "3", "16", "17", "18", "20", "21" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/rF9j4ZDAvnss"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/rF9j4ZDAvnss"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/3",
          "name" : "Floorless Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/16",
          "name" : "Old Waiting Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/17",
          "name" : "Oracle Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/18",
          "name" : "Pit Trap"
        }, {
          "href" : "http://localhost:8080/rooms/keys/20",
          "name" : "Cave"
        }, {
          "href" : "http://localhost:8080/rooms/keys/21",
          "name" : "Statue Room"
        } ]
      }
    }, {
      "key" : "20",
      "name" : "Cave",
      "description" : "This room is a cave littered with rocks and boulders...the atmosphere is humid...",
      "egress" : [ "3", "16", "17", "18", "21" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/SseSMGuX8gQO"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/SseSMGuX8gQO"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/3",
          "name" : "Floorless Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/16",
          "name" : "Old Waiting Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/17",
          "name" : "Oracle Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/18",
          "name" : "Pit Trap"
        }, {
          "href" : "http://localhost:8080/rooms/keys/21",
          "name" : "Statue Room"
        } ]
      }
    }, {
      "key" : "21",
      "name" : "Statue Room",
      "description" : "In the centre of the room is a statue of a man with his hands held out...",
      "egress" : [ "3", "11", "12", "16", "17", "18", "19", "22", "23" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/rdamxCbg3eHn"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/rdamxCbg3eHn"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/3",
          "name" : "Floorless Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/11",
          "name" : "Room of Absolution"
        }, {
          "href" : "http://localhost:8080/rooms/keys/12",
          "name" : "Great Sacrifice Chamber"
        }, {
          "href" : "http://localhost:8080/rooms/keys/16",
          "name" : "Old Waiting Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/17",
          "name" : "Oracle Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/18",
          "name" : "Pit Trap"
        }, {
          "href" : "http://localhost:8080/rooms/keys/19",
          "name" : "Goblins' Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/22",
          "name" : "Meditation Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/23",
          "name" : "Flooded Storeroom"
        } ]
      }
    }, {
      "key" : "22",
      "name" : "Meditation Room",
      "description" : "This room was originally a meditation room...the walls are ornately decorated...",
      "egress" : [ "11", "12", "21", "23" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/Ghmew7pEYEQD"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/Ghmew7pEYEQD"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/11",
          "name" : "Room of Absolution"
        }, {
          "href" : "http://localhost:8080/rooms/keys/12",
          "name" : "Great Sacrifice Chamber"
        }, {
          "href" : "http://localhost:8080/rooms/keys/21",
          "name" : "Statue Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/23",
          "name" : "Flooded Storeroom"
        } ]
      }
    }, {
      "key" : "23",
      "name" : "Flooded Storeroom",
      "description" : "The stairs leading down are wet and so anyone going down them...",
      "egress" : [ "11", "12", "16", "21", "22", "23" ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/rooms/NDfz2NAC57ip"
        },
        "dungeonRoom" : {
          "href" : "http://localhost:8080/rooms/NDfz2NAC57ip"
        },
        "egress" : [ {
          "href" : "http://localhost:8080/rooms/keys/11",
          "name" : "Room of Absolution"
        }, {
          "href" : "http://localhost:8080/rooms/keys/12",
          "name" : "Great Sacrifice Chamber"
        }, {
          "href" : "http://localhost:8080/rooms/keys/16",
          "name" : "Old Waiting Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/21",
          "name" : "Statue Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/22",
          "name" : "Meditation Room"
        }, {
          "href" : "http://localhost:8080/rooms/keys/23",
          "name" : "Flooded Storeroom"
        } ]
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/rooms"
    },
    "profile" : {
      "href" : "http://localhost:8080/profile/rooms"
    },
    "search" : {
      "href" : "http://localhost:8080/rooms/search"
    }
  }
}

Creating a room

A POST request is used to create a room.

Request fields

Path Type Description Constraints

key

String

map key of dungeon room

Must not be blank

name

String

Name of dungeon room

Must not be blank

egress

Array

connected rooms in the dungeon

description

String

Content and objects in room

Must not be blank

Example request

$ curl 'http://localhost:8080/rooms' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{"key":"42","name":"Secret room","description":"Unknown room","egress":["41a"]}'

Example response

HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: http://localhost:8080/rooms/KQo9ZC2S5CCD

Room

The Room resource is used to retrieve, update, and delete individual rooms

Relation Description

self

This room

dungeonRoom

Link to the room resource

egress

Link to other connected room resources

Retrieve a room

A GET request will retrieve the details of a room

Response fields

Path Type Description

key

String

map key of dungeon room

name

String

Name of dungeon room

egress

Array

connected rooms in the dungeon

description

String

Content and objects in room

_links

Object

Links to other resources

Example request

$ curl 'http://localhost:8080/rooms/BgfHfvlFGzNz' -i -X GET \
    -H 'Accept: application/hal+json'

Example response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 758

{
  "key" : "1",
  "name" : "Orc Guardroom",
  "description" : "In this room are two sets of bunk beds...In the centre is a large battered table...",
  "egress" : [ "2", "4", "5", "6" ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/rooms/BgfHfvlFGzNz"
    },
    "dungeonRoom" : {
      "href" : "http://localhost:8080/rooms/BgfHfvlFGzNz"
    },
    "egress" : [ {
      "href" : "http://localhost:8080/rooms/keys/2",
      "name" : "Rubbish Dump"
    }, {
      "href" : "http://localhost:8080/rooms/keys/4",
      "name" : "Corridor Trap"
    }, {
      "href" : "http://localhost:8080/rooms/keys/5",
      "name" : "Storeroom"
    }, {
      "href" : "http://localhost:8080/rooms/keys/6",
      "name" : "Healing Pool"
    } ]
  }
}

Update a Room

A PATCH request is used to update a Room

Request fields

Path Type Description Constraints

key

String

map key of dungeon room

Must not be blank

name

String

Name of dungeon room

Must not be blank

egress

Array

connected rooms in the dungeon

description

String

Content and objects in room

Must not be blank

Example request

$ curl 'http://localhost:8080/rooms/QZgwYzreztP0' -i -X PATCH \
    -H 'Content-Type: application/hal+json;charset=UTF-8' \
    -d '{"key":"44a","name":"Update room","description":"Update description","egress":["44"]}'

Example response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

Retrieve a room by key attribute

A GET request will retrieve the details of a room

Request parameters

Snippet request-parameters not found for operation::room-keys-example

Example request

$ curl 'http://localhost:8080/rooms/search/keys?key=1' -i -X GET \
    -H 'Accept: application/hal+json'

Example response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 758

{
  "key" : "1",
  "name" : "Orc Guardroom",
  "description" : "In this room are two sets of bunk beds...In the centre is a large battered table...",
  "egress" : [ "2", "4", "5", "6" ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/rooms/BgfHfvlFGzNz"
    },
    "dungeonRoom" : {
      "href" : "http://localhost:8080/rooms/BgfHfvlFGzNz"
    },
    "egress" : [ {
      "href" : "http://localhost:8080/rooms/keys/2",
      "name" : "Rubbish Dump"
    }, {
      "href" : "http://localhost:8080/rooms/keys/4",
      "name" : "Corridor Trap"
    }, {
      "href" : "http://localhost:8080/rooms/keys/5",
      "name" : "Storeroom"
    }, {
      "href" : "http://localhost:8080/rooms/keys/6",
      "name" : "Healing Pool"
    } ]
  }
}