cancel
Showing results for 
Search instead for 
Did you mean: 

Issue accessing CPI value mapping API

varunvichare
Explorer

Hello Experts,


We are trying to access a CPI value mapping API. We have provided the required roles to the Oauth user on BTP cockpit. Please find the attached screenshot for your reference. Still we are getting 403 error while testing the API in postman.We would be using this API to build a CPI interface to update the values in value mapping artifact through automation.

Regards,

Varun Vichare.

View Entire Topic
Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi champion,

Have you created an instance of the Integration Process Runtime according to the following help documentation:

https://help.sap.com/docs/integration-suite/sap-integration-suite/creating-service-instance-and-serv...

You must retrieve an OAuth2 token before you can make any requests to any sender end-points or any APIs from your tenant.

Best regards,
Ivan

varunvichare
Explorer
0 Kudos

Hi Ivan,

Ours is the BTP neo environment, I have followed the below KBA to generate Oauth token. But still I am not able to make a call to the CPI value mapping API.

Setting Up OAuth Inbound Authentication with Client Credentials Grant for API Clients | SAP Help Por...

Regards,

Varun Vichare.

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Hi champion,

Are you sure you are sending both the CSRF-Token and the Bearer token on the request?

To get he CSRF token, you have to send a GET request to the API end-point's root path with the following:

URL: https://<tmn-endpoint>/api/v1/<br>HEADERS:<br>X-CSRF-Token: Fetch<br>Authorization: Bearer <token> 

That should produce the following result on the response's HEADERS like so:

...
X-CSRF-Token: AC0E6612C8...........814DB844F4F99
....

Once you have obtained the CSRF token and bearer token you should be able to send it in the header to gain access to Neo/tmn APIs.

BTW:

1) CSRF token is only mandatory if you are sending any method other than GET. So, modifying requests do request this token

2) On Neo, you must create the OAuth2 client before you are able to call APIs from tmn. That's the document you linked here. Check the following blog as it has detailed steps on how to create and use such credentials on Neo:

https://blogs.sap.com/2023/01/26/configuring-client-id-and-secret-on-neo-environment/

Here, the blogger explains how to create the oauth2 client for an iflow end-point - hence the application chosen is iflmap. Since you are interested on CPI APIs, then you must chose the tmn application.

Here's another blog where you can find information on how to get access and test CPI APIs via Postman (snippet 1 & 2):

https://blogs.sap.com/2023/05/23/snippets-from-a-very-small-neo-to-cloudfoundry-cpi-migration/

If you are still facing issues, please send the request and response in RAW format here from your REST Client such as Postman.

Best regards,
Ivan