Create an API in the Hub API Designer

Learn how to design, set up, and deploy an SAP API using the Hub API Designer, including connecting your SAP system as a defined remote system, defining back-end logic, and structuring requests and responses within the SAP Integration Hub framework.

Prerequisites

Procedure

Create API

  1. In the Cockpit, select the Hub API Designer.

    Result: A list of all APIs from all configured remote systems of type Neptune DXP - SAP Integration Hub displays.

  2. Select Create.

    Result: The Create new API dialog opens.

  3. In Remote System, select a configured remote system.

  4. In API name, enter a meaningful name for your API.

  5. In DPC class name, select the DPC class associated with the remote system, as it provides the back-end ABAP class logic that handles API requests and responses that implement the interface /NEPTUNE/IF_DXP_API_DPC.

  6. Select Create.

    Result: You are navigated to the General tab of your API.

  7. In Path, define the endpoint by entering a unique path for the API.

  8. In Package, assign your API to a development package the enables transport to another deployment stage system.

In the sections Metadata SAP and Metadata External System, any metadata from your connected remote SAP system/external system, if available, are prefilled in the displayed fields.

Configure API operations

  1. Go to the Operations tab and select the + (Plus) icon to add a new operation for the API.

  2. In the Operation tab, in Path, define an endpoint for the API operation.

  3. In Method HTTP, define the HTTP method for the API operation to perform.

  4. In Method DPC Class, select the data provider class to specify which back-end logic will process the API operation.

  5. In the Request tab, in Binding Type, select one of the following to determine how the system reads the incoming request by either back-end ABAP logic or manual handling:

    1. DPC class binding: For standard, structured APIs where the back-end ABAP class handles the request.

    2. Manual binary content: To provide the request as raw binary data.

    3. Manual text content: To provide the request as raw text.

  6. In Content Type, determine what format the request data is in, by selecting one of the following:

    1. For the binding type DPC class binding:

      • application/json: To provide the request data in JSON format

      • multipart/form-data: To send multiple data parts in one request, such as text fields and file uploads together

    2. For the binding types Manual binary content and Manual text content:

      • application/json: To provide the request data in JSON format

      • application/octet-stream: To transfer raw binary data when the file type is unknown or generic

      • application/pdf: To send or receive a PDF document directly through the API

      • multipart/form-data: To send multiple data parts in one request, such as text fields and file uploads together

      • text/html: To exchange simple, unformatted text without structured fields

      • text/plain: To send or return HTML-formatted content, such as markup to be displayed in a browser

  7. Review the Public Attributes and Method Signature sections to define how the request data is sent. If DPC class binding for mapped fields is selected, select the checkboxes to decide whether each listed element should be passed in the query (as a URL parameter) or in the body (as structured request data) to ensure the API request matches the expected data structure of the back-end class.

  8. In the Response tab, perform the setup actions following the same principle, using In Response Body to indicate which elements from the back end are included in the API’s returned data, and enable Compress to reduce the response size for faster transmission.

Save API, prepare API for transport, validate API

  1. When you have configured the API operations, select Save.

    Result: You are prompted to assign the API to a transport request to transport the API configuration across deployment stage environments.

  2. Select the appropriate transport request from the selection.

  3. In the Swagger UI tab, use the integrated Swagger UI to validate the API operations and verify that requests and responses behave as expected.

Results

  • You have fully defined and validated the API, linking it to the back-end SAP system, so it correctly processes requests and returns responses according to your configured operations.

  • The API is transportable across SAP environments and ready for productive use, allowing external applications or users to reliably interact with your back-end logic.