cancel
Showing results for 
Search instead for 
Did you mean: 

How to Connect CAPM With Integration Suite ?

hp0
Explorer
0 Kudos
578

I have a scenario in  my project where i have connected non sap api using integration suite , now i want to consume that in my sap  btp CAPM application , how i can do this 

 

hp0
Explorer
0 Kudos
let me try it again
View Entire Topic
MioYasutake
Active Contributor

Hi @hp0,

Assuming your project is based on Node.js, add the following settings to package.json.

 

  "cds": {
    "requires": {
      "apiName": {
        "kind": "rest",
        "credentials": {
          "url": "https://apiurl",
          "path": "/pathprefix" //optional
        },
        "[production]": {
          "credentials": {
            "destination": "destinationName",
            "path": "/pathprefix" //optional
          }
        }
      }
    }

 

Install dependencies as follows:

 

npm add @sap-cloud-sdk/http-client@3.x @sap-cloud-sdk/connectivity@3.x @sap-cloud-sdk/resilience@3.x

 

link to document

In your event handler code, call the API.

 

const api = await cds.connect.to('apiName');
            const data = {//set payload};
            const response = await api.send({
                method: 'POST',
                path: '/path/to/endpoint',
                headers: {
                    "Content-Type": "application/json"
                },
                data: data
            });

 

 

hp0
Explorer
0 Kudos
@MioYasutake thank you
hp0
Explorer
0 Kudos

@MioYasutakefor non sap api , which i have connected through integration suite , in capm i need edmx kind of file , so how  i can get this

gregorw
Active Contributor
0 Kudos
Have you checked my comment that there is no EDMX for a REST service?
hp0
Explorer
0 Kudos

@ gregorw yes i have checked , i have gone through the documentation too ,  can you please illustrate the steps please , how should i do this 

MioYasutake
Active Contributor
0 Kudos
@hp0 You don't require an edmx file for a REST service. The configuration I mentioned above is sufficient.