Employees, office pranks and quotes from a fictional paper company mockumentary. Practice CRUD, Bearer auth, nested resources, pagination and optimistic concurrency.
The Office API covers a paper company: employees, the pranks played on them and a quote collection. It is one of the gentler CRUD surfaces in the catalog and a reasonable first target when you are teaching someone the request/response loop before introducing auth, concurrency or error injection.
Base URL: https://funapi.dev/api/office/v1 · 8 endpoints · OpenAPI 3.1 spec and Postman collection available. New here? Read the getting started guide.
GET https://funapi.dev/api/office/v1/employees — List employees (paginated, filter by department). No token, no signup:
curl -i https://funapi.dev/api/office/v1/employees
answers 200 OK with:
{
"page": 1,
"pageSize": 4,
"total": 8,
"totalPages": 2,
"data": [
{
"id": 1,
"name": "Michael Scott",
"role": "Regional Manager",
"department": "Management",
"deskNumber": 1,
"_v": 1
},
{
"id": 2,
"name": "Dwight Schrute",
"role": "Assistant to the Regional Manager",
"department": "Sales",
"deskNumber": 2,
"_v": 1
},
{
"id": 3,
"name": "Jim Halpert",
"role": "Sales Representative",
"department": "Sales",
"deskNumber": 3,
"_v": 1
},
{
"id": 4,
"name": "Pam Beesly",
"role": "Receptionist",
"department": "Reception",
"deskNumber": 4,
"_v": 1
}
]
}
eight desks, one regional manager
GET /office/v1/employees — List employees (paginated, filter by department) · Responds with 200 400 404 Link to this endpointGET /office/v1/employees/{id} — Get one employee · Responds with 200 404 Link to this endpointGET /office/v1/employees/{id}/pranks — Get pranks involving an employee (nested resource) · Responds with 200 404 Link to this endpointPOST /office/v1/employees — Hire a new employee (requires Bearer auth) · Responds with 201 400 401 Link to this endpointPUT /office/v1/employees/{id} — Update an employee (requires Bearer auth) · Responds with 200 400 401 404 412 Link to this endpointDELETE /office/v1/employees/{id} — Fire an employee (requires Bearer auth) · Responds with 204 401 403 404 412 Link to this endpointmostly aimed at one assistant (to the) regional manager
GET /office/v1/pranks — List pranks, filter by severity · Responds with 200 400 Link to this endpointthat's what she said
GET /office/v1/quotes/random — A random quote · Responds with 200 Link to this endpointUnofficial and fan-made. The The Office API is a practice API that borrows a theme; it is not affiliated with, sponsored or endorsed by the owners of the names it references, which belong to them. Every record it returns is test data for exercising HTTP behaviour, not an authoritative source on the subject.
Last updated