我想要获得在ServiceNow中处于“等待呼叫者反馈状态”的所有事件的列表。我们的servicenow支持Okta。
请告诉我们如何访问启用了Okta的Servicenow API。
发布于 2019-07-16 11:20:11
默认情况下,ServiceNow REST Api使用基本身份验证。这与用于登录用户的身份验证方法是分开的。您应该能够使用default example拨打电话,而不必担心Okta。下面是他们的Python示例:
#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)https://stackoverflow.com/questions/57039506
复制相似问题