- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2024 05:23 AM
I am trying to implement Salesforce Spoke in ServiceNow to pull data from Salesforce. I am trying to setup the Spoke using Option 2 in order to implement bi-directional webhook as detailed in this documentation (https://docs.servicenow.com/bundle/washingtondc-integrate-applications/page/administer/integrationhu...). At Step: Create credential records for the Salesforce Spoke, when I click on "Get OAuth Token", I am getting the error as shown. I configured all the credentials properly including the Client ID and Client Secret. Any idea where the error could be ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2024 05:29 AM
Please check password is correct / upper case / lower case.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2024 11:57 PM
YES, I wanted to try using the same instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 02:49 AM
Please try this-
var client_id = '3MV******Zqm2';
var client_secret = 'AE146*****D864B8D9E';
var grant_type = 'client_credentials';
var token_endpoint = 'https://your_instance.sandbox.my.salesforce.com/services/oauth2/token';
var token_grant_url = token_endpoint + "?grant_type=" + grant_type + "&client_id=" + client_id + "&client_secret=" + client_secret;
var token_request = new sn_ws.RESTMessageV2();
token_request.setEndpoint(token_grant_url);
token_request.setHttpMethod("post");
var token_response = token_request.execute();
var response_body = token_response.getBody();
var response_obj = JSON.parse(response_body);
var access_token = response_obj.access_token;
gs.info('Token request response: ' + response_body);
gs.info('Access token: ' + access_token);
Please mark my answer helpful and correct.
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2024 11:58 PM
Hello, Thanks for help, but where exactly should I use this code? I mean in which scripting option?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2024 01:50 AM
This is Business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2024 08:30 AM - edited ‎04-12-2024 08:30 AM
@Madhurya M J You can also opt for a no code solution to avoid needing to use code or script. Unito is entirely no-code and supports bidirectional sync between ServiceNow and Salesforce.