cancel
Turn on suggestions
Showing results for
Search instead for
Did you mean:
The next set of progression badges have been announced! Let's Discuss!
Read only

SAP BAS - Simulate REST API with Oauth

RomnickJohn
Explorer

Saturday

0 Kudos
75

Hi,

I am trying to simulate the REST API call with OAuth inside BAS but i always get an 401 error. It seems that the token is not being fetch before accessing the actual Endpoint.

My JS.

RomnickJohn_0-1763208381547.png

default-env.json

RomnickJohn_1-1763208548709.png

package.json

RomnickJohn_2-1763208604551.png

Know the answer?

Help others by sharing your knowledge.

Answer

Need more details?

Request clarification before answering.

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.

Accepted Solutions (1)

Accepted Solutions (1)

MioYasutake
SAP Champion
SAP Champion
yesterday

@RomnickJohn

You need to add the following configuration to package.json:

 "cds": {
 "requires": {
 "TES_CWT_H_DEST": {
 "kind": "rest",
 "credentials": {
 "destination": "TES_CWT_H_DEST"
 }
 }
 }

Also, execute the following command to bind the destination service:

cds bind 2 <destinationServiceInstance>

Then, execute the service in hybrid mode:

cds watch --profile hybrid

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.

RomnickJohn
Explorer
19 hours ago
0 Kudos

Thanks, @MioYasutake. I am able to access the REST api via hybrid setup.

Answers (0)

Ask a Question

AltStyle によって変換されたページ (->オリジナル) /