Skip to main content

Hello!

I’m working with the incident IQ API, and was able to get the API to work for some get methods, but what I need is a way to get all the ticket IDs through the API, but was not able to figure it out.

I’ve been reading through the documentation below, but haven’t found a way to get all tickets.

https://incidentiq.stoplight.io/docs/v1/

Could someone please help me or point me towards the right direction?

Thank you!

I believe you’ll need to do a POST to retrieve all tickets, and depending on how big your district is/number of tickets you have to date, you’ll likely need to account for paging as well.

You can parse the response(s) to extract the ticket ID’s.


@jclark Thank you so much for the response!

 

Is there any documentation on how I could do the POST? (I’m using python) I’ve been trying for a while, but was not able to make it work.

Also, could you provide some guidance on how to use pagination? I’ve been trying on this also, but was not able to figure it out.

 

Thanks again!


I don’t think you need a payload for this one, just change your method from GET to POST
Endpoint would be .../api/v1.0/tickets

 


The documentation is quite lacking, unfortunately.


@PSon 843ede9 miprepschool Thank you for submitting your question to our community! 😄

@jclark Our dev team is still working on our API documentation. While we have rehoused it, it is still a work in progress! Thank you for your continued feedback and knowledge!


@jclark @Kathryn Carter Thanks to both on your responses!

 

@jclark I’m doing something like the python code below, and it works for one ticket (queried with the ticket ID using “get”), and I took out the ticket ID at the end of the URL and changed “get” to “post” and it is not working. I get a “500 Server Error: Internal Server Error” response status.

 

 

headers = {
    "Client": "WebBrowser",
    "Accept": "application/json, text/plain, */*",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
    "Pragma": "no-cache",
    "Accept-Encoding": "gzip, deflate",
    "Content-Type": "application/json",
    "Authorization" : {bearerToken}
}


url = "{our_url}/api/v1.0/tickets/"

response = requests.post(url, headers=headers)
 

 

Do you have any tips/advice that I could try? Thanks again!

 


My mistake, you do need a payload.

{
"ProductId": {ProductId},
"Schema": "All"
}


You can get your ProductId from the Developer Tools section in iiQ


@jclark I did something in the lines of the code below and it worked! Thank you so much! You’re awesome!

 

 

url = "{our_url}/api/v1.0/tickets"

payload = {

    "ProductId": {product_id},

    "Schema": "All"

};

response = requests.post(url, json=payload, headers=headers)

 


Reply