Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 

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 along with the newly added feature mentioned below.
These API enhancements are further detailed in SAP Help Portal: Integration Content Designtime – OData API.
To try these out on API Business Hub, check out the blog : Cloud Integration: OData API on API Business Hub

New with SAP Cloud Platform Integration 4 August 2018 release:

New feature enhancements include APIs for enabling various operation like Get, Create, Update, Delete and Download of Resources in an Integration Flow.

New with SAP Cloud Platform Integration 7 September 2018 release:

New feature enhancements include APIs for enabling copy of Integration Package from Discover to Design

New with SAP Cloud Platform Integration 28 October 2018 release:

New feature enhancements include:

  1. support for certain Query Parameters in API calls and

  2. Improved version handling for remote api calls :

    To get the design time artifact details or its resources or configurations, it is necessary to pass the bundle Id and the bundle version in the Odata call. In case the user is unaware of the version or if the artifact is updated to a newer version, the user will have to verify the bundle details in WebUI.

    To overcome this problem, we have introduced a version constant called ‘active’, which always returns the latest artifact.

    For example, while making the call to read the artifact ‘TestRemoteAPIRead’, the string ‘active’ can be used for for version.

    The same verion can also be used to download or to fetch resources and configuration information.

    Note – The text ‘active’ is not case-sensitve and can be used a in any case forms such as ‘Active’ or ‘ACTIVE


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.


Note: For updating a Scheduler or Timer parameter, the "ParameterValue" should be a valid cron expression and the "DataType" should be "custom:schedule". Please see the below example.


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/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.


Resource APIs


The following APIs allow you to manipulate resources in an Integration Flow.

Get All Resources


To fetch all the resources from an integration flow.

  1. Provide the URL with Get Operation
    https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<integrationFlowID>',Version='<version>')/Resources



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



  1. Update Authorization

  2. Click on Send.


Get Resource


To fetch individual resources from an integration flow.

  1. Provide the URL with Get Operation
    https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>',Version='<version>')/Resources(Name='<Resource Name>',ResourceType='<Type of Resource>')



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

  • Resource Name represents name of the resource with extension.

  • Type of Resource represents the type of the resource



  1. Update Authorization

  2. Click on Send.


Note: In a special case where XSD is referred by a WSDL and use case is read XSD from WSDL folder then user can customer query option.
https://<tmn>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>',Version='<version>')/Resources(Name='<Resource Name>',ResourceType='<Type of Resource')?ReferencedResourceType=< Type of Resource>

Create Resource


To create a resource in an integration flow.

  1. Provide the URL with POST Operation
    https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>',Version='<Version>')/Resources



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



  1. Provide CSRF Token (explained in the Integration Flow creation)

  2. Update Basic Authorization

  3. Provide JSON body content, as shown in the example below.

  4. Click on Send.


Note: In a special case where XSD is referred by a WSDL and the use case is to put XSD in WSDL folder, the user can put additional attribute in payload.

Update Resource


To update a resource in an integration flow.

  1. Provide the URL with PUT Operation
    https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>',Version='<version>')/$links/Resources(Name='<Resource Name>',ResourceType='< Type of Resource>')



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

  • Resource Name represents name of the resource with extension

  • Type of Resource represents the type of the resource



  1. Provide CSRF Token (explained in the Integration Flow creation).

  2. Update Basic Authorization.

  3. Provide JSON body content, as shown in the example below.

  4. Click on Send.


Note: In a special case where XSD is referred by a WSDL and the use case is to update XSD in WSDL folder, the user can use a custom query.
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>',Version='<version>')/$links/Resources(Name='<Resource Name>',ResourceType='<Type of Resource>') ?ReferencedResourceType=< Type of Resource>

Delete Resource


To delete a resource in an integration flow.

  1. Provide the URL with DELETE Operation
    https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>',Version='<version>')/$links/Resources(Name='<ResourceName>',ResourceType='< Type of Resource>')



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

  • Resource Name represents name of the resource with extension

  • Type of Resource represents the type of the resource



  1. Provide CSRF Token (explained in the Integration Flow creation).

  2. Update Basic Authorization.

  3. Click on Send.


Note: In a special case where XSD is referred by a WSDL and the use case is to delete XSD in WSDL folder, the user can use a custom query.
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>',Version='<version>')/$links/Resources(Name='<Resource Name>',ResourceType='<Type of Resource>') ?ReferencedResourceType=< Type of Resource>

