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.

New with SAP Cloud Platform Integration 8th July 2019 release (v3.13.x)

The OData API is now enhanced to provide you with the Protocol details except ‘REST’ in the service endpoints information.

 

New with SAP Cloud Platform Integration September 2019 release (v3.15.x)

The OData API is now enhanced to provide you the ‘REST’ protocol details in the corresponding service endpoints information. With this increment, API consumer can filter the service endpoints based on Protocol – ‘REST’. Please refer the below Adapter/Protocol Type table for details.

 

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.

 

Filter Service Endpoints based on the Protocol.

The OData API is now enhanced to provide you with the Protocol details in the service endpoints information.The Protocol information is the type of the API used, such as, SOAP, REST and ODATA. If applicable, Protocol information will contain the version details as well

Adapter Protocol Type
SOAP SOAP
IDoc SOAP
OData V2 ODATAV2
AS2 AS2
AS4 AS4
HTTPS REST

You can leverage this enhancement to filter the endpoints registered in the tenant based on the Protocol.

Examples:

  • https://<tmn url>/api/v1/ServiceEndpoints?$expand=EntryPoints&$filter=Protocol eq ‘SOAP’
  • https://<tmn url>/api/v1/ServiceEndpoints?$expand=EntryPoints&$filter=Protocol eq ‘ODATAV2’

 

 

  • https://<tmn url>/api/v1/ServiceEndpoints?$expand=EntryPoints&$filter=Protocol eq ‘REST’

 

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.

5 Comments
You must be Logged on to comment or reply to a post.
  • Dear Kamlesh,

    Great blog. Is there a reason why only iFlow endpoints are accessible and not the ones of OData Services?

    Best regards,
    Adam

  • Hello Kamlesh,

    Thanks for your article!

    Do you know if there are plans to enhance the API so that Packages or DesignTimeArtifacts can be retrieved?

    I see that the itspaces app itself supports some endpoints on odata/1.0/workspace.svc but I cannot use valid OAuth tokens to authenticate.

    Uwe

    • Hello Uwe

      Thanks for appreciation.

      However, which metadata information of Packages or DesignTimeArtifacts you would like to maintain in this ServiceEndpoints API. Also it would be great, if you share the use cases that you would like to target with these additional details.

       

      itspaces API — odata/1.0/workspace.svc — is for the internal consumption, not public is nature. But we have plans to make this API public. We will update you once it is available for the external consumption.

       

       

       

      • Hi Kamlesh,

         

        Thanks for your answer!

        My question is not directly regarding the Service Endpoint API but the ODATA API as a whole.

        Since the deployment model of integration artifacts, especially integration flows is somewhat cumbersome – we have to develop within the design time workspace, deploy from there and if we move to another stage, I suspect we have to move all artifacts into the respective design time workspaces, modify externalized properties and deploy from there – I wrote a handful of scripts, especially for downloading and pushing to a Git repo and deploying from there without the need to have anything within the production design time workspace (for instance).

        Another helpful side effect is that externalized properties can be clearly defined within the Git repository, packaged and deployed in one row.

        I do not have an instant need for the itspaces API. However, I have that two scripts to display the packages and design time artifacts that are there in the design time workspace, as a little command line help for developers. In contrast to the rest these both scripts require user authentication and cannot use the existing OAuth token.

        Regards,

        Uwe