API example documentation
Plain and easy to read HTML documentation of your HTTP APIs
Table of contentsPath /
Root resource users
List all users
HTTP/1.1 GET /
HTTP/1.1 200 OK
Content-Type: application/json
Correlation-Id: 6589408076449598657
{
"users": [
{
"name": "John Doe",
"age": 42
},
{
"name": "Mat Whyat",
"age": 14
},
{
"name": "Lisa Whyat",
"age": 18
}
]
}
Filter user by name
HTTP/1.1 GET /?name=John
HTTP/1.1 200 OK
Content-Type: application/json
Correlation-Id: 6589408076449598657
{"users":[{"name":"John Doe","age":42}]}
HTTP/1.1 GET /?name=Whyat
HTTP/1.1 200 OK
Content-Type: application/json
Correlation-Id: 6589408076449598657
{"users":[{"name":"Mat Whyat","age":14},{"name":"Lisa Whyat","age":18}]}
It's also possible to filter using the POST method
HTTP/1.1 POST /
{"name":"John"}HTTP/1.1 200 OK
Content-Type: application/json
Correlation-Id: 6589408076449598657
{
"users": [
{
"name": "John Doe",
"age": 42
}
]
}
Accept text/html
HTTP/1.1 GET /?name=John Accept: text/html
HTTP/1.1 200 OK
Content-Type: text/html
<!DOCTYPE html>
<html>
<body>
{[{John Doe 42}]}</body>
</html>
Undefined path
HTTP/1.1 GET /unknown/
HTTP/1.1 404 Not Found
Headers
Correlation-Id
Random string uniq for each request
Response
users
Array of user object, may be empty
name
String of max len 64
age
Uint8