Skip to Content
1
Jan 19, 2023 at 03:42 PM

Destination failure for Resource Consumption API of SAP API Business Hub

502 Views

Hi,

I am trying to connect to the Resource Consumption API of the API Business Hub from my custom CAP application. I am using the Destination service and the Usage data management (uas) service for this purpose.

I have created a destination of type OAuth2Password based on the clientid, client secret, url details from the service key of the Usage data management (uas) service instance.

image.png

However when I test the destination connection, it throws a 401 Unauthorized error.

image.png

If I use the same clientid, client secret and url through a terminal using the curl command as documented in Configuration for Using the Resource Consumption APIs in the SAP API Business Hub:

image.png

I successfully get in return an access token. If I then use this access token as bearer token in postman to query the Resource Consumption API, I get a successful response.

image.png

Can someone provide some guidance in how to get the destination to work, so my CAP app could use this destination to fetch the info from the API ?

Regards,

Melwyn

Attachments

image.png (139.7 kB)
image.png (14.5 kB)
image.png (17.9 kB)
image.png (36.7 kB)