API MANAGEMENT
in
SAP CPI
Sakshi Tekale
API Management in SAP CPI
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 backends 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
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
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.
🧠YouExample:
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.
🧠YourExample:
real CPI endpoint:
https://your-cpi-tenant.com/http/customerdata
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
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.
🧠YouExample:
create an API Product called Customer Services which includes:
● Customer Data API Proxy
● Customer Orders API Proxy
1. Configure
2. API Provider
3. Create
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
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
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
7. Test Connection
Creation of API Provider is successful.
8. Create API Proxy
Select API Provider from dropdown.
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
Discover shows list of API Proxies available.
Search for GWSAMPLE_BASIC and click OK.
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
9. Can change Name and Title if it already exists.
Click on Create.
API Proxy is created successfully.
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
10. Save.
11. Deploy
12.Test API Proxy
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
13. Add an API Proxy to a Product
14. Create new Product
15. Add APIs
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
It will show a list of all API Proxies available.
Select the one we created.
16. Publish
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
17. The product is now available
18. See the product
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
19. Protect API Proxy by Adding Application Key Verification
20. Edit
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
21. Select PreFlow from ProxyEndpoint
22. Verify API Key
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
23. Enter Policy Name. Add.
24. In the Code Editor found in the bottom pane, look for the <APIKey ... /> tag. Replace
the string variable_containing_api_key with request.header.APIKey
https://www.linkedin.com/sakshi-tekale/
Sakshi Tekale
25. Update and Save changes.
Deploy.
https://www.linkedin.com/sakshi-tekale/