cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming the BTP CF MyInbox API

pravin_kumar_v1
Explorer
0 Kudos

Hello Everyone,
I'm trying to get the substitution rule by consuming the following SAP Business HUB API: https://api.sap.com/api/SAP_CP_Workflow_TCM_CF/resource

I tried the following way:

I tried to consume it from ui5 application

Steps followed:

  1. Create a destination in BTP for the workflow endpoint and used Oauth2tokenExchange based authentication

  2. From Ui5 Application I called the destination and calling substitute API endpoint.

PFA, Controller.js

xs-app.json

I'm getting unauthorized error, when I'm trying to hit this Api endpoint:

(I already assigned the workflowParticipant role to me)

Please help in fixing the issue, your feedback is appreciated
thanks

tobias_breyer
Contributor
0 Kudos

Hi Pravin,

You say that you use Oauth2tokenExchange, but the screenshot of the destination shows OAuth2ClientCredentials. With OAuth2TokenExchange this could/should work, but with OAuth2ClientCredentials in any case, that won't work. Neither does the WorkflowParticipant role assignment apply there, nor would you be able to create an OAuth Client with the necessary scopes. Even then, the lookup of substitutes would typically find no substitutes for the OAuth Client, because only actual users would commonly have such maintained.

Regards,

Tobias

pravin_kumar_v1
Explorer
0 Kudos

Hello Tobias,

Thanks for the reply.
Sorry It was a mistake, I changed the destination to Oauth2UsertokenExchange.



PFA - HTTP Response


The error is same. I cleared the browser cache as well

thanks,
Pravin

Ameer
Discoverer
0 Kudos

hi, Did you resolve this issue? Please let me know the solution if resolved. Thanks.

pravin_kumar_v1
Explorer
0 Kudos

Hi ferozg
No, I didn't solution for this issue.

Accepted Solutions (1)

Accepted Solutions (1)

pravin_kumar_v1
Explorer
0 Kudos

Hello Archana,
Many thanks for the reply.
By changing the destination to "bpmworkflowruntime"(created by booster) in xs-app.json file. I'm able to get my current Substitution List

Destination:

Response:

xs-app.json:

    {
"source": "^/workflow/(.*)$",
"target": "$1",
"authenticationType": "xsuaa",
"destination": "bpmworkflowruntime"
},



Thanks,
Pravin Kumar

Answers (2)

Answers (2)

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Pravin,

Can you please select the right answer and close the question. Thanks!

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Pravin,

Substitution works on the current-logged-in user and not for client credential. You have to use Authorization Grant to work with Substitution so that you are able to pass the logged-in credentials to the APIs.

The API documentation still says:
"as it only supports OAuth2 Authorization Code flow. Refer to the documentation available on the SAP Help Portal"