API - SISTEMA | BAILEYS | OFIC...
Obter Tickets do Contato
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/contacts/alltickets',
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 => 'GET',
14 CURLOPT_POSTFIELDS =>'{
15 "number":"5511989091838"
16}',
17 CURLOPT_HTTPHEADER => array(
18 'Content-Type: application/json',
19 'Authorization: Bearer tokenmeu'
20 ),
21));
22
23$response = curl_exec($curl);
24
25curl_close($curl);
26echo $response;
27
JSON
1[
2 {
3 "id": 4305,
4 "status": "pending",
5 "unreadMessages": 0,
6 "lastMessage": "Pagamento Recebido para renovação do sistema: app.supersac.com.br por 1 mês",
7 "protocolo": "6170",
8 "typebot_sessionId": null,
9 "typebot_status": null,
10 "customA": null,
11 "repeatCount": 1,
12 "customB": null,
13 "isGroup": false,
14 "userId": null,
15 "contactId": 24729,
16 "whatsappId": 1,
17 "queueId": 20,
18 "chatbot": false,
19 "channel": "whatsapp",
20 "queueOptionId": null,
21 "companyId": 1,
22 "uuid": "ba6a3ddf-0cb7-419b-a4c1-5f3b86855acb",
23 "promptId": null,
24 "createdAt": "2024-01-13T09:30:02.803Z",
25 "updatedAt": "2024-03-09T18:54:15.556Z",
26 "tags": [
27 {
28 "id": 100,
29 "name": "ABRA",
30 "color": "#A4CCCC",
31 "TicketTag": {
32 "ticketId": 4305,
33 "tagId": 100,
34 "createdAt": "2024-02-22T20:45:09.501Z",
35 "updatedAt": "2024-02-22T20:45:09.501Z"
36 }
37 },
38 {
39 "id": 56,
40 "name": "10-CONEXOES",
41 "color": "#A4CCCC",
42 "TicketTag": {
43 "ticketId": 4305,
44 "tagId": 56,
45 "createdAt": "2024-02-22T20:45:09.501Z",
46 "updatedAt": "2024-02-22T20:45:09.501Z"
47 }
48 }
49 ]
50 },
51 {
52 "id": 4402,
53 "status": "closed",
54 "unreadMessages": 0,
55 "lastMessage": "Por falta de interação, encerramos este atendimento.",
56 "protocolo": "5580",
57 "typebot_sessionId": null,
58 "typebot_status": "on",
59 "customA": null,
60 "repeatCount": 0,
61 "customB": null,
62 "isGroup": false,
63 "userId": null,
64 "contactId": 24729,
65 "whatsappId": 67,
66 "queueId": null,
67 "chatbot": false,
68 "channel": "whatsapp",
69 "queueOptionId": null,
70 "companyId": 1,
71 "uuid": "342bf193-090b-4528-9dcc-04a44d388e47",
72 "promptId": null,
73 "createdAt": "2024-01-29T23:04:04.806Z",
74 "updatedAt": "2024-02-13T18:59:00.852Z",
75 "tags": []
76 },
77 {
78 "id": 4733,
79 "status": "pending",
80 "unreadMessages": 1,
81 "lastMessage": "dsadsa",
82 "protocolo": "6120",
83 "typebot_sessionId": null,
84 "typebot_status": null,
85 "customA": null,
86 "repeatCount": null,
87 "customB": null,
88 "isGroup": false,
89 "userId": null,
90 "contactId": 24729,
91 "whatsappId": 17,
92 "queueId": 21,
93 "chatbot": false,
94 "channel": "whatsapp",
95 "queueOptionId": null,
96 "companyId": 1,
97 "uuid": "e6c13ac9-4afc-4264-86d2-f3c1d7d99e7f",
98 "promptId": null,
99 "createdAt": "2024-03-01T23:17:46.035Z",
100 "updatedAt": "2024-03-01T23:17:46.228Z",
101 "tags": []
102 },
103 {
104 "id": 4579,
105 "status": "open",
106 "unreadMessages": null,
107 "lastMessage": "audio-record-site-1709583841792.mp3",
108 "protocolo": "6143",
109 "typebot_sessionId": null,
110 "typebot_status": null,
111 "customA": null,
112 "repeatCount": 0,
113 "customB": null,
114 "isGroup": false,
115 "userId": 1,
116 "contactId": 24729,
117 "whatsappId": 130,
118 "queueId": 63,
119 "chatbot": false,
120 "channel": "whatsapp_business_account",
121 "queueOptionId": null,
122 "companyId": 1,
123 "uuid": "8939c24b-8eb7-455b-b6be-07cc8e493715",
124 "promptId": null,
125 "createdAt": "2024-02-23T01:26:11.726Z",
126 "updatedAt": "2024-03-04T20:24:05.052Z",
127 "tags": []
128 },
129 {
130 "id": 4307,
131 "status": "open",
132 "unreadMessages": 12,
133 "lastMessage": "*ESTA MENSAGEM FOI EDITADA PELO CONTATO*\n\nadsadas dsadas",
134 "protocolo": "5461",
135 "typebot_sessionId": null,
136 "typebot_status": "on",
137 "customA": null,
138 "repeatCount": 0,
139 "customB": null,
140 "isGroup": false,
141 "userId": 1,
142 "contactId": 24729,
143 "whatsappId": 2,
144 "queueId": 1,
145 "chatbot": false,
146 "channel": "whatsapp",
147 "queueOptionId": null,
148 "companyId": 1,
149 "uuid": "92cede83-16e6-4f76-8d4b-7bb2221520f2",
150 "promptId": null,
151 "createdAt": "2024-01-13T14:12:00.133Z",
152 "updatedAt": "2024-03-09T19:00:10.165Z",
153 "tags": []
154 },
155 {
156 "id": 4377,
157 "status": "open",
158 "unreadMessages": 0,
159 "lastMessage": "dsadas",
160 "protocolo": "5246",
161 "typebot_sessionId": null,
162 "typebot_status": "on",
163 "customA": null,
164 "repeatCount": null,
165 "customB": null,
166 "isGroup": false,
167 "userId": 1,
168 "contactId": 24729,
169 "whatsappId": 115,
170 "queueId": null,
171 "chatbot": false,
172 "channel": "whatsapp",
173 "queueOptionId": null,
174 "companyId": 1,
175 "uuid": "e3588aaa-d980-47fa-ba5d-0cd9ac69e392",
176 "promptId": null,
177 "createdAt": "2024-01-24T22:55:15.658Z",
178 "updatedAt": "2024-01-25T13:21:30.120Z",
179 "tags": []
180 }
181]
Updated 09 Mar 2024
Did this page help you?