Explanation of KB0791131 - where is the OAUTH Token used?

Meloper
Kilo Sage

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0791131

 

In this KB we can get a Token and call the Rest Message, but where in the Rest Message the Token is used.
Is it somewhere done with the Link to the Profil?

 

Making an outbound REST call with the retrieved token

// make the outbound REST call with the retrieved token

var r = new sn_ws.RESTMessageV2('empukemburu03_outbound', 'Default GET'); 
//setting oauth profile and oauth requester profile
r.setAuthenticationProfile('oauth2', oauth_profile_id); 
r.setRequestorProfile(requestor_context, requestor_id);

var response = r.execute(); 
var responseBody = response.getBody(); 
var httpStatus = response.getStatusCode(); 

gs.log(responseBody);

 

1 REPLY 1

Musab Rasheed
Tera Sage
Tera Sage

I think you can create one Rest Outbound and create Get method and try no ?

MusabRasheed_0-1722945562272.png

Please hit like and mark my response as correct if that helps
Regards,
Musab