Download Resource


To download a resource in an integration flow.

  1. Provide the following URL with GET operation:
    https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>',Version='<version>')/Resources(Name='<Resource Name>',ResourceType='<Type of Resource>')/$value



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

  • Resource Name represents name of the resource with extension

  • Type of Resource represents the type of the resource



  1. Update Basic Authorization.

  2. Click on Send.


Note: In a special case where XSD is referred by a WSDL and the use case is to download XSD in WSDL folder, the user can use a custom query.
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>',Version='<version>')/Resources(Name='<Resource Name>',ResourceType='<Type of Resource>')/$value?ReferencedResourceType=< Type of Resource>

Count API



  1. The Count API can be fired to get the number of resources and configurations for a given artifact. This can be done by firing a GET call with the following URL


https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Resources/$count

or

https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Configurations/$count

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



  1. Update Authorization

  2. Click on Send.


Query Options


The Odata API calls on Designtime artifacts will now support some of the system query options that are specified by Odata uri conventions. As Odata states - System Query Options are query string parameters a client may specify to control the amount and order of the data that an OData service returns for the resource identified by the URI.

Query options can be used along with others separated by ‘&’ to form a complex query.

The supported query options for the Designtime artifact calls are mentioned below.

Note- All Query Options for Odata calls begin with a ‘?’ character, after the respective URLs and name of each individual System Query Option is prefixed with a "$" character.

Orderby System Query Option ($orderby)


The order of the received data can be controlled by sorting it on one of the parameters or multiple parameters in ascending or descending orders.

Note- These queries can be performed on get resources and get configurations only

The below mentioned URL sorts the set of resources in an ascending order of Resources Names.
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Resources?$orderby=Name

or

https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Resources?$orderby=Name asc

To sort it in the descending order the term ‘desc’ can be used instead of ‘asc’ as in
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Resources?$orderby=Name desc

The below URL sorts the set of resources in ascending order of the resource types and the entries with the same resource types are sorted on their names.
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Resources?$orderby=ResourceType,Name

The same action can be performed on Configurations call by the below URL
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Configurations?$orderby=ParameterKey

Filter System Query Option ($filter)


The filter call will help fetch a subset of entries matching a given condition. The filter conditions supported by integration flows are ‘eq’ (equals) and ‘ne’ (not equals)

Note- These queries can be performed on get resources and get configurations only

For filtering resources on a condition on resource type
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Resources?$filter=ResourceType eq 'groovy'

Or to avoid fetching a certain set of entries
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Configurations?$filter=DataType ne 'xsd:boolean'

To help users encounter some uncertain conditions the remote API call also supports some of the string operations such as

·         Substring of - ?$filter=substringof('abc', Name) eq true

·         Startswith - ?$filter=startswith('scr', Name) eq true

·         Endswith -  ?$filter=endswith(‘.groovy’, Name) eq true

Format System Query Option ($format)


The integration flow calls support the JSON and ATOM formats. By default the response is received in ATOM format. To receive the response in JSON format the mentioned query can be used
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Configurations?$format=json

Note- This query can be performed on get resources and get configurations only

Select System Query Option ($select)


The properties returned in response can be controlled by using $select query. When used, only those properties are returned which are mentioned in the request.

Note – Select operation can be performed on get integration artifact, get resources and get configurations.
https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Resources?select=Id,Version

or

https://<tmnurl>/api/v1/IntegrationDesigntimeArtifacts(Id='<IntegrationFlowId>’,Version='<Version>’)/Resources?select=Name

Copy Integration Package from Discover to Design


In continuation of OData APIs offerings form SAP Cloud Platform Integration, with version 2.45.x, we have now enabled an OData API to copy an integration package from Discover space to Design space.

  1. The URL pattern of the API is:https://<tmnurl>/api/v1/CopyIntegrationPackage?id='<id>'


In the above link,

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

  • id denotes integration package id. As of now, you can get this id from the URL of your browser’s address field as shown in the below screenshot (encircled)




2. When you perform the POST operation on the mentioned OData API, you shall get an HTTP             201 response code with response content as shown in the below screenshot which signifies               the successful copy of integration flow package from Discover to Design space.



 

Also, below are the other supporting parameters of this OData API

https://<tmnurl>/api/v1/CopyIntegrationPackage?id='<id>'&ImportMode=’<import_mode>’

