API Management in SAP CPI

Hello Friends if you are looking for API Management in step by step in SAP CPI / Step by Step Procedure to Management in SAP CPI / How to Handle API in CPI in SAP / API Management Tutorial in SAP CPI then you will get answers.

API Management in SAP CPI (SAP Cloud Integration) refers to the use of SAP API Management, a capability within the SAP Integration Suite, to manage, secure, monitor, and publish APIs that are built using SAP CPI (or other backend like S/4HANA, ECC, third-party systems).

SAP CPI helps you build and expose APIs, but API Management gives you the tools to control those APIs by:

● Securing access (API Keys, OAuth, JWT, etc.)
● Monitoring traffic (usage, errors, latency)
● Limiting usage (rate limiting, quotas)
● Analyzing performance (dashboards, logs)
● Monetizing APIs (optional in advanced cases)

All the standard APIs are available in API Business Accelerator Hub/ API Business Hub

API Management in SAP CPI

Building blocks in SAP API Management:​

1. API Provider

“Where the real backend lives”

Think of this as the connection setup to your backend system, like SAP CPI, S/4HANA, or
any third-party system.

  • It defines where your actual service or integration is running.
  • You create it once and reuse it while creating multiple APIs.

Example:​
create an API Provider for SAP CPI with host URL:​
https://your-cpi-tenant.hana.ondemand.com

2.API Proxy

“The public-facing version of your API”

An API Proxy is a wrapper around your real API (hosted on CPI, for example). This is where
you apply policies like security, quota, or rate limiting.

  • External consumers never call your CPI directly — they call the API Proxy.
  • You can apply API key check, OAuth, etc., here.

Example:​

real CPI endpoint:​
https://your-cpi-tenant.com/http/customerdata​

Your API Proxy (what the consumer sees):​
https://api.sap.com/v1/customerdata

3.API Product

“A bundle of APIs with access rules”

An API Product is a package of one or more API Proxies that you want to offer to a consumer
(like a partner or another developer).

  • You define quotas, rate limits, and monetization options here.
  • Products are published on the Developer Portal.
  • Developers subscribe to a product to get an API key to access the APIs.

Example:​
create an API Product called Customer Services which includes:

  • Customer Data API Proxy
  • Customer Orders API Proxy

1.​ Configure

2.​ API Provider
3.​ Create​

4.​ Connection​

5.​ Catalog Service Settings​

For username and password ->​
Create an account on the SAP Gateway Demo System.​
Check here: https://developers.sap.com/tutorials/gateway-demo-signup.html​

6.​ Save​

7.​ Test Connection​

Creation of API Provider is successful.​

8.​ Create API Proxy

Select API Provider from dropdown.​

Discover shows list of API Proxies available.​

Search for GWSAMPLE_BASIC and click OK.​

9.​ Can change Name and Title if it already exists.​

Click on Create.​
API Proxy is created successfully.

10.​ Save.​

11.​ Deploy​

12.​Test API Proxy​

13.​ Add an API Proxy to a Product​

14.​ Create new Product​

15.​ Add APIs​

It will show a list of all API Proxies available.​
Select the one we created.​

16.​ Publish​

17.​ The product is now available​

18.​ See the product​

19.​ Protect API Proxy by Adding Application Key Verification​

20.​ Edit​

21.​ Select PreFlow from ProxyEndpoint​

22.​ Verify API Key​

23.​ Enter Policy Name. Add.​

24.​ In the Code Editor found in the bottom pane, look for the tag. Replace
the string variable_containing_api_key with request.header.APIKey​

25.​ Update and Save changes.​
Deploy.​

Leave a Comment