I would like to get list of all Incidents which are in "Awaiting caller feedback State" in ServiceNow. Our servicenow is Okta enabled.
Can you please let us know how can I access Servicenow API which is Okta enabled.
I would like to get list of all Incidents which are in "Awaiting caller feedback State" in ServiceNow. Our servicenow is Okta enabled.
Can you please let us know how can I access Servicenow API which is Okta enabled.
The ServiceNow REST Api uses basic authentication by default. This is separate from the authentication method used to login users. You should be able to use the default example to make a call without worrying about Okta. Here's their Python example:
#Need to install requests package for python
import requests
# Set the request parameters
url = 'https://instance.service-now.com/api/now/table/problem?sysparm_limit=1'
# Eg. User name="username", Password="password" for this code sample.
user = 'username'
pwd = 'password'
# Set proper headers
headers = {"Accept":"application/xml"}
# Do the HTTP request
response = requests.get(url, auth=(user, pwd), headers=headers)
# Check for HTTP codes other than 200
if response.status_code != 200:
print('Status:', response.status_code, 'Headers:', response.headers, 'Error Response:', response.content)
exit()
# Decode the XML response into a dictionary and use the data
print(response.content)