- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 11:49 AM
First . . . I am brand new to Service Now and a pretty new developer.
I requested a PDI, it's running and I used a template to create a PTO application. Now I'd like to access that application using REST API calls. Does my PDI expose REST API?
Any source of help for this would be appreciated.
Steve
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 01:31 PM
Hi, PDI's are accessable via API and they require the same configuration as a Production instance.
I would start by creating an oauth Client record via menu module
System Oauth > Application Registry
and then testing the token end point
/oauth_token.do
In Postman
Type = Post
Endpoint = https://<yourInstance>.service-now.com/oauth_token.do
Authorization Type = Bearer Token (drop down selection on authorization tab)
Body (x-www-form-urlencoded)
grant_type: password
client_id: <from Your Oauth Client Record>
client_secret: <from Your Oauth Client Record>
username: <the SNC account you are using for integration>
password: <SNC account password>
The developer portal has some good learning material and I would recommend that you work through it.
Courses | ServiceNow Developers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 05:47 AM
Hi Adrian . . . thanks! I actually got Postman to return a 200 by using Tony's suggestion.
However, when I try and access a table in my app, I get a "Requested URI does not represent any resource". But the URI I am pasting in gives a valid XML response showing my table.
Also, when I watch the video, it says use "Basic Auth" which returns the same message "Requested URI does not represent any resource".
Here's the URI I am using:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 06:10 AM
Hi Steve,
when you say 'I try to access a table in my app' you try this with postman or browser and with which user are you doing this testing?
Thanks,
☆ Community Rising Star 22, 23 & 24 ☆
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 06:48 AM
I simply needed to add ? to the end of the URI. All is working well in Postman.
Python is still a problem.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 08:02 AM
And my python code is fixed and works . . . just needed to set a proxy.