API - SISTEMA | BAILEYS | OFIC...
Atualizar Ticket
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/tickets/updateAPI',
7 CURLOPT_RETURNTRANSFER => true,
8 CURLOPT_ENCODING => '',
9 CURLOPT_MAXREDIRS => 10,
10 CURLOPT_TIMEOUT => 0,
11 CURLOPT_FOLLOWLOCATION => true,
12 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13 CURLOPT_CUSTOMREQUEST => 'POST',
14 CURLOPT_POSTFIELDS =>'{
15 "ticketId": "1067", // Informe o ID do Ticket
16 "status": "pending", // Informe o Status: open, closed, pending
17 "userId": "13", // ID do usuário null ou número
18 "queueId": "34", // ID da fila null ou número
19 "typebot_sessionId": "CAMPO LIVRE LETRAS E NÚMEROS",
20 "customA": "CAMPO LIVRE LETRAS E NÚMEROS",
21 "customB": "CAMPO LIVRE LETRAS E NÚMEROS"
22}',
23 CURLOPT_HTTPHEADER => array(
24 'Content-Type: application/json',
25 'Authorization: Bearer tokenmeu'
26 ),
27));
28
29$response = curl_exec($curl);
30
31curl_close($curl);
32echo $response;
33
JSON
1{
2 "id": 1067,
3 "status": "pending",
4 "unreadMessages": 0,
5 "lastMessage": "",
6 "protocolo": "1693",
7 "typebot_sessionId": "ur3209ru82094823043209rd320984230",
8 "customA": "Campo customizado 1",
9 "customB": "Campo customizado 2",
10 "isGroup": false,
11 "userId": null,
12 "contactId": 9016,
13 "whatsappId": 17,
14 "queueId": 34,
15 "chatbot": false,
16 "channel": "whatsapp",
17 "queueOptionId": null,
18 "companyId": 1,
19 "uuid": "34c8b52a-7fb4-4fc3-b819-08b189b6cee0",
20 "createdAt": "2023-10-29T17:55:20.292Z",
21 "updatedAt": "2023-10-29T19:23:10.869Z",
22 "contact": {
23 "id": 9016,
24 "name": "Rafael TIM",
25 "number": "555182551310",
26 "email": "",
27 "profilePicUrl": "",
28 "acceptAudioMessage": true,
29 "active": true,
30 "disableBot": false,
31 "extraInfo": []
32 },
33 "user": null,
34 "queue": {
35 "id": 34,
36 "name": "Teste Perfeito",
37 "color": "#0c797d"
38 },
39 "whatsapp": {
40 "name": "Rafa AB LZ",
41 "webhook": "",
42 "id": 17,
43 "token": "",
44 "coverImage": null
45 },
46 "tags": [],
47 "company": {
48 "id": 1,
49 "name": "Whaticket SaaS"
50 }
51}
Updated 10 Jul 2024
Did this page help you?