API - SISTEMA | BAILEYS | OFIC...
Criar Ticket
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/tickets/createTicketAPI',
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 "contactId": 9580
16}',
17 CURLOPT_HTTPHEADER => array(
18 'Content-Type: application/json',
19 'Authorization: Bearer meutoken'
20 ),
21));
22
23$response = curl_exec($curl);
24
25curl_close($curl);
26echo $response;
27
JSON
1{
2 "id": 4250,
3 "status": "pending",
4 "unreadMessages": 0,
5 "lastMessage": "",
6 "protocolo": "5085",
7 "typebot_sessionId": null,
8 "typebot_status": null,
9 "customA": null,
10 "customB": null,
11 "isGroup": false,
12 "userId": null,
13 "contactId": 9580,
14 "whatsappId": 2,
15 "queueId": null,
16 "chatbot": false,
17 "channel": "whatsapp",
18 "queueOptionId": null,
19 "companyId": 1,
20 "uuid": "7921ee5f-1483-4048-b3b3-de7a4e511df0",
21 "createdAt": "2024-01-07T19:03:41.947Z",
22 "updatedAt": "2024-01-07T19:05:53.318Z",
23 "contact": {
24 "id": 9580,
25 "name": ".",
26 "number": "5521999999999",
27 "email": "",
28 "profilePicUrl": "https://pps.whatsapp.net/v/t61.24694-24/390056998_185805554567616_3986132482091405074_n.jpg?stp=dst-jpg_s96x96&ccb=11-4&oh=01_AdSL4g3dnZR59zlS0qT6LeBuW7QTrRxpRBVCceDY9ODXBg&oe=656D829B&_nc_sid=e6ed6c&_nc_cat=111",
29 "acceptAudioMessage": true,
30 "active": true,
31 "disableBot": false,
32 "extraInfo": []
33 },
34 "user": null,
35 "queue": null,
36 "whatsapp": {
37 "name": "SUPORTE X",
38 "webhook": "https://ennszy6hsaea9.x.pipedream.net/",
39 "id": 2,
40 "token": "ruan",
41 "coverImage": 4
42 },
43 "tags": [],
44 "company": {
45 "name": "Whaticket SaaS"
46 }
47}
Updated 07 Jan 2024
Did this page help you?