Skip to content

Instantly share code, notes, and snippets.

@ah1
ah1 / servicenow_rest_attachment_api_python_simple_binary_example.py ServiceNow REST Attachment API Example Python Example using /now/attachment/file endpoint to post (upload) a file as an attachment to an incident as binary.
#Need to install requests package for python
#easy_install requests
import requests
# Request Docs: http://docs.python-requests.org/en/master/user/quickstart/
# Set the request parameters
url = 'https://bbarnsc1.service-now.com/api/now/attachment/file?table_name=incident&table_sys_id=81f8915bdb6ba20028927416bf961971&file_name=issue_screenshot'
# url = 'https://fejr5sb8ead6.runscope.net/api/now/attachment/file?table_name=incident&table_sys_id=81f8915bdb6ba20028927416bf961971&file_name=issue_screenshot'