Obter informacoes da unidade
curl --request GET \
--url https://services.staging.app.dados.rio/subpav-osa-api/unidade/{cnes} \
--header 'Authorization: Bearer <token>'import requests
url = "https://services.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://services.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}', 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.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}",
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.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}"
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.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}")
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{
"cnes": "2269311",
"nome": "UBS Exemplo",
"funcionamento_dia_util": {
"inicio": 8,
"fim": 17
},
"logradouro": "Rua das Flores",
"numero": "123",
"complemento": "Sala 101",
"cep": "20000-000",
"telefone": "(21) 1234-5678",
"celular": "(21) 98765-4321",
"funcionamento_sabado": {
"inicio": 8,
"fim": 17
}
}{
"detail": "Token invalido"
}{
"detail": "Unidade nao encontrada"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Erro interno do servidor"
}Unidades
Obter informacoes da unidade
Retorna informacoes detalhadas de uma unidade de saude pelo codigo CNES
GET
/
unidade
/
{cnes}
Obter informacoes da unidade
curl --request GET \
--url https://services.staging.app.dados.rio/subpav-osa-api/unidade/{cnes} \
--header 'Authorization: Bearer <token>'import requests
url = "https://services.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://services.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}', 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.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}",
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.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}"
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.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.staging.app.dados.rio/subpav-osa-api/unidade/{cnes}")
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{
"cnes": "2269311",
"nome": "UBS Exemplo",
"funcionamento_dia_util": {
"inicio": 8,
"fim": 17
},
"logradouro": "Rua das Flores",
"numero": "123",
"complemento": "Sala 101",
"cep": "20000-000",
"telefone": "(21) 1234-5678",
"celular": "(21) 98765-4321",
"funcionamento_sabado": {
"inicio": 8,
"fim": 17
}
}{
"detail": "Token invalido"
}{
"detail": "Unidade nao encontrada"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Erro interno do servidor"
}Authorizations
Response
Informacoes da unidade retornadas com sucesso
Modelo para representar uma unidade de saude
