PUT /v2/accounts/{account_id}/tickets
Description:
This API creates/overwrites a ticket for a given account.
API Limit:
300 requests per minute. Client receives 429 once over the limit.
Method Details:
HTTP method: PUT
Response format: JSON
Headers:
useriq-api-key: Your valid API key generated from the site settings page
Content-Type: application/json
Parameters:
Path Parameter:
-
{account_id}: required, the account ID for the account you want to create a ticket for. Sending a ticket for an account ID that does not exist will be ignored and response with status code 400 is returned.
Body:
application/json.
Required fields:
-
ticket_id: (String), the ID of the ticket, should be the unique identifier of the ticket. If the ticket_id already exists in UserIQ for the given account_id, the existing ticket is overwritten and you will receive status code 200, otherwise, you will get 201.
-
subject: (String), the subject of the ticket.
-
status: (String), the status of the ticket.
-
created_at: (String) the time the ticket is created, cannot be null. UTC time, format yyyy-MM-dd hh:mm:ss.SSS is strictly enforced.
-
solved_at: (String) the time the ticket is resolved, can be null. UTC time, format yyyy-MM-dd hh:mm:ss.SSS is strictly enforced. Note that created_at and sovled_at determines the time span the ticket is active, which contributes to the account health score calculation.
optional fields:
-
ticket_type: (String), the type of the ticket.
-
priority: (String), the priority of the ticket.
-
recipient: (String) the recipient.
-
solved_time_minutes: (Integer) the elapsed time before the ticket is solved in minutes.
-
from_email: (String) the email of the ticket creator.
-
from_name: (String) the name of the ticket creator.
-
ticket_url: (String), the link to the ticket.
Response:
Status code 201: the ticket does not exist and is created
Status code 200: the ticket exists already and is overridden
Other Status codes:
400: Bad request
401: Unauthorized
429: Too many requests
Example PUT Request:
1. Example request for creating a new ticket:
PUT https://api.useriq.com/v2/accounts/1234/tickets
Boby:
{
"status": "open",
"ticket_id": "aa74f80a-a382-4357-86cf-472d3e32e6e4",
"subject": "work flows",
"created_at": "2021-02-11 19:29:27.123",
"solved_at": null,
"ticket_type": "problem",
"priority": "normal",
"from_email": "[email protected]",
"from_name": "Frost Anderson",
}
Example Response
201
{
"success": true,
"message": "ticket created"
}
2. Example request that overrides a previously created ticket.
PUT https://api.useriq.com/v2/accounts/1234/tickets
Boby:
{
"status": "solved",
"ticket_id": "aa74f80a-a382-4357-86cf-472d3e32e6e4",
"subject": "work flows",
"created_at": "2021-02-11 19:29:27.123",
"solved_at": "2021-03-10 12:19:27.123",
"ticket_type": "problem",
"priority": "normal",
"from_email": "[email protected]",
"from_name": "Frost Anderson"
}
Example Response
200
{
"success": true,
"message": "ticket already exists and is overridden."
}

Comments
0 comments
Please sign in to leave a comment.