Skip to main content

Version: latest

Try an API

The Developer Portal includes a built-in API testing feature that lets you send requests to API endpoints directly from your browser. This helps you explore and validate APIs before integrating them into your applications.

Prerequisites

  • A Developer Portal account with an active status.
  • An application subscribed to the API product you want to test.
  • A valid credential that matches the API product's authentication type.

Send a Test Request

  1. Log in to the Developer Portal.

  2. Navigate to the API Hub and select the API product.

  3. Browse to the endpoint you want to test.

  4. Click Try It Out (or Test Request).

  5. The authentication type is pre-selected based on your credentials. If the API product supports multiple authentication types, select the one that matches your credential.

  6. Your credential is automatically populated (for example, the API key or basic auth credentials).

  7. Configure the request parameters:

    ParameterDescription
    Path parametersFill in required URL path segments.
    Query parametersAdd query string parameters.
    HeadersAdd or modify request headers.
    Request bodyEnter the request body for POST, PUT, and PATCH requests.
  8. Click Send.

Review the Response

After sending a request, the portal displays:

  • Status code: The HTTP response status (for example, 200, 401, 404).
  • Response headers: The HTTP headers returned by the server.
  • Response body: The response payload, formatted for readability.

Troubleshooting

CORS Errors

When testing APIs from the browser, you may encounter CORS (Cross-Origin Resource Sharing) errors. This happens because browsers enforce CORS restrictions and send a preflight OPTIONS request. If the gateway route does not allow the OPTIONS method or the CORS plugin is not enabled, the browser blocks the request.

To resolve CORS errors:

  • Ask the API provider to enable the cors plugin on the relevant routes or globally.
  • When the CORS plugin is configured globally, preflight OPTIONS requests are handled automatically.

Authentication Errors

If you receive a 401 Unauthorized response:

  1. Verify that your subscription is active (not pending approval).
  2. Verify that your credential type matches the API product's authentication type.
  3. If using OAuth, verify that your access token is not expired.
  4. If using key authentication, verify that the API key is correct and has not been regenerated.

Endpoint Not Found

If you receive a 404 Not Found response:

  1. Verify that the endpoint path matches the API documentation.
  2. Verify that the Host header matches one of the hosts configured on the linked service.
  3. Check that the HTTP method matches the endpoint specification.

Additional Resources

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation