How to use the API keys in REST message without exposing the key value?

Suggy
Giga Sage

How to use the API keys in REST message without exposing the key value?

(I can define in Header, but the API key value is visible)

 

PS - Looking for an answer w.r.t Rest message only not Flows etc.

1 ACCEPTED SOLUTION

Stefan Reichelt
Tera Guru

Maybe a very pragmatic approach helps: If you create a Sys Property of type "password", you can store the key without exposing it. When you set the header value via script, you can call and decrypt it from there again.

 

Additional source which might be helpful:

How to use Password Properties — SNow Underground

View solution in original post

4 REPLIES 4

Najmuddin Mohd
Mega Sage

Hello @Suggy ,

You can store the key and value in the api_key_credentials table and from the script you can call the rest message, attaching the API Key in the header.

NajmuddinMohd_0-1739730617581.png



If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.




@Najmuddin Mohd Can you share the syntax? How to call API key stored in api_key_credentials using setRequestHeader()?

Stefan Reichelt
Tera Guru

Maybe a very pragmatic approach helps: If you create a Sys Property of type "password", you can store the key without exposing it. When you set the header value via script, you can call and decrypt it from there again.

 

Additional source which might be helpful:

How to use Password Properties — SNow Underground

Thanks a lot @Stefan Reichelt