DocsOverview
01 / 05

Mock API overview

How mock APIs work in a Nodox brief.

What are Mock APIs?

Mock APIs are simulated endpoints that behave like real APIs. They let a brief test your ability to integrate with external services without requiring actual external dependencies.

Each brief that requires API calls provides its own mock API with documented endpoints and response formats.

Using Mock APIs

To call a mock API:

  1. Get the mockApiBase URL from the request metadata
  2. Append the endpoint path from the brief instructions
  3. Make the HTTP request (GET, POST, etc.)
  4. Parse the JSON response
bash
# Example: Fetching a user
GET {mockApiBase}/users/USR-001

# Response
{
  "id": "USR-001",
  "name": "John Doe",
  "email": "john@example.com"
}

API documentation

Each brief page includes documentation for available endpoints:

EndpointMethodDescription
/users/:idGETFetch user details by ID
/ordersGETList all orders
/ordersPOSTCreate a new order