Skip to Content

Introduction

There are many operations that can be performed on an Integration Flow like create, configure, deploy, etc. using the SAP Cloud Platform Integration’s Web Application. But now with the introduction of remote OData APIs, it is also possible to perform similar operations on the integration flows (also known as Integration Design time artifacts) remotely, using a REST client.

This blog will explain how to Configure and Deploy an Integration design time artifact.

Configure an Integration Flow

Configure operation allows you get all externalized parameters and also update a single parameter or multiple parameters in a single REST call.

Get Parameter Details

In order to fetch the details of all the parameters externalized in an integration design time artifact, execute the following steps.

  1. The URL for configuring single parameter in one REST call is : https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<integrationFlowID>’,Version='<version>’)/Configurations

In the above link,

  • tmnurl represents the URL of the tenant where the integration flow exists
  • integrationFlowID denotes the id of the integration flow
  • version represents the latest active version of the integration flow

NoteintegrationFlowID can be fetched by opening the integration flow in Web UI and checking the ID field, under General tab of the integration flow configuration.

These details must be replaced and updated in the URL.

  1. Paste the above URL in any Rest Client of your choice (e.g. Postman)
  2. Select HTTP GET
  3. Select Send

Single Parameter Update

In order to update a single parameter value of an integration design time artifact, execute the following steps.

  1. The URL for configuring single parameter in one REST call is : https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<integrationFlowID>’,Version='<version>’)/$links/Configurations(<parameterKey>)

In the above link,

  • tmnurl represents the URL of the tenant where the integration flow exists
  • integrationFlowID denotes the id of the integration flow
  • version represents the latest active version of the integration flow
  • parameterKey denotes the name of the parameter you wish to update.

These details must be replaced and updated in the URL.

  1. Paste the above URL in any Rest Client of your choice (e.g. Postman)
  2. Select HTTP PUT 
  3. Select Authorizationtab and provide the required authentication TYPE
  4. Select Headers tab and enter x-csrf-token key and its value.

Note : You can do GET operation on http header x-csrf-token : fetch to get the value of x-csrf-token.

  1. In the Body tab, enter the request to update parameter value.

Below is an example of a request body of JSON format to update parameter value

  1. Select Send.

 

Multiple Parameter Update

In order to update multiple parameters of an integration design time artifact, execute the following steps.

  1. The URL for configuring multiple parameters using Batch call is : https://<tmnurl>/api/v1/$batch

In the above link,

  • tmnurl represents the URL of the tenant where the integration flow exists

These details must be replaced and updated in the URL.

  1. Paste the above URL using any Rest Client of your choice (e.g. Postman)
  2. Select HTTP PUT       
  3. Select Authorizationtab and provide the required authentication TYPE to login to the tenant.
  4. Select Headerstab and enter the following header keys and their value:
    • Set x-csrf-token.
    • Set Content-Type as multipart/mixed; boundary=<batchboundry>. 
  5. Select Body tab and enter the batch request to update multiple parameter values.  
  6. Select Send.

Deploy Integration Flows

It is now possible to deploy an integration design time artifact via remote API call. To check how, execute the following steps.

  1. The URL for deploying is : https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts.DeployIntegrationDesigntimeArtifact?Id='<integrationFlowID>’&Version='<version>’

In the above link,

  • tmnurl represents the URL of the tenant where the integration flow exists
  • integrationFlowID denotes the id of the integration flow
  • versionrepresents the latest active version of the integration flow
  1. Paste the above URL using any Rest Client of your choice (e.g. Postman)
  2. Select HTTP POST operation
  3. Select Authorization tab and provide the required authentication TYPE to login to the tenant.
  4. Select Headers tab and enter x-csrf-token key and its value.
  5. Select Send.

Conclusion

These are the first set of remote OData API’s that are currently available and in the coming months,  we will be releasing more API’s to allow download and delete of an integration flow from the design workspace. Hope this blog helps you in understanding these APIs and gives you enough information to get started with them. Feel free to give us your feedback !

 

To report this post you need to login first.

