API - SISTEMA | BAILEYS | OFIC...
Criar Empresa
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/companies/add',
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 "name": "EMPRESA DE TESTE API33",
16 "phone": "5511989091838",
17 "namecomplete": "NOME DA EMPRESA33",
18 "pais": "BR",
19 "indicator": "INDICADOR DA EMPRESA",
20 "email": "[email protected]",
21 "password": "SENHA DE ACESSO",
22 "status": true,
23 "planId": "1",
24 "dueDate": "2024/12/01",
25 "recurrence": "MENSAL"
26}',
27 CURLOPT_HTTPHEADER => array(
28 'Content-Type: application/json',
29 'Authorization: Bearer tokenmeu'
30 ),
31));
32
33$response = curl_exec($curl);
34
35curl_close($curl);
36echo $response;
37
38
JSON
1{
2 "document": "",
3 "id": 71,
4 "name": "EMPRESA DE TESTE API44",
5 "phone": "5511989091838",
6 "namecomplete": "NOME DA EMPRESA44",
7 "pais": "BR",
8 "indicator": "INDICADOR DA EMPRESA",
9 "email": "[email protected]",
10 "status": true,
11 "planId": 1,
12 "dueDate": "2024-12-01T03:00:00.000Z",
13 "recurrence": "MENSAL",
14 "importar": false,
15 "updatedAt": "2023-12-10T16:39:09.609Z",
16 "createdAt": "2023-12-10T16:39:09.609Z",
17 "schedules": [],
18 "lastLogin": null,
19 "paymentMethod": "",
20 "messageCount": ""
21}
Updated 10 Dec 2023
Did this page help you?