How to set access token in Http Request

shaik23
Tera Expert

Hi all,

i have started exploring Integrations.

 

How to set access token stored in system properites in to Http request please guide me in detail.

shaik23_0-1755695181623.png

shaik23_2-1755695207668.png

 

shaik23_1-1755695202660.png

i have tried hardcode value in bearer its working i want them dynamically.

 

1 ACCEPTED SOLUTION

@shaik23 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

15 REPLIES 15

@shaik23 

Any server side script such as BR, script include, workflow run script etc.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@shaik23 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar  Thanks for your response i am bit confused here if I build script then how the system recognize it ? There is no need to give http request headers ? I am not experienced in integration if you have time please guide me.

@shaik23 

there are 2 options

1) either use variable substitution

OR
2) use script directly to set the header

The links I shared should help you.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

 

I have used variable substitution and writen script in test value

var restMessage = new sn_ws.RESTMessageV2('your REST message name', 'post'); 
restMessage.setStringParameterNoEscape('AppKey', gs.getProperty('system_property_name'));

Tested it shows bad request