Ticket Ticket creation To perform an integration that creates a ticket, you must send a request with the following structure:
POST https://queue-api.obmessage.ai/api/v1/tickets
X-Api-Key: {{API_KEY}}
Content-Type: application/json
{
"topic_id" : s tr i n g ,
"data" : {
"id" : i nt ,
"name" : s tr i n g ,
"lastname" : s tr i n g
}
}
Example {
"topic_id" : "519ac790-85cd-411e-b744-d21d83f21178" ,
"data" : {
"id" : 1 ,
"name" : "Juan" ,
"lastname" : "Pérez"
}
}
Result when creating the ticket When the result is 200 OK, the response has the following structure:
{
"id" : uuid ,
"topic_id" : uuid ,
"status_id" : i nt ,
"ticket_number" : s tr i n g ,
"sla_minutes" : i nt ,
"priority" : i nt ,
"created_at" : u t c - da te
}
If the topic used has the with_turn option set to true, a turn will also be generated when the ticket is created. In that case, the result will have the following structure:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 {
"id" : uuid ,
"topic_id" : uuid ,
"status_id" : i nt ,
"ticket_number" : s tr i n g ,
"turn" : {
"id" : i nt ,
"created_at" : u t c - da te ,
"attention_date" : da te ,
"start_hour" : s tr i n g( t ime : hh : mm : ss) ,
"end_hour" : s tr i n g( t ime : hh : mm : ss) ,
"code" : s tr i n g
},
"sla_minutes" : 60 ,
"priority" : 1 ,
"created_at" : "2024-07-29T13:56:20.58197239Z"
}
Field description Field Type Description Required / Default value topic_id uuid ID of the topic from which the ticket will be created. ✔ status_id int Parent status of the ticket. The topic’s status_default is used. If the topic does not have a default status, this field is required. customer_status_id int Customer status of the ticket. The topic’s status_default is used. If the topic does not have a default status, the value will be null. assigned_user_id uuid ID of the user to whom the ticket will be assigned. ✖ sla_minutes int Ticket SLA value. If not sent, the topic’s sla_minutes value is used. priority int Ticket priority. Allowed range: [1-10]. The default value is 1. If not sent, the topic’s default_priority value is used. comment string Comments associated with the ticket. ✖ attachments []JSON Files attached to the ticket. The ID of the file registered in the fileserver must be sent. ✖ data JSON Set of data associated with the ticket. This data is displayed according to the configured template. ✔ turn_id int ID of the turn that will be used to copy the code when the ticket turn is generated. ✖ attention_date string Service date on which the turn will be handled, in yyyy-mm-dd format. datetime.NOW bot_script_id_success int Aless integration: ID of the script to which the bot should jump if the ticket is created successfully. ✖ bot_script_id_failed int Aless integration: ID of the script to which the bot should jump if an error occurs while creating the ticket. ✖
Errors when creating the ticket If the topic used is outside the configured schedule, the following error is returned:
{
"code" : "error.invalid_reference" ,
"message" : "error creating ticket: 'no schedules or turn'"
}
Try it in Postman