Hi, I’m trying to create tickets using the API. I noticed the official API on https://incidentiq.stoplight.io only lists this endpoint, which has 50+ required parameters:
It appears this option is only for creating tickets related to device issues since it requires a barcode?
I’m looking to create a tickets with the API that has these details:
User, Location, Issue Type, Issue Description
The issue type would fall into one of these categories: iPad, Google Apps, WiFi, Account / Login Issue, Other
Which API endpoint should I be using?
Best answer by athaxton_iiQ
Good Afternoon everyone,
I hope you are all doing well!
To create a ticket in Incident IQ using API, you should be able to do so using the simplified API call below. Please note that some information may be contained in {} brackets which will need to be replaced with the specific unique identifiers for your district. Additionally, the IssueCategoryId, IssueId, and IssueTypeId values were taken from Global values that should be present for each district, but if you would like to submit the ticket for iPad, Google Apps, WiFi, Account / Login Issue, or Other Issue Categories then these values will need to be updated to the specific unique identifiers for your district.
This is a command I use. The $s are variables for those items that are needed. Not every category is required (for example you can skip the tag if you don’t need it). I’m sure it could be better if Drew from IQ or someone chimes in but for now this is working for me.
I don’t know. I’ve also admittedly never looked. What I do is this call where I am searching the user by their School Id number and the resulting Json I get back I parse for the UserId which gives you that unique UUID.
I use the same call for my Agent if I’m wanting to assign it to a specific person (typically it’s the Agent running the script) as the agentUserId is really the same thing. My scripts are all in bash (just starting to dabble in Python). The last line is parsing with jq for the UserId.
Thanks @bclark, this is helpful! Do you know if it’s possible to use the submitter’s email instead of clientUserId?
Jumping in a bit late here, but you can use this endpoint to search for a user by email, extract their userId from the response, and pass it through to the next API call for ticket creation.
var data = JSON.stringify({ "Query": "joe.schmo@schooldistrict.com", "Facets": 4, "IncludeMatchedItem": false }); var url = "https://{yoursite}.incidentiq.com/api/v1.0/search/v2"; var options = { method: 'POST', headers: { "SiteId": {your site ID}, "Authorization": "Bearer "+{your API key}, "Pragma": "no-cache", "Accept": "application/json, text/plain, */*", "Client": "WebBrowser", "Accept-Encoding": "gzip, deflate", "Content-Type": "application/json", }, payload: data, redirect: 'follow', muteHttpExceptions: true };
Thanks @bclark and @jclark. I tested the other endpoint https://site.incidentiq.com/api/v1.0/tickets/simple/new and it allows the email to be used with the ForUserName parameter and will make that email/user the submitter.
I feel like I looked at that /simple/new endpoint before and it didn’t let me do something I wanted. But that was long enough ago I don’t even remember what it was. May be worth me revisiting it. Thanks.
To create a ticket in Incident IQ using API, you should be able to do so using the simplified API call below. Please note that some information may be contained in {} brackets which will need to be replaced with the specific unique identifiers for your district. Additionally, the IssueCategoryId, IssueId, and IssueTypeId values were taken from Global values that should be present for each district, but if you would like to submit the ticket for iPad, Google Apps, WiFi, Account / Login Issue, or Other Issue Categories then these values will need to be updated to the specific unique identifiers for your district.