The Zurich release has arrived! Interested in new features and functionalities? Click here for more

API Key in headers [easy points]

juan42
Mega Contributor

Hello experts,

I have an integration question.

I have set up my API key through the connection alias configured ( see IMAGE2 )

I am trying to set up an Action Design, where I have selected the connection alias previously set ( see IMAGE1 )

 

My question is, should I be setting the Header with the API key? ( see IMAGE1)

The reason I ask is because I might not have to put it in the headers, since it might be included already in the connection alias. I tried to verify this by looking at action execution details ( see IMAGE3 )

-- I 

 

IMAGE1

find_real_file.png

IMAGE2

find_real_file.png

 

IMAGE4

find_real_file.png

1 ACCEPTED SOLUTION

Geoff_T
Mega Sage

Hi,

I'm pretty sure you need to include it in the header. The connection alias makes it available to be used in the action. Why don't you remove the api-key header you have set up currently and re-test. That will confirm it's needed or not.

 

Geoff

View solution in original post

4 REPLIES 4

Geoff_T
Mega Sage

Hi,

I'm pretty sure you need to include it in the header. The connection alias makes it available to be used in the action. Why don't you remove the api-key header you have set up currently and re-test. That will confirm it's needed or not.

 

Geoff

MattiasJonsson
ServiceNow Employee
ServiceNow Employee

It won't be passed unless you put it in there. As said earlier in the thread. The Credential/Connection and the Alias only make it available for you to use - it does not automatically include it.

Some should be in the header, with a given header name. Others should be sent as a parameter with another name. So, ServiceNow won't guess what to do - but allows you to use it where you need it.

If helpful or correct, please indicate so!

Has this behaviour been updated?

It looks like there will be an "Authorization" header added automatically now.

 

For an API-Key credential it will not add the auth-scheme "Bearer " infront of the key though. So you still have to do the header manually if your target API expects it.

juan42
Mega Contributor

you guys are the best!

thanks!!