Person Routes

GET
/person/:id

Gets a single person based on their id   

Parameters
Name Type Default Description
id integer N/A the id of the person to get uniquely identifies the person
Headers
Name Description
X-Custom-Header This header is always required for the person route It always alters the route
Response Examples

200 OK

{
id: 1,
name: 'John Smith',
age: 22
}

POST
/person

Adds a new person and returns their id.   

Parameters
Name Type Default Description
name string N/A The name of the new person to create
age integer 0 The age of the new person (default 0)
Response Examples

201 CREATED

3904

PUT
/person/:id

Updates the person's age.   

Parameters
Name Type Default Description
id integer N/A The id of the person
age integer N/A The age of the person

DELETE
/person/:id

Deletes the person   

Parameters
Name Type Default Description
id integer N/A The id of the person to delete