Verificar acesso administrativo
curl --request GET \
--url https://api-bc.pgubright.com/admin-only \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-bc.pgubright.com/admin-only', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-bc.pgubright.com/admin-only"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"status": "ok"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}Perfil
Verificar acesso administrativo
GET
/
admin-only
Verificar acesso administrativo
curl --request GET \
--url https://api-bc.pgubright.com/admin-only \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-bc.pgubright.com/admin-only', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-bc.pgubright.com/admin-only"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"status": "ok"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}