Export customers
curl --request GET \
--url https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/reportimport requests
url = "https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report', 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://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"<string>"{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "INVALID_TYPE",
"origin": "REGISTRY",
"message": "Invalid type"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "FORBIDDEN_CUSTOMER",
"origin": "REGISTRY",
"message": "You do not have permission to perform this action on this resource (customer)"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "REGISTRY",
"message": "Bad Request: Your request is invalid or incomplete. Please make sure you are requesting with the right fields.",
"fields": [
{
"field": "type",
"message": "Invalid option: expected one of \"csv\"|\"xlsx\"",
"code": "TYPE_ONE_OF"
}
]
}Export customers
Exports every customer of the organization as a CSV or XLSX file.
GET
/
realms
/
{realmId}
/
organizations
/
{organizationId}
/
customers
/
report
Export customers
curl --request GET \
--url https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/reportimport requests
url = "https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report', 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://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/customers/report")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"<string>"{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "INVALID_TYPE",
"origin": "REGISTRY",
"message": "Invalid type"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "FORBIDDEN_CUSTOMER",
"origin": "REGISTRY",
"message": "You do not have permission to perform this action on this resource (customer)"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "REGISTRY",
"message": "Bad Request: Your request is invalid or incomplete. Please make sure you are requesting with the right fields.",
"fields": [
{
"field": "type",
"message": "Invalid option: expected one of \"csv\"|\"xlsx\"",
"code": "TYPE_ONE_OF"
}
]
}The file format goes in the
type query parameter: ?type=csv (the default) answers a UTF-8 CSV file, ?type=xlsx an Excel workbook returned base64-encoded. The file lists every customer of the organization, whatever its status, one per row, with four columns whose headers are in Portuguese: Nome do cliente (name), CPF/CNPJ (document), Status (Ativo or Desativado) and Data de Criação (creation date, as DD/MM/YYYY, the UTC date: a customer created at 22:30 in Brasília time on the 13th shows the 14th). The filters of the customer list do not apply.Path Parameters
ID of your realm.
Format: UUID
ID of the organization whose customers you want to export.
Format: UUID
Query Parameters
The file format: csv for a UTF-8 CSV file (the default), xlsx for an Excel workbook returned base64-encoded.
Available options:
csv, xlsx Response
application/csv — The customers as a UTF-8 CSV file, when type is csv or omitted (served with that Content-Type).
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet — The Excel workbook, base64-encoded, when type is xlsx.
The customers as a UTF-8 CSV file, when type is csv or omitted (served with that Content-Type).