Sincronizar Person Account no login
curl --request GET \
--url https://services.pref.rio/rmi/v1/auth/validate \
--header 'Authorization: Bearer <token>'import requests
url = "https://services.pref.rio/rmi/v1/auth/validate"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://services.pref.rio/rmi/v1/auth/validate', 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://services.pref.rio/rmi/v1/auth/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://services.pref.rio/rmi/v1/auth/validate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://services.pref.rio/rmi/v1/auth/validate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/rmi/v1/auth/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"action": "matched",
"cidadao": {
"accountId": "<string>",
"canalOrigem": "<string>",
"canalUltimaModificacao": "<string>",
"complemento": "<string>",
"consentimento": [
{
"acao": "<string>",
"canal": "<string>",
"categoria": "<string>",
"data": "<string>",
"finalidade": "<string>",
"motivo": "<string>",
"status": "<string>"
}
],
"cpf": "<string>",
"dataNascimento": "<string>",
"deficiencia": "<string>",
"email": "<string>",
"endereco": {
"bairro": "<string>",
"cep": "<string>",
"cidade": "<string>",
"complemento": "<string>",
"estado": "<string>",
"logradouro": "<string>",
"pais": "<string>"
},
"escolaridade": "<string>",
"genero": "<string>",
"idioma": [
"<string>"
],
"isTourist": true,
"nacionalidade": "<string>",
"nome": "<string>",
"nomeExibicao": "<string>",
"nomeSocial": "<string>",
"passaporte": "<string>",
"raca": "<string>",
"rendaFamiliar": "<string>",
"telefone1": "<string>",
"telefone2": "<string>",
"telefone3": "<string>",
"telefoneInternacional": "<string>",
"telefonePrincipal": "<string>",
"tipoTelefone1": "<string>",
"tipoTelefone2": "<string>",
"tipoTelefone3": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}salesforce
Sincronizar Person Account no login
Orquestra o Person Account no Salesforce: GET → match / PATCH silencioso de email / POST create em 404 (contaOrigem Portal Pref.Rio). Usa CPF, nome e email do JWT. Não persiste dados do SF no Mongo do RMI.
GET
/
auth
/
validate
Sincronizar Person Account no login
curl --request GET \
--url https://services.pref.rio/rmi/v1/auth/validate \
--header 'Authorization: Bearer <token>'import requests
url = "https://services.pref.rio/rmi/v1/auth/validate"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://services.pref.rio/rmi/v1/auth/validate', 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://services.pref.rio/rmi/v1/auth/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://services.pref.rio/rmi/v1/auth/validate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://services.pref.rio/rmi/v1/auth/validate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/rmi/v1/auth/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"action": "matched",
"cidadao": {
"accountId": "<string>",
"canalOrigem": "<string>",
"canalUltimaModificacao": "<string>",
"complemento": "<string>",
"consentimento": [
{
"acao": "<string>",
"canal": "<string>",
"categoria": "<string>",
"data": "<string>",
"finalidade": "<string>",
"motivo": "<string>",
"status": "<string>"
}
],
"cpf": "<string>",
"dataNascimento": "<string>",
"deficiencia": "<string>",
"email": "<string>",
"endereco": {
"bairro": "<string>",
"cep": "<string>",
"cidade": "<string>",
"complemento": "<string>",
"estado": "<string>",
"logradouro": "<string>",
"pais": "<string>"
},
"escolaridade": "<string>",
"genero": "<string>",
"idioma": [
"<string>"
],
"isTourist": true,
"nacionalidade": "<string>",
"nome": "<string>",
"nomeExibicao": "<string>",
"nomeSocial": "<string>",
"passaporte": "<string>",
"raca": "<string>",
"rendaFamiliar": "<string>",
"telefone1": "<string>",
"telefone2": "<string>",
"telefone3": "<string>",
"telefoneInternacional": "<string>",
"telefonePrincipal": "<string>",
"tipoTelefone1": "<string>",
"tipoTelefone2": "<string>",
"tipoTelefone3": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}