How I connect Rest API to other service now instance (Send data from one instance to another )

Rajababu
Giga Guru

Hi ,

There is problem i getting I want to send data like Test instance to Prod instance (For example. when I lock the any request Short description , Request Number ,assigned to it get transform in Prod like short description deliver data to   Details field ,request generate incident and assigned to get watch list and how attachment (any document ).

Please suggest how would be possible .What steps I have to take on this .

And any one suggest me what is end point in rest api explore.

Endpoint only take ip address or by domain name also we can access .Please clear that point.

I am new on rest this is my first implementation on my org. Last 7 days continuously working So please help me .

Regards,

Gaurav Rai

ctomasiMichael.Frypradeepksharmasnowdevwilsmilarstangeparamveersurendarmkgm

3 REPLIES 3

ramireddy
Mega Guru

Hi Gaurav,



Here is a link, which will explains the details about Table API



Table API - ServiceNow Wiki



For example, to get list of incidents, You can use below URL.



https://instancename/api/now/v1/table/incident



While calling this URL, you need to do 2 things.



1. As Header, you need to pass "Accept" parameter with value "Application/JSON"


2. You need to pass your user credentials to authenticate.



Here is an working sample, which will retrieve list of incidents from any instance.



var URL = "https://your servicenow instance/api/now/v1/table/incident";


var UserName = "admin";


var Password = "your password"


var r = new sn_ws.RESTMessageV2();


r.setHttpMethod("get");


r.setEndpoint(URL);


r.setRequestHeader("Accept", "application/json");


r.setBasicAuth(UserName,Password);


var response = r.execute();


gs.addInfoMessage(response.getBody());


Rohit Kumar
Giga Expert

Please refer to videos of REST API available on google.


Google


Ask the Expert : Geneva - Scripted REST APIs - YouTube



Thanks


Rohit


Nachiket Sathe
Kilo Explorer

Hi All,

 

Can anyone help me to integrate ServiceNow and SOLMAN (Solution Manager SAP) using REST API.

 

Thanks in advance.