on 2024 Sep 09 1:25 PM
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
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
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
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
User | Count |
---|---|
70 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.