Values of the import_mode are

  1. OVERWRITE : If you wish to overwrite the existing package which copying, you can provide this value, e.g. https://<tmnurl>/api/v1/CopyIntegrationPackage?id='<id>'&ImportMode='OVERWRITE'

  2. CREATE_COPY : If you wish to create another copy of the same integration package while    copying and it has to be followed by a suffix, e.g. https://<tmnurl>/api/v1/CopyPackage?id='<id>'&ImportMode='CREATE_COPY'&Suffix='123


 

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 !

 
44 Comments
Harsh9
Participant
0 Kudos
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 Kudos
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.


engswee
Active Contributor
0 Kudos
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 Kudos
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 Kudos
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

 
engswee
Active Contributor
0 Kudos
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 Kudos
Thanks Archita. It worked.

Where can i see the list of oData API's that SAP is providing?

 
engswee
Active Contributor
0 Kudos
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 Kudos
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 Kudos
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 Kudos
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>',Version='<version>')

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

Best Regards,

Archita

 
0 Kudos
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 Kudos
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 Kudos
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.

 
engswee
Active Contributor
0 Kudos
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 Kudos
Hi Archita!

Thanks for sharing! The blog is very useful!

I had tryed to get all resourses of my integration flow

I used request like

https://someaddress.com/api/v1/IntegrationDesigntimeArtifacts(Id='someId',Version='1.0.1')/Resources

but got the error:

<message xml:lang="en">Could not find property with name: 'Resources'.</message>

What I do wrong?
0 Kudos
Hi Vadim,

The resource APIs are available 1806 release onward.

Can you please check if you are trying it in the latest released software?

Thanks & Regards,

Archita
prithamr
Explorer
0 Kudos
Hi Archita,


Is there a list of resource types we can post to the iflow. for example:
"ResourceType"
:"xslt"

I need to add .xml file to the resources folder of an iflow. But that was giving an error

Would that be possible?

REgards,

Pritham

 
0 Kudos
Hi Pritham,

We do not support .xml file as of now.

The list of resources supported currently are

groovy, gsh, xsl, xslt, jar, edmx, js, mmap, opmap, wsdl, xsd, zip

 

Regards,

Archita
0 Kudos
Hi! Yes, everything works good
prithamr
Explorer
0 Kudos
Hi Archita,

I have a requirement to read the Credentials which is of type oauth2:default. I need to read the Client ID and Client secret.

I am using the API as below

GET https://tenanturl.com/api/v1/UserCredentials('Credentialname')

 

In the user field I get the client id which was saved

<d:User>sb-xxxxxx!t2299</d:User>

But the Password field where I was expecting the client secret I am getting null. Is there any other way (possibly more secure) in which I can retrieve the client secret stored in the credentials. I need this to use in my iflow to connect to another request reply step.

Regards,

Pritham

 

 

 

 

 
former_member325225
Participant
0 Kudos
Hi Archita,

Thank you.. I am facing below error when trying to update multiple parameters.



Can you please help?
0 Kudos
Hi Archita,

Thanks a lot for this wonderful post. Is it also possible to get the integration flow ids by the passing the package id?

 

Regards,

Siby

 
Bais
Participant
0 Kudos
Hi thank you for article,

we want to download all packages and version them in our Git, is it possible to have list of all Packages and Integration flow on package and next download them all?

 

We notice there isn't an api to do that massive backup.

 

Federico Bellizia

 
0 Kudos
Hello Archita -

 

What is the recommended way to maintain the source code in git and automating the deployments to SCPI. We are able to download the integration flow in a jar file. Is is possible to develop an integration flow outside SCPI, package it in the same structure in a jar and deploy the jar to SCPI using an API? We want to know if it is possible to maintain the SCPI code in a source code repository and use a build tool to build the package from repo and deploy it to Repo just like any application.

 

Ashik
0 Kudos
Hi Archita,

 

Nice blog!!!

When I am trying to execute a DELETE operation for an integration flow. I am getting an error of - 405 Method not allowed.

I am using the URL - https://<somehost>/api/v1/IntegrationDesigntimeArtifacts?Id=<ArtifactName>&version=active

Kindly help me on this.

rgvb
Discoverer
0 Kudos
Hello Archita,

 

Thanks for sharing!

 

Regarding Value Mapping, are they supported by the API to create and update them?

Thanks!

Best regards
0 Kudos
hi Archita Sarangi

 We have an SCPI instance up an running. But currently, in order to make any changes to the iFlow, we have to use the SCPI design page for the iFlow.

 

