VMware Cloud Community
ghaithsultaneh
Contributor
Contributor

pass a Token to an Invoke Rest operation Workflow

Hi,

I am trying to pass an imported token to an Invoke Rest Operation Workflow as Http Header parameter , I tried to bind this Token to the Header Parameter_0 in the Workflow but I received the Error 401 . I could have the Token but I want to reuse it in another "invoke Rest Operation Workflow ", and I need to know where should I bind it .

thanks

3 Replies
qc4vmware
Virtuoso
Virtuoso

You may need to write a little custom code if I am understanding what you are asking... I don't thing that out of the box workflow supports custom headers.  Something like this:

var request = restOperation.createRequest(inParamtersValues, content);

//set the request content type

request.contentType = "application/json";

request.setHeader("Your-Custom-Token",token);

//execute request

var response = request.execute();

In the example above you'd pass in "token" and replace "Your-Custom-Token" with whatever you are expecting.

qc4vmware
Virtuoso
Virtuoso

Were you able to get this working?

0 Kudos
qc4vmware
Virtuoso
Virtuoso

Did this work for you?  If so can you please mark my response as the answer?  Thanks!

0 Kudos