Getting started overview
This guide outlines the initial steps required to begin using Bored for API mocking. It covers account creation, obtaining necessary credentials, and executing a first successful mock API request. Bored is designed to provide simulated API responses, which can be beneficial for development and testing workflows where a live backend is unavailable or unstable. The platform offers a Developer Plan that includes 5 mocks and 10,000 requests per month, suitable for initial exploration and small projects.
The process generally involves signing up for a Bored account, defining a mock endpoint and its expected response within the Bored dashboard, and then making an HTTP request to the generated mock URL. This allows developers to proceed with frontend development or integration testing without dependency on a fully implemented backend. For a comprehensive understanding of Bored's capabilities, refer to the official Bored documentation.
Here is a quick reference table for the steps involved:
| Step | What to do | Where |
|---|---|---|
| 1. Sign Up | Create a new Bored account. | Bored Homepage |
| 2. Define Mock | Create a new mock endpoint and configure its response. | Bored Dashboard |
| 3. Get Mock URL | Retrieve the unique URL for your mock endpoint. | Bored Dashboard |
| 4. Make Request | Send an HTTP request to the mock URL. | API client (e.g., cURL, Postman) |
| 5. Verify Response | Confirm the mock response is received as expected. | API client |
Create an account and get keys
To begin using Bored, the first step is to create an account. Bored offers a Developer Plan that allows users to get started without immediate financial commitment, providing 5 mocks and up to 10,000 requests per month. This plan is sufficient for evaluating the service and for smaller development tasks.
- Navigate to the Bored Homepage: Open your web browser and go to www.bored.dev.
- Initiate Signup: Look for a 'Sign Up' or 'Get Started Free' button, typically located in the top right corner or prominently displayed on the page.
- Provide Details: You will be prompted to enter an email address and create a password. Some platforms may offer signup via third-party identity providers like Google or GitHub, which can streamline the process.
- Verify Account (if required): After submitting your details, you might receive an email verification link. Click this link to activate your account. This is a standard security measure to confirm ownership of the email address.
- Access the Dashboard: Once your account is activated, you will be redirected to the Bored dashboard. This is your central hub for managing all your mock APIs.
Bored primarily uses unique URLs for each mock endpoint rather than traditional API keys for authentication in most common mocking scenarios. When you create a mock, Bored generates a distinct URL that serves as the endpoint for that specific mock. This approach simplifies access control for public mocks, as the URL itself acts as the access point. For scenarios requiring more secure access or private mocks, Bored's platform may offer additional authentication mechanisms, which would be detailed in the Bored API reference.
For operations within the Bored dashboard itself, your login credentials secure access. For making requests to your mock endpoints, the unique endpoint URL is generally all that is needed. This design choice emphasizes ease of use for rapid prototyping and testing, allowing developers to quickly integrate mock responses into their applications.
Your first request
After successfully creating your Bored account and accessing the dashboard, the next step is to define your first mock endpoint and then make a request to it. This process demonstrates how to simulate an API response for development or testing purposes.
- Create a New Mock:
- In your Bored dashboard, locate and click a button or option to 'Create New Mock' or 'Add Endpoint'.
- You will be presented with fields to define your mock.
- Endpoint Path: Specify the URL path for your mock, for example,
/usersor/products/1. This path will be appended to your base mock URL. - HTTP Method: Select the HTTP method (e.g.,
GET,POST,PUT,DELETE) that your mock should respond to. For a simple first request,GETis commonly used. - Response Body: Enter the JSON, XML, or plain text that Bored should return when this mock is called. For example, for a
GET /usersendpoint, you might enter:{ "id": "123", "name": "John Doe", "email": "[email protected]" } - Status Code: Set the HTTP status code for the response, typically
200 OKfor a successful response. - Save the Mock: Click 'Save' or 'Create Mock' to finalize your configuration.
- Retrieve the Mock URL:
- Once saved, Bored will generate a unique URL for your new mock endpoint. This URL will typically look something like
https://your-subdomain.bored.dev/your-path. - Copy this full URL. This is the endpoint you will send your requests to.
- Once saved, Bored will generate a unique URL for your new mock endpoint. This URL will typically look something like
- Make the Request:
You can use various tools to make an HTTP request. Here are examples using
cURL(command-line) and a conceptual example for a browser:Using cURL (Command Line)
Open your terminal or command prompt and execute the following command, replacing
YOUR_MOCK_URLwith the URL you copied from the Bored dashboard:curl -X GET YOUR_MOCK_URLFor example, if your mock URL was
https://myproject.bored.dev/users, the command would be:curl -X GET https://myproject.bored.dev/usersUsing a Web Browser (for GET requests)
For
GETrequests, you can simply paste the mock URL directly into your web browser's address bar and press Enter. The browser will display the JSON or text response configured in your mock.Using an API Client (e.g., Postman, Insomnia)
If you prefer a graphical interface, API clients like Postman or Insomnia (not in whitelist, linking Postman) provide a user-friendly way to construct and send requests:
- Open your API client.
- Select the
GETHTTP method. - Paste your Bored mock URL into the request URL field.
- Click 'Send' to execute the request.
- Verify the Response:
After making the request, you should see the response body and status code that you defined in your Bored mock. This confirms that your mock is active and correctly serving the simulated data.
Bored's dashboard also typically includes request logging, allowing you to see incoming requests to your mocks and verify that they are being hit as expected. Accessing these logs can be done within the specific mock's details page in the Bored UI, as described in the Bored documentation.
Common next steps
Once you've successfully made your first request to a Bored mock, you can explore more advanced features and integrate Bored into your development workflow. Here are some common next steps:
- Define More Complex Mocks: Beyond simple GET requests, you can define mocks for
POST,PUT, andDELETEmethods. Experiment with different HTTP status codes (e.g.,404 Not Found,500 Internal Server Error) to simulate various API behaviors and test error handling in your application. - Dynamic Responses: Bored often supports dynamic responses, allowing you to use templating languages or simple logic to generate responses based on request parameters, headers, or body content. This is crucial for simulating more realistic API interactions. Consult the Bored API reference for details on dynamic response capabilities.
- Scenario-Based Testing: For comprehensive testing, Bored allows you to define multiple scenarios for a single endpoint. This means you can have the same URL return different responses based on a sequence of requests or specific conditions, which is valuable for testing stateful applications or user flows. This feature is a core aspect of Bored's design, enabling deterministic API testing.
- Request/Response Logging: Utilize Bored's logging features to inspect incoming requests and outgoing responses. This helps in debugging your application's API calls and verifying that the correct data is being sent and received.
- Integrate with Frontend Frameworks: Use your Bored mock URLs directly in your frontend application's API calls. This allows you to develop and test UI components that depend on API data without waiting for the backend to be fully implemented. This is particularly useful for Single-Page Applications (SPAs).
- Collaboration: If working in a team, explore Bored's collaboration features (if available on your plan) to share mock configurations with other developers, ensuring everyone is working against consistent API definitions.
- Explore Paid Plans: If your needs exceed the Developer Plan limits (5 mocks, 10k requests/month) or require advanced features like increased mock capacity, more requests, or dedicated support, consider upgrading to a Pro or Business plan.
Troubleshooting the first call
Encountering issues during your first API call to a Bored mock is common. Here are some troubleshooting steps to help diagnose and resolve potential problems:
- Verify the Mock URL: Double-check that the URL you are using in your request exactly matches the mock URL provided by Bored. Even a small typo can lead to a
404 Not Founderror. Ensure you've copied the entire URL, including any subdomains and paths. - Check HTTP Method: Confirm that the HTTP method (
GET,POST, etc.) used in your request matches the method configured for your mock in the Bored dashboard. AGETrequest to a mock configured forPOSTwill not yield the expected response. - Inspect Request Body/Headers: If your mock is configured to expect specific headers or a request body, ensure your client is sending them correctly. For
POSTorPUTrequests, verify that theContent-Typeheader (e.g.,application/json) is set appropriately if you're sending a JSON body. - Review Bored Dashboard Logs: Bored typically provides request logs within its dashboard. Navigate to your specific mock and look for a 'Logs' or 'Activity' section. These logs can show if a request reached Bored, what method and path were used, and any errors Bored encountered while processing it. This is often the most direct way to identify discrepancies between your request and the mock's configuration.
- Firewall or Network Issues: Ensure that your local network or any corporate firewalls are not blocking outbound HTTP/HTTPS requests to
*.bored.dev. If you're working in a restricted environment, you might need to consult your IT department. - Account Status and Limits: Verify that your Bored account is active and that you haven't exceeded any limits of your current plan (e.g., number of active mocks, monthly request volume). The Bored pricing page details plan limits.
- Syntax Errors in Response Body: If your mock is configured with a JSON or XML response, ensure there are no syntax errors in the body you defined. Invalid JSON, for example, might be rejected by some clients or cause unexpected parsing issues. Use an online validator if unsure.
- Browser Caching: If testing GET requests in a browser, browser caching might sometimes interfere. Try clearing your browser cache or using an incognito/private browsing window to ensure a fresh request.
- Consult Bored Documentation: For detailed error codes or specific troubleshooting guides, refer to the official Bored documentation. The documentation often contains specific solutions for common issues and a more in-depth explanation of how mocks are processed.