Does SCPI offer any API that we can use to upload a iFlow jar file from my local system to SCPI, and deploy that package?

 

What we are trying to understand is that can we maintain all the iFlow code and config in a git repo and have out jenkins build scripts build a jar package, upload it to SCPI and deploy it.

 

Thanks
0 Kudos

Hi Aashik,

From what I have read and currently understand, there is not currently a way to upload an entire package via an API, only individual artifacts.

Before uploading an iFlow via API, you will either need to give the artifact a unique ID (not currently in the system) or firstly backup and delete the existing flow from the system and then upload the new version.

To upload the iFlow use the POST method on /IntegrationDesigntimeArtifacts with the zip file of your flow base64 encoded in the body of the request. I’ve tried this via the curl utlity and it works great. 

Hope this helps.

0 Kudos
As of now, it's not available.
0 Kudos
Hi Jeenat,

 

I retested and it's working for me.

 

URL: https://<tmn-url>/api/v1/IntegrationDesigntimeArtifacts(Id='iflow-id',Version='Active')

 

Just give a try it should work.

 

Thanks.
0 Kudos
Hi Siby,

 

Yes, you could achieve it through the below URL but it will give you all the details associated with integration flow.

 

URL: https://<tmn-url>/api/v1/IntegrationPackages('package_id')/IntegrationDesigntimeArtifacts

 

Let me know if any further query.

 

Thanks.
mhitelli
Explorer
0 Kudos
Hell,

I am trying to set Configurations using the $batch request and CPI Odata V2 Adapter. This is my payload:
<?xml version="1.0" encoding="UTF-8"?>
<batchParts xmlns:atom="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:multimap="http://sap.com/xi/XI/SplitAndMerge">
<batchChangeSet>
<batchChangeSetPart>
<uri>IntegrationDesigntimeArtifacts(Id='thisIsMyFlowID',Version='1.1.9')/$links/Configurations('Receiver_Address')</uri>
<method>PUT</method>
<headers>
<header>
<headerName>Content-Type</headerName>
<headerValue>application/xml</headerValue>
</header>
<header>
<headerName>Accept</headerName>
<headerValue>application/xml</headerValue>
</header>
</headers>
<IntegrationDesigntimeArtifacts>
<ParameterKey>Receiver_Address</ParameterKey>
<ParameterValue>https://my123245-api.s4hana.ondemand.com/sap/opu/odata/sap/</ParameterValue>
<DataType>xsd:string</DataType>
</IntegrationDesigntimeArtifacts>
</batchChangeSetPart>
</batchChangeSet>
<batchChangeSet>
<batchChangeSetPart>
<uri>IntegrationDesigntimeArtifacts(Id='thisIsMyFlowID',Version='1.1.9')/$links/Configurations('Scheduler_Morning')</uri>
<method>PUT</method>
<headers>
<header>
<headerName>Content-Type</headerName>
<headerValue>application/xml</headerValue>
</header>
<header>
<headerName>Accept</headerName>
<headerValue>application/xml</headerValue>
</header>
</headers>
<IntegrationDesigntimeArtifacts>
<ParameterKey>Scheduler_Morning</ParameterKey>
<ParameterValue>0 0 11 ? * * * --tz=MET</ParameterValue>
<DataType>custom:schedule</DataType>
</IntegrationDesigntimeArtifacts>
</batchChangeSetPart>
</batchChangeSet>
</batchParts>


Unfortunately, I am getting the following error:
com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: while trying to invoke the method java.util.HashMap.get(java.lang.Object) of a null object returned from java.util.HashMap.get(java.lang.Object). The MPL ID for the failed message is : AF8oZKpD7U2VR0A6D8mbWNQVN52U For more details please check tail log.

 

Any idea what is going wrong?
jasonwilliams
Explorer
0 Kudos
Hi Archita,

I'm trying to get a list of iFlows with their initiating (sending) adapter types. I had hoped that using the IntegrationDesigntimeArtifacts, but the d:ArtifactContent returns m:null="true". I was hoping this would return the iFlow XML so I could retrieve a list of sending adapters (in particular Timers). I can see that you can also download the Runtime/Deployed iFlow as a ZIP but seemed like more work than I had hoped.

My question is: should the iFlow XML be returned in the ArtifactContent? If not, is there a straight-forward way to retrieve the iFlow source (or indeed a list of Timer based iFlows)?

