Building API Proxies

Objective

After completing this lesson, you will be able to create an API based on the API provider.

Creation of APIs Proxy Based on API Provider

In this lesson, we will cover the following topics:

  • What are the possibilities for creating an API Proxy?
  • Create an API Proxy using Create button.
  • Create an API Proxy using Menu links.

What are the possibilities for creating an API Proxy?

Creating an API Proxy is important for further implementations.

Here are the options available for creating an API Proxy:

Create an API Proxy using Create button with the following options:
  • API provider (marked as 1 in the component diagram)
  • URL (marked as 3 in the component diagram)
  • API proxy
Create an API Proxy using menu links with the following options:
  • Create in API Designer (marked as 2 in the component diagram)
  • Import an external API Proxy
The diagram shows the options using the Create button.
API flowchart showing various sources like internet, On-prem, and methods to create API Proxy from URL, API Proxy, and importing *.zip, *.json files in API Designer.

Create an API Proxy Using Create Button

This is probably the most common case. With this option, you can create an API Proxy with an API provider, a provided URL, or an existing API Proxy.

Procedure

Start with DesignAPIs to open the Develop screen.

Start the wizard by choosing the Create button. A new window opens.Screenshot of the Configure page with API Proxies, APIs, and Create buttons.

Use the API Provider option.

Flowchart diagram showing relationships among internet, API Provider, API (Proxy), On Prem, Cloud Integration, Open Connectors, URL, API Proxy, API Designer, zip and json files.

Select the API Provider radio button and open the selected box. All API providers will be displayed. Choose one, for example, SAPGatewayDemoSystemES5_Provider.

Screenshot of the Create API interface showing fields such as Select, API Provider, Name, Title, Short Text, API State, Host Alias, API Base Path, Version, and buttons to Create or Cancel.

When the API Provider is chosen, a new list box with the name Discover is available. Some data, such as the host and the type of API, has already been entered.

When the list box is chosen, all available services listed within the catalog service are displayed.

What exactly is displayed here depends on the type of API Provider. In the case of Open Connectors, for example, all instances are displayed. For the type Cloud Integration, the available integration flows are displayed.

The following figure shows a list of available services usable from the SAP backend system. The API provider is defined by choosing one service from the provided catalog of services.

Screenshot of a list of available services in an SAP backend.

You can choose exactly one of the offered services. After that, further data is added to the mask.

A screenshot of an API Provider creation form with fields for API Provider, URL, Name, Title, API State, Host Alias, API Base Path, and Service Type. Create and Cancel buttons are visible at the bottom.

When you finish creating this API proxy, it has to be deployed so that it can be used. After that, the API proxy is ready for testing. The service type is automatically defined. In this case, it is OData.

Use the URL Option to Create an API Proxy

In case you do not use an API provider, you can directly specify the URL of your source.

A flowchart depicting API creation paths from various sources like API Provider, URL, API Proxy, and API Designer.

In this case, you need to enter the data manually. The Service Type can only be REST or SOAP.

Screenshot of the different service types.

After saving and deploying the API Proxy, it can also be tested.

Use the API Proxy Option to Create an API

In this case, you can copy an existing API proxy.

Screenshot of existing APIs.

In this case, you need to enter the data manually. The Service Type can only be REST or SOAP, even if the spied API proxy is from type OData.

Create an API Proxy Using Menu Links

Flowchart showing API Provider creating API (Proxy) with options: URL, API Proxy, API Designer, or importing API file formats (*.zip, *.json). Types of API Providers are Internet, On Prem, Cloud Integration, Open Connectors.

Use the Create in API Designer Option

Start creating an API Proxy by choosing the menu link, Create in API Designer.

Choose Create in API Designer.

Switch to the openAPI editor. You can manually create your API Proxy in the editor through the openAPI language in YAML. In this case, all entries must be created manually. The server URL is automatically adjusted after saving. The Service Type can only be REST.

Before Saving

Screenshot of Swagger editor with highlighted server URL, showing OpenAPI definition for a sample Petstore server, including endpoint to add a new pet.

After Saving

Note

The shown URL is a sample and does not work.

A Swagger API document defines the OpenAPI version, server information, and paths for pet-related operations. The server URL is highlighted in a red box.

Import an External API Proxy

A flow chart showing API Provider connected to Internet, On Prem, Cloud Integration, Open Connectors. API (Proxy) connected to API Designer, URL, API Proxy, *zip,*json. API Proxy connected to API Providers.

Start the creation of an API proxy by choosing the menu link, Import API proxy.

Choose Import API.

The Service Type corresponds to the imported API proxy.

Resource

Help Portal: Create an API Proxy

Summary

There are several ways to create an API proxy. API proxies can be created:

  • By using the Create button.
  • Based on an existing API provider.
  • Directly through the provided URL.

Finally, you can also define it with an openAPI specification via the Create button in API Designer.

Create an API Proxy Based on a Predefined API Provider

Business Scenario

In this exercise, you will learn to establish a connection between the API provider, indicated in green, and a new API proxy that we are developing within the API Management. The subsequent connection and associated artifacts that emerge from this process are marked in red within the component diagram.

Screenshot of the semantic overview with the subsequent connection and associated artifacts that emerge from this process marked in red.

Task Flow

In this exercise, you will perform the following tasks:

  1. Create an API proxy.
  2. Test the API proxy.

Prerequisites

You have successfully completed the previous exercises.

Exercise Outcome

You have a working API based on the API provider from the ES5 system. This allows APIs to be called from the ES5 system.

What will you learn from this exercise?

You can create and configure an API proxy based on an API provider. This allows you to call the GWSAMPLE_BASIC OData interface on the ES5 backend system.