Configure an external API

In this topic, you learn how to configure an API to communicate with an API outside DXP - Open Edition.

Prerequisites

  • There are no prerequisites.

Procedure

In this procedure we use sample data from the Star Wars universe. You can exchange our data with your data in the procedure.
  1. In the Cockpit, go to Connectivity and select API Designer.

  2. In the API Designer, select Create.

    Result: The Create API opens.

  3. In Type, select External.

  4. In API Format, Swagger 2.0 is preselected. You can select the newer version, Open API 3.0, here.

  5. Enter a Name for your external API.

  6. In Endpoint, enter the URL of the external API, for example, https://swapi.dev/api.

    Do not put a slash / at the end of the endpoint.
  7. Select Create.

    Result: The API configuration window opens. You start in the General tab.

  8. If you have created a development package or connectivity group for your APIs, you can select those from the Group or Package drop-down menu.

  9. Enter a short and meaningful Description to your API.

  10. In Version, enter a version number, for example, 1.0, to keep track of changes to the API.

  11. In Media Type, define the type of content of your API. This is needed to communicate with your browser. By default, it is application/json.

  12. Activate any of the following options that fit your application:

    Allow Untrusted Certificates

    Allowing SSL/TLS certificates from servers that may not be considered "trusted".

    Enable Proxy (Prevent CORS & Add API Authentication)

    The API request is routed through the Neptune DXP - Open Edition server to prevent CORS issues.

    Restrict Access

    Restrict access to all operations. This can only be accessible when Enable Proxy is enabled.

    Enable Trace

    Allow tracing activities of your API. You can see activities in the API Trace.

    Use in App Designer & App Editor

    Allow this API to be used in the App Designer or App Editor.

    Forward Proxy

    If Enable Proxy (Prevent CORS & Add API Authentication) is enabled, you can optionally configure requests sent from the Neptune Open Edition server to be routed through a proxy. The environment variables HTTP_PROXY and HTTPS_PROXY will apply to all requests to external resources sent from the Neptune DXP - Open Edition server. The forward proxy will route requests for this specific API through the proxy configured in Forward Proxy, taking precedence over to HTTP_PROXY and HTTPS_PROXY, if set.

  13. Select Save.

Results

  • Your API is saved with the current settings and is added to the library in the API Designer.

  • The API Designer adds an ID to your API and saves change dates.

Next steps