The OData API of SAP Cloud Platform Integration enables you to access the stored data (e.g. to implement a monitoring project) or to update data (e.g. to create/update/delete partner directory content). In the past these OData API entities were only described in SAP Help Portal (see SAP Help Portal: SAP Cloud Platform Integration – OData API), but now with SAP Cloud Platform Integration 14-Apr-2018 release (v2.39.x) the first version of this API is published in the SAP API Business Hub.
New with SAP Cloud Platform Integration 7 July 2018 release:
API package of SAP Cloud Platform Integration is enhanced by access to “Design” section. These API enhancements are further detailed in Blog: Cloud Integration – Remote OData API’s for Integration Flows and in SAP Help Portal: Integration Content Designtime – OData API.
New with SAP Cloud Platform Integration 4 August 2018 release:
API package of SAP Cloud Platform Integration is enhanced regarding the integration flow in “Design” section:
- Access to resources of an integration flow
- Download integration flow
- Delete integration flow
The new artifact “Security Content” is provided with “Certifacte-to-User-Mapping”.
API Package “SAP Cloud Platform Integration”
This package contains the artifact list, which enables you to trigger the following actions:
- Integration Content
Get the list of deployed integration artifacts.
Deploy/undeploy integration artifacts.
New with 7 July 2018 release: Get/deploy integration flow with configuration parameters of “Design” section.
New with 7 July 2018 release: Update configuration parameters of integration flow in “Design” section.
New with 4 August 2018 release:
Download/delete integration flow of “Design” section.
New with 27 October 2018 release:
Copy package from “Discover” to “Design” section
Create integration flow
Support of ‘active’ version and query options for accessing integration flows in “Design” section
- Log Files
Get http and trace log files.
- Message Processing Log
Get information about the message processing including error information, attachments etc.
- Message Store
Get the stored payload with payload attachments and header properties.
- Partner Directory
Create, read, delete the Partner Directory content.
- Security Content (new with 4 August 2018 release):
Create, read, delete certificate-to-user-mappings.
Create, read, change, delete user credentials (new with 27 October 2018 release).
Image 1: New API Package “SAP Cloud Platform Integration” in SAP API Business Hub
“Try It Out”
You have two different opportunities to test the API directly in the API Business Hub. Either you use the API Sandbox or you configure an API endpoint for your tenant account. For both options you need to be logged on with your SAP Community User.
It is possible to directly test the provided GET methods via API Sandbox (see SAP Help Portal: SAP API Business Hub- Trying Out PIs in Sandbox Environment), which is the default “Try it out” feature.
The API Sandbox contains all test data for the provided API artifacts.
Example: GET All Deployed Integration Artifacts
Select the artifact from the “Artifacts” tab, which you want to test.
Image 2: Select artifact
In the “RESOURCE” tab open the method list for an entity (“Show/Hide”).
Image 3: Open method list of an entity
Click on the “GET” method header, fill possibly the required parameters and click on “Try it out”.
Image 4: Trigger test by clicking on “Try it out” button
Afterwards you could see the received response directly underneath.
Image 5: Received response
Your Tenant Account
Alternatively to API Sandbox, you could test all methods (GET, POST, PUT and DELETE) in your SAP Cloud Platform account by configuring API endpoint (see SAP Help Portal: SAP API Business Hub – Trying Out APIs in a Productive Environment).
For creating your API endpoint, click on “Configure” for an opened artifact.
Image 6: Configure an API endpoint
Select the region specific host of your tenant account:
Image 7: Select region specific host of your tenant account
Enter an endpoint alias, the account short name and the SSL host to complete the required URL for the API call and add your user credentials to complete the configuration.
Image 8: Enter the required attributes and the credentials of your tenant account
As prerequisite for API call via your configured API endpoint your user needs to be assigned to the required roles (see SAP Help Portal: SAP Cloud Platform Integration – Tasks and Required Roles).
CSRF Token Handling
For each write access a CSRF token is required. The corresponding fetch method “CSRF Token Handling” is part of each API package artifact with at least one write method.
To get the required CSRF token, at first the GET method needs to be called with the parameter X-CSRF-Token = ‘Fetch’.
Image 9: Fetch CSRF-Token
The received token must be copied from the response header.
Image 10: Copy CSRF-Token from response header
Afterwards this copied token needs to be entered into the X-CSRF-Token parameter of the POST, PUT or DELETE method.
Image11: Paste the copied CSRF-Token into the corresponding parameter value – e.g. for DELETE IntegrationRuntimeArtifacts to undeploy an integration flow
It is planned to further enhance the OData API of Cloud Platform Integration and to update this package in the SAP API Business Hub accordingly.
For example the API artifact “Security Content” will be further enhanced by adding Keystore entities.