We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

How to test REST Message with Bearer Token

Meloper
Kilo Sage

I have create the Auth Profil and get a Token after i click on "GET OAuth Token".
USING CLIENT CRENDENTIALS

But after a click on Test i get the Message 

Meloper_0-1722863099316.png

I Guess the TEST Button does not use the created Token, also i guess that my header is designed for a Script.

Meloper_0-1722863223561.png

 


How i need to adjust the Form that the TEST UI Action will work for that Rest message?
Do i need to copy the TOken hash?

Also it would be nice if someone can show me a script how to request the token and use it

 

thank you

1 ACCEPTED SOLUTION

Meloper
Kilo Sage

The problem was the short validity of my token of 60 seconds, there is a porperty "glide.rest.outbound.oauth_token_expired_threshold" in ServiceNow that a token 60 seconds before expiration date is already invalid, I have set the value to 15 seconds.
No the Test Button works.

View solution in original post

5 REPLIES 5

Meloper
Kilo Sage

The problem was the short validity of my token of 60 seconds, there is a porperty "glide.rest.outbound.oauth_token_expired_threshold" in ServiceNow that a token 60 seconds before expiration date is already invalid, I have set the value to 15 seconds.
No the Test Button works.