Skip to Content
Technical Articles

SAP Cloud Platform Integration – OData API for accessing the service endpoints

Introduction

SAP Cloud Platform Integration 16 March 2019 release (v2.51.x/v3.9.x) is now enhanced with a feature available in the form of an Application programming interface (API) based on the OData V2 for accessing the service endpoints. OData API entities are described in the SAP Help Portal ( see Integration Content Entity Types and ServiceEndpoints Example Requests).

This blog describes how to consume this API.

OData API to access the service endpoints exposed from Cloud Platform Integration.

This API has been introduced with an aim to support stakeholders and customers who would like to access its service endpoints and various properties from the Cloud Platform Integration to meet their specific use cases or needs.

Benefits:

  • Consumers of this API will get all the service endpoints exposed from CPI for a tenant.
  • This will be one stop shop to get all the service endpoints available for the tenant.
  • Endpoints are accessible for both iFlow and OData service.
  • Manual procedure of discovering the service endpoints for the specific tenants has been automated through API call.

Use cases:

You can leverage this API to target many use cases and I would like to depict a few in this blog.

 

Send Purchase orders from S4 HANA to Business partner

This service endpoints API helps you to discover the relevant endpoint that would in turn trigger the Integration Flow to send the Purchase Orders from the S/4HANA cloud system to the respective Business Partner.

 

Employee data replication from SAP SuccessFactors to SAP S/4 HANA

Employee data integration can be triggered to replicate the Employee address details maintained in the SAP SuccessFactors system into the SAP S/4HANA system.

Through the service endpoints API, you can discover the relevant endpoint and can trigger the employee data replication which shall replicate the data to SAP S/4 HANA.

 

Provide businesses with competitive advantage and insights into how to reach and engage with their customer base

SAP offers an integration package that runs on SAP Cloud Platform Integration that allows customers to retrieve the results of social media data queries directly from the social media channels (Twitter) and load them into SAP Hybris Marketing Cloud.

As a result, companies can analyze customers’ conversations and get valuable insights to serve their target audience in a better way.

For many businesses, understanding customer sentiment is a key factor. Organizations spend a considerable amount of time and effort trying to understand sentiment insights so that products and services can be improvised accordingly.

The service endpoints API helps you to trigger the integration flow with the relevant endpoint to extract the results from the Social media data queries.

Through the service endpoints API, you can discover the relevant endpoint and can trigger the integration flow to retrieve the results of social media data queries.

 

API Entity Properties

Listed below are some of the properties of the API entity useful for consumption standpoint.

Property Description
Name Name of the item and the identifier field.
Title Title of the item.
Summary A short summary of the item that can be used in the list/tile view.
Description A description of the item.
Version Version of the item
Documentation Further documentation describing the API in more detail.
lastUpdated Timestamp when the item was last updated
apiDefinitions An array of APIDefinition containing links to the machine-readable API definitions Eg: Open API Specifications files, OData Metadata etc.
entryPoints An array of EntryPoint of the API.

 

What is an EntryPoint

The table below explains the EntryPoint entity.

Property Type Description
Name String Name of the entry point.
url URL Fully qualified endpoint or the base Path of the API
Type Enumerated String Possible values are DEV, TEST, PROD, SANDBOX.

 

What is APIDefinition

The table below explains the APIDefinition entity.

Property Type Description
Type Enumerated String Name of the API Definition endpoint. Possible values are oas-yaml, oas-json, raml, edmx,wsdl.
url URL Fully qualified endpoint to the API Definitions file.

 

Query options supported:

  1. $format
  2. $expand
  3. $select
  4. $filter

 

ServiceEndpoints API Examples

The operation of this API is retrieve and it is mapped to the HTTP GET method.

  1. https://<tmn url>/api/v1/ServiceEndpoints — >Returns all the service endpoints for the specific tenant
  2. https://<tmn url>/api/v1/ServiceEndpoints?$format=json — > This will enhance the readability of the service endpoints by providing the json format of the same.
  3. https://<tmn url>/api/v1/ServiceEndpoints?$expand=EntryPoints — > Expands and returns all possible entry points of the API for the specific tenant
  4. https://<tmn url>/api/v1/ServiceEndpoints?$expand=ApiDefinitions –> Expands and returns all possible ApiDefinitions of the API for the specific tenant

Additionally, you can also use $select query option:

  1. https://<tmn url>/api/v1/ServiceEndpoints?$select=EntryPoints
  2. https://<tmn url>/api/v1/ServiceEndpoints?$select=ApiDefinitions

 

ServiceEndpoints API Responses

How to expand and return all possible entry points of service endpoints for the filtered integration flow artifact

Request URL:

https://<tmnurl>/api/v1/ServiceEndpoints?$expand=EntryPoints&$filter=Name eq ‘iflow_SOAP’

Note : Name is the Bundle symbolic name of the iFlow project.

Response:

 

How to expand and return all possible APIDefinitions of service endpoints for the filtered integration flow artifact

Request URL:

https://<tmnurl>/api/v1/ServiceEndpoints?$expand=ApiDefinitions&$filter=Name eq ‘iflow_SOAP’

Note : Name is the Bundle symbolic name of the iFlow project.

Response:

 

No CSRF Token Handling

This is a HTTP GET call, hence it need not have a X-CSRF token. You can directly invoke the URL from the browser using adequate Authorization.

 

I hope, you can benefit from the enhancements presented in this blog post. In case of questions or feedback, please feel free to comment on this blog.

2 Comments
You must be Logged on to comment or reply to a post.