Consuming your API
Learn how to integrate your Mock66 endpoints into your applications securely and reliably.
Endpoint Structure
Mock66 assigns a unique subdomain to every project. This keeps your endpoints clean and isolated.
- project-idYour unique project identifier (e.g.,
proj_abc123). You can find this in your Project Settings. - /pathThe specific route you defined in the dashboard (e.g.,
/usersor/products/123).
Authentication
By default, endpoints in a project are either public (read-only) or protected depending on your project settings. To secure your access, enable API Key authentication. When enabled, every request to your endpoints must include the x-mock66-api-key header or query parameter with a valid API Key.
Cleaner and more secure. Keeps your key out of browser history.
Useful for quick browser testing or simple GET requests.
CORS & Frontend Usage
Mock66 is built for frontend development. We automatically handle CORS (Cross-Origin Resource Sharing) headers so you can fetch data directly from localhost or your deployed app without configuration.
React / Fetch Example
Error Codes
While standard requests return 200 OK (or whatever status you configured), you might encounter system errors:
| Status | Meaning |
|---|---|
| 401 Unauthorized | Missing or invalid API Key. Check your x-mock66-api-key header. |
| 404 Not Found | The endpoint path does not exist in your project configuration. |
| 429 Too Many Requests | You have exceeded your plan's request limits. |
| 500 Internal Error | Something went wrong with the data generator (e.g., Infinite recursion depth exceeded). |