如何按Python API请求日期获得ServiceNow记录?
我正在将此Python脚本请求运行到ServiceNow API。如何在过去两天中仅检索更新的记录?
该脚本在生产中运行,这些脚本都可以获得所有记录,但是记录的数量正在增长,我不需要所有记录。
params_list = {
'sysparm_exclude_reference_link': 'true',
'sysparm_query': 'ORDERBYsys_created_on',
'sysparm_fields': fields,
'sysparm_display_value':'true'
}
res = requests.get(URL_request, auth=HTTPBasicAuth(params.username, params.password), params=params_list)
我尝试查看文档,但这全都与REST API有关。我不知道如何将其转换为此请求。
I'm running this Python script request to a ServiceNow API. How can I retrieve just the records updated in the last two days?
The script is running in production that gets all records, but the number of records is growing and I don't need all of them.
params_list = {
'sysparm_exclude_reference_link': 'true',
'sysparm_query': 'ORDERBYsys_created_on',
'sysparm_fields': fields,
'sysparm_display_value':'true'
}
res = requests.get(URL_request, auth=HTTPBasicAuth(params.username, params.password), params=params_list)
I've tried looking at the documentation but it's all about REST API. I don't know how to translate that to this request.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
'sysparm_query':'sys_updated_onrelativegt@hour@ago@ago@48^orderbysys_created_on
''sysparm_query': 'sys_updated_onRELATIVEGT@hour@ago@48^ORDERBYsys_created_on
'