API - SISTEMA | BAILEYS | OFIC...
Encerrar Atendimento
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/messages/finish',
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 "companyId": "1", //Id da Empresa
16 "ticketId": "98" // Id do Ticket
17 }',
18 CURLOPT_HTTPHEADER => array(
19 'Authorization: Bearer seutokenaqui' //Token cadastrado na conexão
20 ),
21));
22
23$response = curl_exec($curl);
24
25curl_close($curl);
26echo $response;
27
JSON
1{
2 "res": {
3 "id": 98,
4 "status": "closed",
5 "unreadMessages": 0,
6 "lastMessage": "Mensagem de teste",
7 "isGroup": false,
8 "userId": null,
9 "contactId": 1,
10 "whatsappId": 2,
11 "queueId": null,
12 "chatbot": false,
13 "channel": "whatsapp",
14 "queueOptionId": null,
15 "companyId": 1,
16 "uuid": "82291813-86f8-4504-b7d5-c562c6123129",
17 "createdAt": "2023-07-25T14:20:59.917Z",
18 "updatedAt": "2023-08-13T15:56:14.759Z"
19 }
20}
Updated 10 Dec 2023
![Doc contributor](https://s3.amazonaws.com/archbee-animals/koala.png)
Did this page help you?