Thanks,

Jason
kamlesh_zanje
Advisor
Advisor
0 Kudos
Hello Jason,

Remote OData API to read integration flow only contains the metadata information, it doesn't hold the iflow xml which has steps and diagram related details.

We have a Remote OData API to download the iflow project which perhaps you can parse and read iflow xml but it would be a work for you if the intention is to get the list of iflows with their initiating (sending) adapter types etc.

 

May be I can take this as an enhancement request in the Remote OData API to read iflow metadata along with artifact content ( iflow xml). But can you share the use case which you would like to target through this ask.

Regards,

Kamlesh.
kamlesh_zanje
Advisor
Advisor
0 Kudos
Hello Maximilian Hartig,

Could you setup a short call with me. I would like to understand your scenario end to end.

Regards,

Kamlesh.
mhitelli
Explorer
0 Kudos
Hello,

I already found a workaround.
jasonwilliams
Explorer
0 Kudos
Hi Kamlesh,

Thanks for your response.

From memory (I've just been on leave), I was interested in determining which iFlows were triggered by timer (but I guess I could see use cases for getting a list of all initiating adapters by iFlow etc) as there has been a recent issue in our tenant which was seemingly caused by Timer initiated iFlows being undeployed whilst processing. I suspect I just wanted to undeploy (at least temporarily) any Timer-initiated iFlows that were under active development (to work around / reduce the risk (of) the issue). To do this I needed a list of which iFlows this was applicable to. Additionally I had wondered then about writing a browser extension (similar to ConVista CPI Helper) to only redeploy/undeploy a Timer initiated iFlow if there wasn't an actively processing/running flow.

Other use cases might include implementation of automated code standards checks (which I had briefly looked at not so long ago).

An alternative solution might be to list the source and destination adapters as oData accessible metadata.

Regards,

Jason
nimmala
Explorer
0 Kudos
Hi Archita Sarangi,

I am trying to deploy the Artifact In this format https://<tmnurl>/api/v1/DeployIntegrationDesigntimeArtifact?Id='<integrationFlowID>’&Version='<version>’ from Rest Services(postman). 

while trying to deploy flow with Iflow Id and Version getting below errors.

Regards,

Vinod.


Error Details

kamlesh_zanje
Advisor
Advisor
0 Kudos

Hello Vinodh,

Please cross check whether the integration flow existing in the design workspace. Secondly, kindly ensure the URL is the following. It should be single quote i.e. '

Follow this URL:

https://<tmnurl>/api/v1/DeployIntegrationDesigntimeArtifact?Id='<integrationFlowID>'&Version='<version>'

 

URL which you have pasted has some other character, not the single quote i.e. '

https://<tmnurl>/api/v1/DeployIntegrationDesigntimeArtifact?Id='<integrationFlowID>’&Version='<version>’ 

 

Requesting you to refer the integration artifacts OData Remote APIs from the API Business Hub.

https://api.sap.com/api/IntegrationContent/resource

 

Regards,

Kamlesh.

nimmala
Explorer
0 Kudos
Hi Kamlesh,

Thanks for the quick reply above URL working fine I am able to deploy the Iflow.

To deploy the Multiple Iflows, I created CPI flow while invoking the ODATA  API I am getting below error.


Exception


Thanks& Regards,

Vinod.
Keerthana
Participant
0 Kudos
Hi kamlesh.zanje and archita1012 ,

I am trying to do a put call by first downloading an artifact using the API and after updating the manifest file doing a PUT call,but getting "Integration flow project must contain a manifest file" error.(Even if i don't change the manifest and upload the same also getting the same error)
Please help me with this.

Regards,
Keerthana
nimmala
Explorer
0 Kudos
Hi kamlesh.zanje and archita1012,

Designed a Custom I Flow for Mass deployment and undeployment of I flows, it is working perfectly.

But while Deploying the Rest API I am getting below error

org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://<tmnurl>/api/v1/DeployIntegrationDesigntimeArtifact?Id='<integrationFlowID>'&Version='<version>' with statusCode: 404

Can we achieve deployment and undeployment for APIS?, if yes Please guide me on how we can achieve this.

Thanks & Regards,

Vinod Kumar.

 
Hrishi
Discoverer
0 Kudos

Hi,

While trying to do get operation I am getting below as response. Could you please highlight on it ?

Hrishi_0-1710669509758.png