on ‎2024 Aug 01 8:54 AM
"I am trying to integrate an S/4HANA system service into my CPI. Basically, I need to use two APIs: one for getting a CSRF token and another for making a POST request. When calling the first API, I need to pass x-csrf-token: Fetch in the header with a GET request. This should return an x-csrf-token in the response, which I will then use to call the second POST API.
The issue I’m facing is that when I call the first API, I receive the same header I sent to the server, rather than the expected x-csrf-token. In Postman, it correctly returns the x-csrf-token, but when I implement it in my code, the response returns with the same header value I sent, i.e., x-csrf-token: Fetch. I'm not sure why this is happening, and when I call the second API, it also returns a response like.
oData1 config :
this adapter return 200 ok there is no big problem also it have minor problem It response header is x-csrf-token : Fetch but it should be some token value .
and oData adapter 2 config:
P;ease anyone help me what I did wrong in these steps , Also the same url working in post man
csrf-token url
Plz anyone help me to find out the reason Thanks in adavance
@SAPSupport @Sisn @SAPSUPPORT2 @DonWilliams @N1kh1l @Dan_Wroblewski @Ryan-Crosby @Sandra_Rossi
Request clarification before answering.
It's because the URL for the fetch of the metadata by the OData adapter is incorrect on account of the addition of the entity A_SalesOrder. The URL is showing as "https:XXXXXXXX/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder/$metadata" but should be "https:XXXXXXXX/sap/opu/odata/sap/API_SALES_ORDER_SRV/$metadata".
Regards,
Ryan Crosby
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.