API - SISTEMA | BAILEYS | OFIC...
Atualizar Empresa
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/companies',
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 => 'PUT',
14 CURLOPT_POSTFIELDS =>'{
15 "id": "69", //ID_EMPRESA
16 "status": true,
17 "planId": "1",
18 "dueDate": "2024/12/21",
19 "recurrence": "MENSAL"
20}',
21 CURLOPT_HTTPHEADER => array(
22 'Content-Type: application/json',
23 'Authorization: Bearer tokenmeu'
24 ),
25));
26
27$response = curl_exec($curl);
28
29curl_close($curl);
30echo $response;
31
JSON
1{
2 "id": 69,
3 "name": "EMPRESA DE TESTE API22",
4 "phone": "5511989091838",
5 "namecomplete": "NOME DA EMPRESA22",
6 "pais": "BR",
7 "indicator": "INDICADOR DA EMPRESA",
8 "email": "[email protected]",
9 "status": true,
10 "importar": false,
11 "document": "",
12 "dueDate": "2024/12/21",
13 "recurrence": "MENSAL",
14 "messageCount": "0",
15 "schedules": [],
16 "planId": "1",
17 "createdAt": "2023-12-10T16:23:03.151Z",
18 "updatedAt": "2023-12-10T17:02:25.911Z"
19}
Updated 10 Dec 2023
Did this page help you?