GET rest api call from sql server to servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2016 03:34 AM
Hello friends,
I'm trying to make a GET REST API call to my test developer ServiceNow instance to the incident table. The send is failing and I'm not getting a response back. Please find below my simple code. Can you please help me out what I'm missing?
Thanks many,
Satheesh
Declare @Object as Int;
Declare @ResponseText as Varchar(8000);
--Code Snippet
Exec sp_OACreate 'MSXML2.ServerXMLHTTP', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'get',
'https://dev26169.service-now.com/api/now/table/incident?sysparm_limit=1', 'false'
Exec sp_OAMethod @Object, 'send'
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT
Select @ResponseText
Exec sp_OADestroy @Object
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2016 04:15 AM
Hi,
I think its related to authentication. Your SQL server need to pass authentication test before accessing your SNOW server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2016 04:27 AM
Hi,
Thanks for your response. I tried by passing the userid and pwd along, but still got the same response. Can you help me understand how I get my SQL server pass the authentication test please?
Thanks
Satheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2016 04:52 AM
Hi,
When I try to catch the exception, this is what I'm getting...
hResult | source | description | FailPoint | MedthodName |
0x80072EE2 | msxml3.dll | The operation timed out | Send failed | GET |
Please do let me know how I can overcome this.
Thanks
Satheesh