Closed dfields186 closed 4 years ago
I'm trying to query a location table in service now - this table is named 'cmn_location.do'
A normal ServiceNow URL looks like this: https://xxxxxxxxx.service-now.com/cmn_location.do?sysparm_query=streetLIKE36600+VanDyke+Avenue&sysparm_limit=10000&sysparm_offset=0&sysparm_display_value=all&sysparm_suppress_pagination_header=False&sysparm_exclude_reference_link=False&sysparm_view=&sysparm_fields=
Notice the base path?
How do I specify that in this libraries resource setup:
pysnow_cmn_location = pysnow_conn.resource(api_path='cmn_location.do', base_path=None)
The above doesnt work
I get the following error message:
pysnow.exceptions.InvalidUsage: Path validation failed - Expected: '/[/component], got: cmn_location.do
I've tried several different variations of the base_path but can't seem to get it working - I've different versions by removing base_path altogether like shown below with and without '/' in front of cmn_location.do and nothing works
pysnow_cmn_location = pysnow_conn.resource(api_path='/cmn_location.do')
Any suggestions or help is much appreciated! Thank you!
Hello!
Try this:
resource(api_path="cmn_location")
@dfields186 ping
Closing. Reopen if this is still an issue.
I'm trying to query a location table in service now - this table is named 'cmn_location.do'
A normal ServiceNow URL looks like this: https://xxxxxxxxx.service-now.com/cmn_location.do?sysparm_query=streetLIKE36600+VanDyke+Avenue&sysparm_limit=10000&sysparm_offset=0&sysparm_display_value=all&sysparm_suppress_pagination_header=False&sysparm_exclude_reference_link=False&sysparm_view=&sysparm_fields=
Notice the base path?
How do I specify that in this libraries resource setup:
pysnow_cmn_location = pysnow_conn.resource(api_path='cmn_location.do', base_path=None)
The above doesnt work
I get the following error message:
pysnow.exceptions.InvalidUsage: Path validation failed - Expected: '/[/component], got: cmn_location.do
I've tried several different variations of the base_path but can't seem to get it working - I've different versions by removing base_path altogether like shown below with and without '/' in front of cmn_location.do and nothing works
pysnow_cmn_location = pysnow_conn.resource(api_path='/cmn_location.do')
Any suggestions or help is much appreciated! Thank you!