Login com senha em desenvolvimento
curl --request POST \
--url https://api-bc.pgubright.com/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"password": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({username: '<string>', password: '<string>'})
};
fetch('https://api-bc.pgubright.com/auth/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-bc.pgubright.com/auth/login"
payload = {
"username": "<string>",
"password": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"access_token": "<string>",
"expires_in": 123,
"refresh_expires_in": 123,
"refresh_token": "<string>",
"token_type": "Bearer",
"scope": "<string>"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}Autenticação
Login com senha em desenvolvimento
Password grant disponível apenas em desenvolvimento ou com flag específica.
POST
/
auth
/
login
Login com senha em desenvolvimento
curl --request POST \
--url https://api-bc.pgubright.com/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"password": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({username: '<string>', password: '<string>'})
};
fetch('https://api-bc.pgubright.com/auth/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-bc.pgubright.com/auth/login"
payload = {
"username": "<string>",
"password": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"access_token": "<string>",
"expires_in": 123,
"refresh_expires_in": 123,
"refresh_token": "<string>",
"token_type": "Bearer",
"scope": "<string>"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}