API - SISTEMA | BAILEYS | OFIC...
Encerrar Atendimento
1 min
\<?php $curl = curl init(); curl setopt array($curl, array( curlopt url => 'https //{backend url}/api/messages/finish', curlopt returntransfer => true, curlopt encoding => '', curlopt maxredirs => 10, curlopt timeout => 0, curlopt followlocation => true, curlopt http version => curl http version 1 1, curlopt customrequest => 'post', curlopt postfields =>'{ "companyid" "1", //id da empresa "ticketid" "98" // id do ticket }', curlopt httpheader => array( 'authorization bearer seutokenaqui' //token cadastrado na conexão ), )); $response = curl exec($curl); curl close($curl); echo $response; { "res" { "id" 98, "status" "closed", "unreadmessages" 0, "lastmessage" "mensagem de teste", "isgroup" false, "userid" null, "contactid" 1, "whatsappid" 2, "queueid" null, "chatbot" false, "channel" "whatsapp", "queueoptionid" null, "companyid" 1, "uuid" "82291813 86f8 4504 b7d5 c562c6123129", "createdat" "2023 07 25t14 20 59 917z", "updatedat" "2023 08 13t15 56 14 759z" } }