PHP

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 <?php require 'vendor/autoload.php'; $headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'Callback' => 'string', 'Authorization' => 'Bearer ' . $chave-api, ); $client = new \GuzzleHttp\Client(); // Define array of request body. $request_body = array( 'cpfCnpj' => '999.999.999-99', ); try { $response = $client->request('POST',$url, array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); } // ...

$url: URL da consulta, composta de Base URL + endpoint da consulta

$chave-api: chave da API que você visualiza acessando a interface

URL Base:

endpoint da consulta: Veja a documentação específica em https://crawly.atlassian.net/wiki/spaces/PLEXIAPI/pages/601522208