Hi Gareth,
Here is an example of creating a new incident via API:
from __future__ import print_function
from requests.auth import HTTPBasicAuth
import requests
import json
def main():
key_id = "-=key id=-"
key_secret = "-=key secret=-"
server = "-=IP address=-"
resource = "rest/orgs/202/incidents"
url = "https://{0}/{1}".format(server, resource)
headers = {"Content-Type": "application/json"}
name_of_the_incident="Incident from the Python script"
description_of_the_incident="Description"
auth = HTTPBasicAuth(key_id, key_secret)
req = requests.post(url, headers=headers, auth=auth, verify=False, data=json.dumps({"name":name_of_the_incident,"description":description_of_the_incident,"discovered_date":0}))
if __name__ == "__main__":
main()
------------------------------
Alexander Saulenko
------------------------------