Use Bearer token in Credential for REST Integration

Rashi Kulshresh
Giga Contributor

Hi , 

I am doing a REST Integration using flow designer. For Authentication, I am using bearer token, which needs to be send in Authorization header. But Instead of directly putting the token in Authorization header, I want to use Credential Alias. But I am not able to find suitable credential type to put Bearer token. I cant use Oauth type credential as I don't have client Id and Client Secret. I have direct generated token. 

I tried API key credential but in runtime its not picking the Authorization header automatically . And failing with error "Error: U,Detail: Unexpected token: U" . 

 

@Ankur Bawiskar @Chuck Tomasi @Brad Tilton Please help.

 

Thanks.

7 REPLIES 7

You first need to select the Connection Alias in the REST Step (in your Screenshot it's empty). Only then the Credential Variable will become available in the REST Step.

olivierneveu
Tera Contributor

There is another solution

 

like Niklas but I still use the credential alias

you add a get connection info step, the credential is a API KEY type.

 

olivierneveu_0-1676467502039.png

then you use the cred value in the rest step

 

olivierneveu_1-1676467583318.png

 

Ravi Kand
Tera Contributor

 

Hi,

 

POST Method.

While testing through REST Messages, I am getting the below error.

Request not sent to uri= https://xxx-itso-api/api/qs/oa2/v1/ : java.net.UnknownHostException: xxx-itso-api

 

Please help. Thank you.