The request includes the information explained in the table below:
| subject | Title of the ticket |
| content | Content of the ticket |
| status | The status of the request includes: {0: new, 1: open, 2; pending, 3: solved,} |
| agent_id | ID of the assigned user. |
| group_id | ID of the assigned group. |
| requester_id | ID of the requester. |
| user_id | ID of the ticket creator or the person who added the comment. |
| cc_agents | ID of the agents CC’d on the request. [{id1},{id2},…] |
| type | The type of ticket includes: {1: question, 2: incident, 3: problem, 4: task} |
| priority | The priority of the ticket includes: {1: low, 2: normal, 3: high, 4: urgent} |
| tags | Assign tags to the request. [{tag1},{tag2},…] |
| fields | Ticket information (label set). {field_key1:value1, field_key2:value2,…} |
API to Create a Request
POST api/1.1/ticket/
To create a request, the following information is required: subject and comment.
The other information is optional and can be added based on your needs.
To create a resolved request, the agent_id is required.
Example:
{
"ticket":{
"subject":"How much does it cost?",
"status":0,
"priority":1,
"type":"2",
"requester_id":"64c89165f07f19292585ab47",
"agent_id":"64a7865518ebb62973b10877",
"group_id":"644a31b0e8484a0ad705ebc1",
"tags":["123","456"],
"fields":{
"list": "men",
"class": [
"1"
],
"age": "7",
"store": "bhx"
}
},
"comment":{
"content":"How much does it cost?"
},
"user_id":"64c89165f07f19292585ab47" //user_id=requester_id nếu người tạo là khách hàng
}
THÊM COMMENT
POST api/1.1/comment
{
"comment": {
"content": "Does it come with a warranty?"
},
"user_id": "64a7865518ebb62973b10877",
"ticket_id": "650bef14628652571b56940a"
}