💡Obter Tickets do Contato

Response

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://{BACKEND_URL}/api/contacts/alltickets',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_POSTFIELDS =>'{
    "number":"5511989091838"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer tokenmeu'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
[
    {
        "id": 4305,
        "status": "pending",
        "unreadMessages": 0,
        "lastMessage": "Pagamento Recebido para renovação do sistema: app.supersac.com.br por 1 mês",
        "protocolo": "6170",
        "typebot_sessionId": null,
        "typebot_status": null,
        "customA": null,
        "repeatCount": 1,
        "customB": null,
        "isGroup": false,
        "userId": null,
        "contactId": 24729,
        "whatsappId": 1,
        "queueId": 20,
        "chatbot": false,
        "channel": "whatsapp",
        "queueOptionId": null,
        "companyId": 1,
        "uuid": "ba6a3ddf-0cb7-419b-a4c1-5f3b86855acb",
        "promptId": null,
        "createdAt": "2024-01-13T09:30:02.803Z",
        "updatedAt": "2024-03-09T18:54:15.556Z",
        "tags": [
            {
                "id": 100,
                "name": "ABRA",
                "color": "#A4CCCC",
                "TicketTag": {
                    "ticketId": 4305,
                    "tagId": 100,
                    "createdAt": "2024-02-22T20:45:09.501Z",
                    "updatedAt": "2024-02-22T20:45:09.501Z"
                }
            },
            {
                "id": 56,
                "name": "10-CONEXOES",
                "color": "#A4CCCC",
                "TicketTag": {
                    "ticketId": 4305,
                    "tagId": 56,
                    "createdAt": "2024-02-22T20:45:09.501Z",
                    "updatedAt": "2024-02-22T20:45:09.501Z"
                }
            }
        ]
    },
    {
        "id": 4402,
        "status": "closed",
        "unreadMessages": 0,
        "lastMessage": "Por falta de interação, encerramos este atendimento.",
        "protocolo": "5580",
        "typebot_sessionId": null,
        "typebot_status": "on",
        "customA": null,
        "repeatCount": 0,
        "customB": null,
        "isGroup": false,
        "userId": null,
        "contactId": 24729,
        "whatsappId": 67,
        "queueId": null,
        "chatbot": false,
        "channel": "whatsapp",
        "queueOptionId": null,
        "companyId": 1,
        "uuid": "342bf193-090b-4528-9dcc-04a44d388e47",
        "promptId": null,
        "createdAt": "2024-01-29T23:04:04.806Z",
        "updatedAt": "2024-02-13T18:59:00.852Z",
        "tags": []
    },
    {
        "id": 4733,
        "status": "pending",
        "unreadMessages": 1,
        "lastMessage": "dsadsa",
        "protocolo": "6120",
        "typebot_sessionId": null,
        "typebot_status": null,
        "customA": null,
        "repeatCount": null,
        "customB": null,
        "isGroup": false,
        "userId": null,
        "contactId": 24729,
        "whatsappId": 17,
        "queueId": 21,
        "chatbot": false,
        "channel": "whatsapp",
        "queueOptionId": null,
        "companyId": 1,
        "uuid": "e6c13ac9-4afc-4264-86d2-f3c1d7d99e7f",
        "promptId": null,
        "createdAt": "2024-03-01T23:17:46.035Z",
        "updatedAt": "2024-03-01T23:17:46.228Z",
        "tags": []
    },
    {
        "id": 4579,
        "status": "open",
        "unreadMessages": null,
        "lastMessage": "audio-record-site-1709583841792.mp3",
        "protocolo": "6143",
        "typebot_sessionId": null,
        "typebot_status": null,
        "customA": null,
        "repeatCount": 0,
        "customB": null,
        "isGroup": false,
        "userId": 1,
        "contactId": 24729,
        "whatsappId": 130,
        "queueId": 63,
        "chatbot": false,
        "channel": "whatsapp_business_account",
        "queueOptionId": null,
        "companyId": 1,
        "uuid": "8939c24b-8eb7-455b-b6be-07cc8e493715",
        "promptId": null,
        "createdAt": "2024-02-23T01:26:11.726Z",
        "updatedAt": "2024-03-04T20:24:05.052Z",
        "tags": []
    },
    {
        "id": 4307,
        "status": "open",
        "unreadMessages": 12,
        "lastMessage": "*ESTA MENSAGEM FOI EDITADA PELO CONTATO*\n\nadsadas dsadas",
        "protocolo": "5461",
        "typebot_sessionId": null,
        "typebot_status": "on",
        "customA": null,
        "repeatCount": 0,
        "customB": null,
        "isGroup": false,
        "userId": 1,
        "contactId": 24729,
        "whatsappId": 2,
        "queueId": 1,
        "chatbot": false,
        "channel": "whatsapp",
        "queueOptionId": null,
        "companyId": 1,
        "uuid": "92cede83-16e6-4f76-8d4b-7bb2221520f2",
        "promptId": null,
        "createdAt": "2024-01-13T14:12:00.133Z",
        "updatedAt": "2024-03-09T19:00:10.165Z",
        "tags": []
    },
    {
        "id": 4377,
        "status": "open",
        "unreadMessages": 0,
        "lastMessage": "dsadas",
        "protocolo": "5246",
        "typebot_sessionId": null,
        "typebot_status": "on",
        "customA": null,
        "repeatCount": null,
        "customB": null,
        "isGroup": false,
        "userId": 1,
        "contactId": 24729,
        "whatsappId": 115,
        "queueId": null,
        "chatbot": false,
        "channel": "whatsapp",
        "queueOptionId": null,
        "companyId": 1,
        "uuid": "e3588aaa-d980-47fa-ba5d-0cd9ac69e392",
        "promptId": null,
        "createdAt": "2024-01-24T22:55:15.658Z",
        "updatedAt": "2024-01-25T13:21:30.120Z",
        "tags": []
    }
]

Last updated