API - SISTEMA | BAILEYS | OFIC...
Atribuir Tags
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/tags/add',
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": 383, // ID do Ticket
16 "tags": [
17 {
18 "id": 100 // ID da TAG
19 },
20 {
21 "id": 98 // ID da TAG
22 }
23 ]
24}',
25 CURLOPT_HTTPHEADER => array(
26 'Content-Type: application/json',
27 'Authorization: Bearer seutokenaqui'
28 ),
29));
30
31$response = curl_exec($curl);
32
33curl_close($curl);
34echo $response;
35
JSON
1{
2 "id": 383,
3 "status": "open",
4 "unreadMessages": 0,
5 "lastMessage": "Apos a primeira",
6 "isGroup": false,
7 "userId": 1,
8 "contactId": 4300,
9 "whatsappId": 1,
10 "queueId": 1,
11 "chatbot": false,
12 "channel": "whatsapp",
13 "queueOptionId": null,
14 "companyId": 1,
15 "uuid": "ea7407a7-4f55-4a8c-907e-8e8b29466bee",
16 "createdAt": "2023-09-04T08:13:17.451Z",
17 "updatedAt": "2023-09-14T22:12:44.180Z",
18 "tags": [
19 {
20 "id": 56,
21 "name": "10-CONEXOES",
22 "color": "#A4CCCC",
23 "kanban": 0,
24 "prioridade": 0,
25 "conversao": null,
26 "companyId": 1,
27 "createdAt": "2023-08-07T21:19:34.178Z",
28 "updatedAt": "2023-08-07T21:19:34.178Z",
29 "TicketTag": {
30 "ticketId": 383,
31 "tagId": 56,
32 "createdAt": "2023-09-15T00:59:04.965Z",
33 "updatedAt": "2023-09-15T00:59:04.965Z"
34 }
35 }
36 ]
37}
Updated 10 Dec 2023
Did this page help you?