Getting started overview

QuickMocker provides a web-based platform for creating mock APIs that simulate real API responses, supporting development, testing, and prototyping workflows. The process for getting started with QuickMocker includes account creation, setting up API credentials, and configuring your initial mock endpoint. This guide outlines the steps to perform a first working request, covering the initial setup and basic usage required to begin simulating API interactions.

To begin, users typically navigate to the QuickMocker website to register, then proceed to define a new mock API project within their dashboard. Each mock API can contain multiple endpoints, configured with specific HTTP methods, response bodies, and headers. The platform's official documentation provides detailed setup instructions and examples.

Here's a quick reference for the initial steps:

Step What to Do Where
1. Sign Up Create a QuickMocker account QuickMocker homepage
2. Create Mock API Define a new mock API project QuickMocker Dashboard
3. Add Endpoint Configure an endpoint (path, method, response) Mock API settings in Dashboard
4. Get Endpoint URL Retrieve the unique URL for your mock endpoint Mock API settings in Dashboard
5. Test Request Send an HTTP request to the mock endpoint Client application, cURL, or API testing tool

Create an account and get keys

The first step to using QuickMocker involves creating a user account. You can register for a free plan which includes 1 mock API with 100 requests per day and 5 endpoints. More extensive usage requires a paid subscription.

  1. Navigate to QuickMocker: Open your web browser and go to the QuickMocker website.

  2. Sign Up: Locate and click the "Sign Up" or "Get Started Free" button. You will typically be prompted to enter an email address and create a password, or sign up using a third-party identity provider like Google.

  3. Verify Email: After registration, QuickMocker may send a verification email to the address you provided. Follow the instructions in the email to activate your account.

  4. Dashboard Access: Once verified, log in to access your QuickMocker dashboard. This is where you will manage all your mock APIs.

  5. API Keys (for programmatic access): QuickMocker provides an API for programmatic control over your mock APIs. To use this, you'll need an API key. In your dashboard, navigate to your account settings or API key management section. Generate a new API key and keep it secure, as it grants access to your QuickMocker resources. This key is typically used in the X-QuickMocker-ApiKey header for authentication with the QuickMocker API itself, not for making requests to your mock endpoints.

Your first request

After creating an account, you can set up your first mock API and endpoint. This process involves defining the expected response that QuickMocker will return when the endpoint is called.

  1. Create a New Mock API:

    • From your QuickMocker dashboard, click on "Create New Mock API" or a similar button.
    • Provide a descriptive name for your mock API (e.g., "My First Service").
    • Click "Create." This action provisions a base URL for your mock API.
  2. Add an Endpoint:

    • Within your newly created mock API, look for an option to "Add Endpoint" or "New Endpoint."
    • Set Path: Define the URL path for your endpoint (e.g., /users or /data).
    • Select HTTP Method: Choose the HTTP method this endpoint should respond to (e.g., GET, POST). For a simple data retrieval, GET is common.
    • Configure Response:
      • Status Code: Enter the desired HTTP status code (e.g., 200 for success).
      • Headers: Optionally add custom HTTP headers (e.g., Content-Type: application/json).
      • Body: Provide the JSON, XML, or plain text response body. For example, for a GET /data endpoint, you might enter:
        {
          "message": "Hello from QuickMocker!",
          "status": "success"
        }
    • Save the endpoint configuration.
  3. Retrieve Mock Endpoint URL:

    • After saving, QuickMocker will display the full URL for your new endpoint. This URL typically follows the pattern https://api.quickmocker.com/v1/mock/YOUR_MOCK_API_ID/YOUR_ENDPOINT_PATH. Copy this URL.
  4. Make the First Request:

    Use a tool like cURL, Postman, Insomnia, or directly from your client-side application to send a request to your mock endpoint URL. For example, using cURL:

    curl -X GET https://api.quickmocker.com/v1/mock/YOUR_MOCK_API_ID/data

    If configured correctly, QuickMocker will return the response body and headers you defined for the /data endpoint with a 200 OK status.

Common next steps

After successfully making your first mock API request, consider these common next steps to extend your use of QuickMocker:

  • Explore Dynamic Responses: QuickMocker supports dynamic data using templating engines. You can generate varied responses based on request parameters, headers, or even random data. This is useful for simulating more realistic API behaviors, such as pagination or unique IDs per request. The QuickMocker documentation on dynamic responses provides examples.

  • Add Multiple Endpoints: Expand your mock API to include multiple endpoints for different resources (e.g., /users, /products, /orders) and various HTTP methods (GET, POST, PUT, DELETE) to simulate a complete API surface.

  • Simulate Error Scenarios: Configure endpoints to return specific HTTP error codes (e.g., 400 Bad Request, 401 Unauthorized, 404 Not Found, 500 Internal Server Error) and corresponding error messages. This helps in testing how your client application handles API failures. This aligns with recommended HTTP status code usage for API design.

  • Protect Endpoints: Implement basic authentication or API key checks on your mock endpoints if your client application expects them. QuickMocker allows adding custom header checks to simulate security mechanisms.

  • Integrate with CI/CD: For automated testing, consider integrating QuickMocker into your Continuous Integration/Continuous Deployment pipeline. The QuickMocker API reference allows you to programmatically manage your mock APIs, enabling automated setup and tear-down of mock environments.

  • Share Mock APIs: Collaborate with team members by sharing access to your mock APIs, making it easier for frontend and backend teams to work in parallel.

Troubleshooting the first call

If your first request to a QuickMocker endpoint does not behave as expected, consider the following troubleshooting steps:

  • Verify Endpoint URL: Double-check that the URL you are requesting precisely matches the mock endpoint URL provided by QuickMocker. Any typos or missing segments will result in a 404 Not Found or similar error.

  • Check HTTP Method: Ensure the HTTP method (GET, POST, PUT, DELETE) used in your request matches the method configured for the QuickMocker endpoint. A mismatch will prevent the endpoint from responding as expected.

  • Examine QuickMocker Dashboard Logs: QuickMocker typically provides request logs within your dashboard for each mock API. Review these logs to see if your request reached QuickMocker, what parameters it included, and what response QuickMocker attempted to send. This can reveal configuration errors.

  • Review Endpoint Configuration: Go back to the specific endpoint in your QuickMocker dashboard and review its settings: path, method, status code, headers, and response body. Ensure everything is as intended.

  • Content-Type Headers: If your mock response is JSON or XML, make sure you've included the appropriate Content-Type header (e.g., application/json) in the mock endpoint's response configuration. Similarly, if sending a POST request with a JSON body, ensure your client request includes Content-Type: application/json.

  • Rate Limiting/Free Plan Limits: If you are on the free plan, you are limited to 100 requests per day. Exceeding this limit will result in specific error responses. Check your dashboard for current usage statistics.

  • Network Issues: Confirm that your local network or firewall is not blocking outbound requests to QuickMocker's domains. A simple test against a well-known public API (e.g., Cloudflare Workers AI list models) can help rule out general network connectivity issues.

  • Browser Cache (if testing from browser): If testing directly from a browser, clear your browser cache or use an incognito/private browsing window, as cached responses can sometimes interfere with testing live changes.