API - SISTEMA | BAILEYS | OFIC...
Atualizar Contato
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/contact/update',
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 "id": "24294",
16 "name": "Teste Atualizando Nome",
17 "number": "5521995027350",
18 "email": "[email protected]",
19 "carteiraId": "", // null ou vazio para não utilizar
20 "extraInfo": [
21 {
22 "name": "Código",
23 "value": "43242er32"
24 },
25 {
26 "name": "Valor do Lead",
27 "value": "100,00"
28 },
29 {
30 "name": "CEP",
31 "value": "91130720"
32 }
33 ]
34}',
35 CURLOPT_HTTPHEADER => array(
36 'Content-Type: application/json',
37 'Authorization: Bearer tokenmeu'
38 ),
39));
40
41$response = curl_exec($curl);
42
43curl_close($curl);
44echo $response;
45
JSON
1{
2 "id": 24294,
3 "name": "Teste Atualizando Nome",
4 "number": "5521995027350",
5 "email": "[email protected]",
6 "companyId": 1,
7 "acceptAudioMessage": true,
8 "active": true,
9 "profilePicUrl": "",
10 "extraInfo": [
11 {
12 "id": 21,
13 "name": "Código",
14 "value": "43242er32",
15 "contactId": 24294,
16 "createdAt": "2023-12-10T20:03:51.633Z",
17 "updatedAt": "2023-12-10T20:03:51.633Z"
18 },
19 {
20 "id": 20,
21 "name": "CEP",
22 "value": "91130720",
23 "contactId": 24294,
24 "createdAt": "2023-12-10T20:03:51.633Z",
25 "updatedAt": "2023-12-10T20:03:51.633Z"
26 },
27 {
28 "id": 22,
29 "name": "Valor do Lead",
30 "value": "100,00",
31 "contactId": 24294,
32 "createdAt": "2023-12-10T20:03:51.633Z",
33 "updatedAt": "2023-12-10T20:03:51.633Z"
34 }
35 ]
36}
Updated 17 Dec 2023
Did this page help you?