Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Flow Action, REST step, Issue adding Credential

Jamsta1912
Tera Guru

Hi all,

I'm trying to create a flow action to make an API call.

I have created a credential record (API Key), a connection record, and an alias.

I'm using the connection alias in my REST step, and I'm using the data pill to add the credential value to the header:

restStep.jpg

 

When I test the step, I get an error: code: 401 - Invalid username/password combo.

If I paste the API token directly into the value for the token header (in lieu of the Credential value data pill) the API call is made successfully.

 

And here's the thing: when I look at the Request headers in the outbound HTTP log, I can see that ServiceNow is adding the text 'authorization=' in front of the actual API key, and it's leaving the 'token' header without a value:

outboundHTTPLog.jpg

 

So I can make this work, by simply pasting the API key directly into the value for the token header, but I would like to avoid having to do this, and would prefer to follow best practice using the connection alias.

 

Any thoughts on this issue?

 

Thanks

 

6 REPLIES 6

Fun fact. I originally used a certain word in my previous post, and I got this message:

Jamsta1912_0-1719319887310.png

But, apparently I am allowed to use the word ecstacy 😉

Alex153
Tera Contributor

Hi Jamsta,

Do you use this method in scoped app or global?