curl --request POST \
--url https://public-usuario-api.autorize.com.br/api/hash-consulta \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "<string>",
"isConsentimento": true,
"idPgccConsentimento": "<string>",
"cnpjAnuente": "<string>",
"dataExpiracao": "2023-11-07T05:31:56Z",
"cpfOperador": "<string>"
}
'import requests
url = "https://public-usuario-api.autorize.com.br/api/hash-consulta"
payload = {
"templateId": "<string>",
"isConsentimento": True,
"idPgccConsentimento": "<string>",
"cnpjAnuente": "<string>",
"dataExpiracao": "2023-11-07T05:31:56Z",
"cpfOperador": "<string>"
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
templateId: '<string>',
isConsentimento: true,
idPgccConsentimento: '<string>',
cnpjAnuente: '<string>',
dataExpiracao: '2023-11-07T05:31:56Z',
cpfOperador: '<string>'
})
};
fetch('https://public-usuario-api.autorize.com.br/api/hash-consulta', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-usuario-api.autorize.com.br/api/hash-consulta",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'templateId' => '<string>',
'isConsentimento' => true,
'idPgccConsentimento' => '<string>',
'cnpjAnuente' => '<string>',
'dataExpiracao' => '2023-11-07T05:31:56Z',
'cpfOperador' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-usuario-api.autorize.com.br/api/hash-consulta"
payload := strings.NewReader("{\n \"templateId\": \"<string>\",\n \"isConsentimento\": true,\n \"idPgccConsentimento\": \"<string>\",\n \"cnpjAnuente\": \"<string>\",\n \"dataExpiracao\": \"2023-11-07T05:31:56Z\",\n \"cpfOperador\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public-usuario-api.autorize.com.br/api/hash-consulta")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"templateId\": \"<string>\",\n \"isConsentimento\": true,\n \"idPgccConsentimento\": \"<string>\",\n \"cnpjAnuente\": \"<string>\",\n \"dataExpiracao\": \"2023-11-07T05:31:56Z\",\n \"cpfOperador\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-usuario-api.autorize.com.br/api/hash-consulta")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"templateId\": \"<string>\",\n \"isConsentimento\": true,\n \"idPgccConsentimento\": \"<string>\",\n \"cnpjAnuente\": \"<string>\",\n \"dataExpiracao\": \"2023-11-07T05:31:56Z\",\n \"cpfOperador\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"sucesso": true,
"isPgccErro": true,
"pgccCodigoErro": "Continue",
"mensagem": "<string>",
"data": {
"hash": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Criar hash de consulta
Cria nova hash de consulta. Quando isConsentimento for true e idPgccConsentimento for informado, o hash é gerado vinculado ao consentimento identificado pelo ID do consentimento no PGCC. Caso contrário, o hash é gerado sem vínculo com consentimento.
curl --request POST \
--url https://public-usuario-api.autorize.com.br/api/hash-consulta \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "<string>",
"isConsentimento": true,
"idPgccConsentimento": "<string>",
"cnpjAnuente": "<string>",
"dataExpiracao": "2023-11-07T05:31:56Z",
"cpfOperador": "<string>"
}
'import requests
url = "https://public-usuario-api.autorize.com.br/api/hash-consulta"
payload = {
"templateId": "<string>",
"isConsentimento": True,
"idPgccConsentimento": "<string>",
"cnpjAnuente": "<string>",
"dataExpiracao": "2023-11-07T05:31:56Z",
"cpfOperador": "<string>"
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
templateId: '<string>',
isConsentimento: true,
idPgccConsentimento: '<string>',
cnpjAnuente: '<string>',
dataExpiracao: '2023-11-07T05:31:56Z',
cpfOperador: '<string>'
})
};
fetch('https://public-usuario-api.autorize.com.br/api/hash-consulta', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-usuario-api.autorize.com.br/api/hash-consulta",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'templateId' => '<string>',
'isConsentimento' => true,
'idPgccConsentimento' => '<string>',
'cnpjAnuente' => '<string>',
'dataExpiracao' => '2023-11-07T05:31:56Z',
'cpfOperador' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-usuario-api.autorize.com.br/api/hash-consulta"
payload := strings.NewReader("{\n \"templateId\": \"<string>\",\n \"isConsentimento\": true,\n \"idPgccConsentimento\": \"<string>\",\n \"cnpjAnuente\": \"<string>\",\n \"dataExpiracao\": \"2023-11-07T05:31:56Z\",\n \"cpfOperador\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public-usuario-api.autorize.com.br/api/hash-consulta")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"templateId\": \"<string>\",\n \"isConsentimento\": true,\n \"idPgccConsentimento\": \"<string>\",\n \"cnpjAnuente\": \"<string>\",\n \"dataExpiracao\": \"2023-11-07T05:31:56Z\",\n \"cpfOperador\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-usuario-api.autorize.com.br/api/hash-consulta")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"templateId\": \"<string>\",\n \"isConsentimento\": true,\n \"idPgccConsentimento\": \"<string>\",\n \"cnpjAnuente\": \"<string>\",\n \"dataExpiracao\": \"2023-11-07T05:31:56Z\",\n \"cpfOperador\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"sucesso": true,
"isPgccErro": true,
"pgccCodigoErro": "Continue",
"mensagem": "<string>",
"data": {
"hash": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Headers
Body
Identificador do template do caso de uso.
Indica se a hash está associada a um consentimento.
Identificador do consentimento na PGCC. Obrigatório quando IsConsentimento for verdadeiro.
CNPJ do anuente. Obrigatório somente em casos de uso (tempalteId) com modalidade de acesso "Indireto".
Data de expiração da hash de consulta. Caso não informado será definido internamente o valor padrão de 7 dias.
CPF da pessoa responsável por realizar a requisição. Pode ser nulo, inclusive em processamentos automatizados sem operador humano.
Response
OK
Continue, SwitchingProtocols, Processing, EarlyHints, OK, Created, Accepted, NonAuthoritativeInformation, NoContent, ResetContent, PartialContent, MultiStatus, AlreadyReported, IMUsed, MultipleChoices, MovedPermanently, Found, SeeOther, NotModified, UseProxy, Unused, TemporaryRedirect, PermanentRedirect, BadRequest, Unauthorized, PaymentRequired, Forbidden, NotFound, MethodNotAllowed, NotAcceptable, ProxyAuthenticationRequired, RequestTimeout, Conflict, Gone, LengthRequired, PreconditionFailed, RequestEntityTooLarge, RequestUriTooLong, UnsupportedMediaType, RequestedRangeNotSatisfiable, ExpectationFailed, MisdirectedRequest, UnprocessableEntity, Locked, FailedDependency, UpgradeRequired, PreconditionRequired, TooManyRequests, RequestHeaderFieldsTooLarge, UnavailableForLegalReasons, InternalServerError, NotImplemented, BadGateway, ServiceUnavailable, GatewayTimeout, HttpVersionNotSupported, VariantAlsoNegotiates, InsufficientStorage, LoopDetected, NotExtended, NetworkAuthenticationRequired Show child attributes
Show child attributes