Skip to content

Latest commit

 

History

History
207 lines (132 loc) · 5.17 KB

File metadata and controls

207 lines (132 loc) · 5.17 KB

RESTful Kollchap API Guide

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

Embedded

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

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

Every response has the following header(s):

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:

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

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.

The index provides the entry point into the service.

A GET request is used to access the index

operation::index-example[snippets='response-fields,http-response,links']

The Characters resources is used to create and list characters

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

operation::characters-list-example[snippets='response-fields,curl-request,http-response']

A POST request is used to create a character.

operation::characters-create-example[snippets='request-fields,curl-request,http-response']

operation::characteristics-create-example[snippets='request-fields-characteristics']

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

A GET request will retrieve the details of a character

operation::character-get-example[snippets='response-fields,curl-request,http-response']

A PATCH request is used to update a Character

operation::character-update-example[snippets='request-fields,curl-request,http-response']

The Rooms resources is used to create and list rooms

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

operation::rooms-list-example[snippets='response-fields,curl-request,http-response']

A POST request is used to create a room.

operation::rooms-create-example[snippets='request-fields,curl-request,http-response']

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

A GET request will retrieve the details of a room

operation::room-get-example[snippets='response-fields,curl-request,http-response']

A PATCH request is used to update a Room

operation::room-update-example[snippets='request-fields,curl-request,http-response']

A GET request will retrieve the details of a room

operation::room-keys-example[snippets='request-parameters,curl-request,http-response']