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:
- Get the
mockApiBaseURL from the request metadata - Append the endpoint path from the brief instructions
- Make the HTTP request (GET, POST, etc.)
- 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:
| Endpoint | Method | Description |
|---|---|---|
| /users/:id | GET | Fetch user details by ID |
| /orders | GET | List all orders |
| /orders | POST | Create a new order |