15 Comments

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

  1. Harsh Bhatt

    Hi Archita,

    Thanks for sharing! It is really interesting to have this API to do operations on integration artifact. I am trying to list down use cases where this would prove handy. Could you share your insights on where SAP wants to lead us?

    Best regards,

    Harsh

    (0) 
    1. Archita Sarangi Post author

      Hi Harsh,

      The reason why we are investing in API’s is to help oraganizations in their end to end automation and testing needs over a period of time.

      (0) 
  2. Naresh Dasika

    Hello Archita,

    Thanks for sharing the blog. This is really useful.

     

    Couple of questions:

    1. How to get x-csrf-token to “Deploy Integration flow?
    2. When tried to perform GET operation encountered an error as “Invalid key predicate”. PFA screen shot.

    (0) 
    1. Archita Sarangi Post author

      Hi Naresh,

      For fetching the x-csrf-token please do the following steps :

      1. Go the the HTTP “Headers” tab and put the key as x-csrf-token and its value as fetch.
      2. Do a GET call on your URL.
      3. In the response body there might be few errors, which is expected, since GET call on a Deploy URL is not valid.
      4. In the “Headers” tab of the response (beside Body and Cookies) you will get the  x-csrf-token value.
      5. Paste the value in your request Header tab for the x-csrf-token.

      Hope, this is helpful to resolve your issue.

      Best Regards,

      Archita

      (0) 
        1. Archita Sarangi Post author

          Hello Naresh,

          All API’s from SAP are generally published in https://api.sap.com  . In here if you go to API’s and look for Integration API’s you will be able to discover the API’s from CPI. Direct link https://api.sap.com/api/IntegrationContent

          This is periodically updated.

           

          (0) 
  3. Eng Swee Yeoh

    Hi Archita

     

    Thanks for sharing details on this new API.

    I would like to know if we can access artifacts that are still “work in progress”?

    In the example below, I have some changes done, but have not been “saved as a new version” in WebUI. It shows the version as Draft, but when I try to use ‘Draft’ as the version in the GET call, it returns an error.

     

    Regards

    Eng Swee

     

    (0) 
    1. Archita Sarangi Post author

      Hi Eng Swee,

      Yes, we can definitely access the integration artifacts in “DRAFT” state.

      If you are creating a new integration flow and it is in progress, then by default its version is “1.0.0” with the first “SAVE”.

      Even if the integration artifact shows the version as “DRAFT” you can access it via the remote APIs with the latest “active” version. Which, in your case is 1.0.0.

      However, if the integration artifact was previously in a version 1.0.x, and then a user modifies it and just “Saves” it as Draft. You will have to use the version 1.0.x (i.e. the latest active version), in order to access it via Remote API.

      Hope, this clarifies you doubt.

      Best Regards,

      Archita

       

      (0) 
      1. Eng Swee Yeoh

        Hi Archita

         

        Thanks for the quick response. I tried it out again and understand it a bit better now.  Only the latest version is ever available, and if there are any draft changes (not saved into a version yet), they are available via the latest version no.

         

        With the version no as a key field, I was assuming we could access previous versions of the artifact as well. If only the latest version is available, maybe it is better that it is not a required input field? This would save us the need to figure out the version no first before performing the call.

         

        Regards

        Eng Swee

        (0) 
        1. Archita Sarangi Post author

          Hi Eng Swee,

          It is correct that currently only the latest version is allowed to be accessed.

          However, in future when the feature is introduced where we can access the previous versions as well, we would be able to do it using remote APIs without any major changes.

          Hence, it is implemented this way.

          Thanks & Regards,

          Archita

          (0) 
      2. Eng Swee Yeoh

        Hi Archita

         

        I noticed further that query on the main entity set for IntegrationDesigntimeArtifacts (URL = https://<hostname>/api/v1/IntegrationDesigntimeArtifacts ) does not work, and returns the following error.

        {
            "error": {
                "code": "Not Implemented",
                "message": {
                    "lang": "en",
                    "value": "Not implemented"
                }
            }
        }

         

        Typically for OData APIs, if we query the entity set without providing any further key value or query string, it would return a paginated results of all the records for that entity set. As an example, CPI’s other OData API entity, IntegrationRuntimeArtifacts does return such result.

        Having such a result would allow us to remotely access details such as integrationFlowID and version, without having to manually login through WebUI and navigate to the design artifact to find them.

         

        Regards

        Eng Swee

        (0) 
        1. Archita Sarangi Post author

          Hi Eng Swee,

          If you are trying to do a GET call in order to access the details of all the integration designtime artifacts, then it is not implemented yet.

          Currently, you can access the details of only one artifact at a time using the API:  https://<hostname>/api/v1/IntegrationDesigntimeArtifacts(Id='<ArtifactID&gt;’,Version='<version>’)

          However, I will take your feedback and discuss if we can support this in future releases.

          Best Regards,

          Archita

           

          (0) 
          1. Eng Swee Yeoh

            Hi Archita

             

            Thank you for both your responses. Ok, so if there are plans for access to other versions, then having version no as the key would make sense. Would be great if the functionality is extended to support getting all the artifacts, as that is a very common OData feature.

             

            Regards

            Eng Swee

            (0) 
      3. Devin Mens

        Hi Archita,

        Just to piggyback on what Eng Swee is asking, is there anyway to get the latest version of an IFlow from the REST api and if not is that functionality expected at some point?

         

        Thanks,
        Devin

        (0) 
        1. Archita Sarangi Post author

          Hi Devin,

          With the current available features, it is not possible to get the latest version of an already existing integration flow through remote API calls.

          However, I will take this as a feedback and discuss if we can plan this in future releases.

          Thanks & Regards,

          Archita

          (0) 

Leave a Reply