Overview

HTTP REST JSON API

This is a demo documentation generated by tinyspec — simple syntax for describing REST APIs.

Version information

Version : 1.0.0

URI scheme

Host : example.com
BasePath : /
Schemes : HTTPS

Tags

  • General endpoints

  • Admin endpoints

  • Guest endpoints

Consumes

  • application/json

Produces

  • application/json

Resources

General Endpoints

List users

GET /users
Description

List users

Responses
HTTP Code Schema

200

Response 200

Response 200

Name Schema

users
required

< User > array

Admin Endpoints

Create new user

POST /users
Description

Create new user

Parameters
Type Name Schema

Body

body
required

body

body

Name Schema

user
required

UserNew

Responses
HTTP Code Schema

201

Response 201

Response 201

Name Schema

user
required

User

Security
Type Name

apiKey

token

List and filter extended colors

GET /colors
Description

List and filter extended colors

Parameters
Type Name Schema

Query

filter
required

string

Query

page
required

integer

Responses
HTTP Code Schema

200

Response 200

Response 200

Name Schema

colors
required

< ColorExtended > array

totalCount
required

integer

Security
Type Name

apiKey

token

Create new color

POST /colors
Description

Create new color

Parameters
Type Name Schema

Body

body
required

body

body

Name Schema

color
required

ColorNew

Responses
HTTP Code Schema

201

Response 201

Response 201

Name Schema

color
required

Color

Security
Type Name

apiKey

token

Retrieve color

GET /colors/:id
Description

Retrieve color

Parameters
Type Name Schema

Path

id
required

string

Responses
HTTP Code Schema

200

Response 200

Response 200

Name Schema

color
required

Color

Security
Type Name

apiKey

token

Delete color

DELETE /colors/:id
Description

Delete color

Parameters
Type Name Schema

Path

id
required

string

Responses
HTTP Code Schema

200

Response 200

Response 200

Name Schema

success
required

boolean

Security
Type Name

apiKey

token

Update color

PATCH /colors/:id
Description

Update color

Parameters
Type Name Schema

Path

id
required

string

Body

body
required

body

body

Name Schema

color
required

ColorUpdate

Responses
HTTP Code Schema

200

Response 200

Response 200

Name Schema

color
required

Color

Security
Type Name

apiKey

token

Retrieve user

GET /users/:id
Description

Retrieve user

Parameters
Type Name Schema

Path

id
required

string

Responses
HTTP Code Schema

200

Response 200

Response 200

Name Schema

user
required

User

Security
Type Name

apiKey

token

Delete user

DELETE /users/:id
Description

Delete user

Parameters
Type Name Schema

Path

id
required

string

Responses
HTTP Code Schema

200

Response 200

Response 200

Name Schema

success
required

boolean

Security
Type Name

apiKey

token

Update user

PATCH /users/:id
Description

Update user

Parameters
Type Name Schema

Path

id
required

string

Body

body
required

body

body

Name Schema

user
required

UserUpdate

Responses
HTTP Code Schema

200

Response 200

Response 200

Name Schema

user
required

User

Security
Type Name

apiKey

token

Guest Endpoints

List colors

GET /colors (guest)
Description

List colors

Responses
HTTP Code Schema

200

Response 200

Response 200

Name Schema

colors
required

< Color > array

Definitions

User

Name Schema

id
required

integer

name
required

string

email
required

string

favoriteColors
optional

< Color > array

UserNew

Name Schema

name
required

string

email
required

string

UserUpdate

Name Schema

name
optional

string

email
optional

string

favoriteColorIds
optional

< integer > array

Color

Name Schema

name
required

string

code
required

string

ColorNew

Name Schema

name
required

string

code
required

string

ColorUpdate

Name Schema

name
optional

string

code
optional

string

ColorExtended

Name Schema

name
required

string

code
required

string

id
required

integer

createdAt
required

string (date-time)

updatedAt
optional

string (date-time)

channels
required

channels

primaryChannel
required

enum (red, green, blue)

channels

Name Schema

red
required

integer

green
required

integer

blue
required

integer

Security

token

Type : apiKey
Name : Authorization
In : HEADER