Skip to content

Adding an API

In order for Project X API Gateway to properly serve requests to your API, it needs to be configured.

The configuration starts with adding an API definition.

From OpenAPI file

Project X supports importing OpenAPI specifications. It is the easiest way to get your API up and running on Project X.

  1. Click "Import OpenAPI file".

  2. Choose the subdomain for your API, select the OpenAPI file and click "Submit".

    Note

    By default, Project X let's you choose a subdomain for your API, and the URL to access your API looks like https://<subdomain>.c1-eu-nmbg-hz.projectx.biz/

    Later, you can configure Project X API Gateway to use a custom domain for your API, e.g. https://api.mydomain.com. Learn more.

    The API definition is imported together with all endpoints. If there are several elements in the "servers" array, the first one is used. After importing, please check the correctness of the configuration on the API Settings page.

Manually

Adding a new API

  1. On the API list page click "Add new API".

  2. Fill in the details of the API.

    • Name: the name of your API. This name your customers will see on the checkout page.
    • Base URL: The base URL for all API endpoints.

      The full URL, to which Project X API Gateway will forward users' requests, is formed as Base URL + Endpoint URL.

      Example

      If your API has the following endpoints:

      https://api.mydomain.com/weather-forecast/
      https://api.mydomain.com/current-weather/
      
      then https://api.mydomain.com/ is the base URL.
    • Short description, Full description, Link to your Terms of Service, Link to your API documentation: are shown to your customers on the checkout page.

    • Project X Gateway API subdomain: by default, Project X let's you choose a subdomain for your API, and the URL to access it looks like

      https://<subdomain>.c1-eu-nmbg-hz.projectx.biz/

      Later, you can configure Project X API Gateway to use a custom domain for your API, e.g. https://api.mydomain.com. Learn more.

  3. Click "Submit".

  4. After successfully adding the API, you are redirected to its dashboard.

  5. On the dashboard there is now a Project X API URL that should be used by your customers to make requests to the API.

    To attach a custom domain to your API, check out this page.

Adding endpoints

  1. Go to "Endpoints" section and click "Add new endoint".

  2. Choose a HTTP method and enter the endpoint URL relative to the base URL.

    Example

    If your API has the following endpoints:

    https://api.mydomain.com/weather-forecast/
    https://api.mydomain.com/current-weather/
    
    then https://api.mydomain.com is the base URL and /weather-forecast/ and /current-weather/ are the endpoint URLs.
  3. Path parameters can be used in endpoint URLs. These parameters can be used later, in quota configuration.

    Example

    You can specify endpoint URLs like this:

    GET /weather-forecast/{city}
    
    In this case, you will be able to limit access to weather forecast for certain cities or charge different amounts for different cities.
  4. Click "Submit".

Once all endpoints are added, it's time to set up user authentication.