<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Third party integration with my PDI in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2889931#M1102306</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/7146"&gt;@Vasu ch&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"Please use this article for more knowledge regarding 3rd-party integration.":&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.servicenow.com/community/developer-articles/servicenow-integration-with-any-3rd-party-tool-requirements/ta-p/2322744" target="_blank"&gt;https://www.servicenow.com/community/developer-articles/servicenow-integration-with-any-3rd-party-tool-requirements/ta-p/2322744&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.servicenow.com/community/developer-articles/servicenow-integration-with-any-3rd-party-tool-requirements/ta-p/2322744" target="_blank"&gt;https://www.servicenow.com/community/developer-articles/servicenow-integration-with-any-3rd-party-tool-requirements/ta-p/2322744&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for offering to mark it as helpful! If you have any more questions or need further assistance, feel free to ask.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 06 Apr 2024 14:54:14 GMT</pubDate>
    <dc:creator>Community Alums</dc:creator>
    <dc:date>2024-04-06T14:54:14Z</dc:date>
    <item>
      <title>Third party integration with my PDI</title>
      <link>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2889876#M1102284</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to learn integrations in ServiceNow. I've tried integrating 2 ServiceNow instances. Now I want to try integrating my PDI with 3rd party applications. Can anybody tell me any 3rd party applications and use cases with which I can try integrations and get my hands dirty. If anyone could provide any articles or tutorials that would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vasu Ch&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 12:16:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2889876#M1102284</guid>
      <dc:creator>Vasu ch</dc:creator>
      <dc:date>2024-04-06T12:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Third party integration with my PDI</title>
      <link>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2889913#M1102299</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/7146"&gt;@Vasu ch&lt;/a&gt;&amp;nbsp;Start learning Scripted REST API's where you can use third party tool Post man to test .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sharing one link it will be helpful to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://youtu.be/ulKSAZsxFlw?si=nh23y3zFST0R5htl" target="_blank"&gt;https://youtu.be/ulKSAZsxFlw?si=nh23y3zFST0R5htl&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mark it Helpfull ! If this helps you to understand.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 14:15:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2889913#M1102299</guid>
      <dc:creator>SK Chand Basha</dc:creator>
      <dc:date>2024-04-06T14:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Third party integration with my PDI</title>
      <link>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2889931#M1102306</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/7146"&gt;@Vasu ch&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"Please use this article for more knowledge regarding 3rd-party integration.":&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.servicenow.com/community/developer-articles/servicenow-integration-with-any-3rd-party-tool-requirements/ta-p/2322744" target="_blank"&gt;https://www.servicenow.com/community/developer-articles/servicenow-integration-with-any-3rd-party-tool-requirements/ta-p/2322744&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.servicenow.com/community/developer-articles/servicenow-integration-with-any-3rd-party-tool-requirements/ta-p/2322744" target="_blank"&gt;https://www.servicenow.com/community/developer-articles/servicenow-integration-with-any-3rd-party-tool-requirements/ta-p/2322744&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for offering to mark it as helpful! If you have any more questions or need further assistance, feel free to ask.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 14:54:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2889931#M1102306</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2024-04-06T14:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Third party integration with my PDI</title>
      <link>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2890142#M1102357</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/593827"&gt;@SK Chand Basha&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing. Will definitely try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vasu Ch&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 12:15:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2890142#M1102357</guid>
      <dc:creator>Vasu ch</dc:creator>
      <dc:date>2024-04-07T12:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Third party integration with my PDI</title>
      <link>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2890144#M1102358</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Community Alums&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the articles. I'll definitely check.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vasu Ch&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 12:17:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2890144#M1102358</guid>
      <dc:creator>Vasu ch</dc:creator>
      <dc:date>2024-04-07T12:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Third party integration with my PDI</title>
      <link>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2890152#M1102361</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/7146"&gt;@Vasu ch&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would recommend you to do third party integration with Salesforce using oAuth 2.0 You can have free developer instance from here just like ServiceNow-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.salesforce.com/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.salesforce.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use case- Whenever a case/incident in created in ServiceNow, that needs to be passed to Salesforce&lt;/P&gt;&lt;P&gt;You need to setup REST message with endpoints, authentication profile etc. and trigger it with the help of Business Rules. Alternatively, you can pass the endpoints, authentication etc in business rule itself. Sharing an outline of business rule with you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(function executeRule(current, previous /*null when async*/ ) {

    try {
        var client_id = 'Enter your client id';
        var client_secret = 'Enter your client secret';
        var grant_type = 'client_credentials';
        var token_endpoint = 'https://*****prodtest.sandbox.my.salesforce.com/services/oauth2/token';
        var token_grant_url = token_endpoint + "?grant_type=" + grant_type + "&amp;amp;client_id=" + client_id + "&amp;amp;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);

        // Use the access token to make API calls
        var api_request = new sn_ws.RESTMessageV2();
        api_request.setEndpoint('https://*****prodtest.sandbox.lightning.force.com/services/data/v58.0/sobjects/case');
        api_request.setHttpMethod('post');
        api_request.setRequestHeader('Authorization', 'Bearer ' + access_token);
        api_request.setRequestHeader('Accept', 'application/json');
        api_request.setRequestHeader('Content-Type', 'application/json');

        var restObj = {
            "Contact__c": current.contact.name + '',
            "ServiceNow_SysID__c": current.sys_id + '',
            "Priority__c": current.priority.getDisplayValue() + '',
            "Subcategory__c": current.subcategory + '',
            "Number__c": current.number + '',
            "Assignment_Group__c": current.assignment_group.name + '',
            "Assigned_to__c": current.assigned_to.name + '',
            "Channel__c": current.contact_type.getDisplayValue() + '',
            "Short_Description__c": current.short_description.toString().replace(/\v|\r|\0/g, "") + '',
            "Description__c": current.description.toString().replace(/\v|\r|\0/g, "") + ''
        };
        var restStr = JSON.stringify(restObj);

        api_request.setRequestBody(restStr);

        gs.info('API Request Endpoint: ' + api_request.getEndpoint());
        gs.info('API Request Headers: ' + api_request.getRequestHeaders());

        var api_response = api_request.execute();
        var api_response_body = api_response.getBody();
		
		var httpStatus = api_request.getStatusCode();
		if((httpStatus != 200) &amp;amp;&amp;amp; (httpStatus != 201)){
			gs.eventQueue("httpStatusFailed", current, current.number, api_response_body);
		}

        gs.info('API Response Object: ' + api_response);
        gs.info('API Response Body: ' + api_response_body);
        gs.info(current.number + "\nSalesforce Case Create : HTTP Status : " + api_response.getStatusCode() + "\nRequest Body : " + api_request.getRequestBody() + "\nResponse Body : " + api_response_body);
    } catch (error) {
        gs.error('An error occurred: ' + error);
    }


})(current, previous);&lt;/PRE&gt;&lt;P&gt;Please mark my answer helpful and correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit Pandey&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 12:35:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2890152#M1102361</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2024-04-07T12:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Third party integration with my PDI</title>
      <link>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2890222#M1102366</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/7146"&gt;@Vasu ch&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please have a look at the great article by John having various resources related to integration.&lt;/P&gt;
&lt;P&gt;&lt;A title="ServiceNow Popular Integration resources" href="https://www.servicenow.com/community/in-other-news/servicenow-popular-integration-rest-saas-hcm-cmdb-itam-resources/ba-p/2652873" target="_blank" rel="noopener"&gt;ServiceNow Popular Integration resources&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Please mark this as&amp;nbsp;&lt;STRONG&gt;correct answer and helpful&lt;/STRONG&gt;&amp;nbsp;if it resolved, or mark this&amp;nbsp;&lt;STRONG&gt;helpful&lt;/STRONG&gt;&amp;nbsp;if this help you to reach towards solution.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 15:28:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/third-party-integration-with-my-pdi/m-p/2890222#M1102366</guid>
      <dc:creator>SN_Learn</dc:creator>
      <dc:date>2024-04-07T15:28:01Z</dc:date>
    </item>
  </channel>
</rss>

