logo

NJP

Learn to Integrate betweenTwo ServiceNow instance using REST Web Service

Import · Dec 14, 2021 · article

Use Case: Every Time when incident is created in one SNOW instance then incident record with same information should also get created in another instance.

Solution:

  • We need to perform integration between two ServiceNow instance, one which perform Outbound action and second which perform Inbound Action.

Here I have two ServiceNow Instance

  • Source 1 Perform Inbound Action
  • Source 2 Perform Outbound Action

image

Endpoint:- It is a network address at which the Cloud exposes the integration data, or from which the integration data are sent.

Steps of Inbound Action ON Source 1

Step 1:- Navigate to Scripted Rest API-->Create New-->Fill the required fields details

image

Step 2:-Create Resource and Define HTTP Method-POST

image

image

So, with this we get the Endpoint(i.e., Resource path) which need to be shared with Source 2 to perform Integration.

Step 3:- After that we need to write script within Scripted Rest API script section as below

image

Once this is done, next step would be to cover the Outbound part with steps mentioned below:-

STEPS OF OUTBOUND ACTION ON SOURCE 2

Step1:- Navigate to Rest Message-->Create New-->Fill the required field details

image

So here we define the Endpoint which was provided by Source 1 i.e- https://dev\*\*\*\*.service-npow.com/api/572717/create\_incident\_pdi

#Here, we are doing integration using no authentication so didn't define any Authentication Type.

Step 2:- Define HTTP Request

image

Step 3:- Define HTTP Method with No Authentication

image

image

Step 4:- Define HTTP Request providing HTTP Headers Accept & Content Type with value application/json

imageimage

Step 5:-Write down a After Business Rule on Table-Incident by defining Insert Operation

image

image

#After completion, test it by creating an Incident Record on Source 2 (Outbound Action) and checked that record is created on Source 1 (Inbound Action) or not.

Hope this article may be useful for folks who have started learning Integrations on the Now platform.

Please do let me know any feedbacks on this.

Regards,

Surbhi

View original source

https://www.servicenow.com/community/developer-articles/learn-to-integrate-betweentwo-servicenow-instance-using-rest-web/ta-p/2312067