cancel
Showing results for 
Search instead for 
Did you mean: 

OAUTH2.0 API trigger in SAP Data Intelligence using OpenAPI client Operator

former_member765920
Participant
0 Kudos

Hi All,

We are trying to trigger OAUTH2.0 API from DI Intelligence, by using openAPI client operator.

we have provided necessary configuration details such as Oauth2 toekn, client ID client secret etc, but this API also requires body while triggering the API.

No configuration option is available for providing the body in Open API client, so we have a JAVA script operator preceding the open API client wherein we are providing msg.body.

while executing the pipeline we are getting

please do let us know, if someone has experienced the similar issue and how did you resolve it

Thanks

Priyanka Kes

Accepted Solutions (0)

Answers (2)

Answers (2)

lochner_louw
Participant
0 Kudos

Hi,

You need to create an OpenAPI connection in the connection management with the oauth token endpoint and then configure the client.

Thanks,

Lochner

former_member765920
Participant
0 Kudos

Thanks Lochner for the response.

But where do we pass the body in the configuration.

My requirement is to pass certain data as part of message body. I tried sending it via the JavaScript operator, it led to error given in the question "Failed to read request body."

Thanks,

Priyanka Kes

lochner_louw
Participant
0 Kudos

Hi,

The message structure is case-sensitive so if you want to refer to the attributes or body then you have to specify it as msg.Body or msg.Attributes.

Here is an example:

function onInput(ctx,s) {

  var msg = {};

  msg.Body = { "my_json_data": "data" };

  msg.Attributes["openapi.consumes"] = "application/json";
msg.Attributes["openapi.produces"] = "application/json"; msg.Attributes["openapi.method"] = "POST"; msg.Attributes["openapi.path_pattern"] = "/v1/some/path"; $.output(msg); }

Hope this makes more sense.

Thanks
Lochner

0 Kudos

Hi,

How you found configuration details like Oauth token..?

Did you use any SAP tool..?

Thanks.

Deepak