Atualizar sensor
curl --request PATCH \
--url https://api-bc.pgubright.com/sensors/{sensor_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"wallet_address": "<string>",
"location": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', wallet_address: '<string>', location: '<string>'})
};
fetch('https://api-bc.pgubright.com/sensors/{sensor_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-bc.pgubright.com/sensors/{sensor_id}"
payload = {
"name": "<string>",
"wallet_address": "<string>",
"location": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"device_id": "<string>",
"name": "<string>",
"public_key": "<string>",
"wallet_address": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"status": "active",
"location": "<string>",
"last_communication_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}Sensores
Atualizar sensor
PATCH
/
sensors
/
{sensor_id}
Atualizar sensor
curl --request PATCH \
--url https://api-bc.pgubright.com/sensors/{sensor_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"wallet_address": "<string>",
"location": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', wallet_address: '<string>', location: '<string>'})
};
fetch('https://api-bc.pgubright.com/sensors/{sensor_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-bc.pgubright.com/sensors/{sensor_id}"
payload = {
"name": "<string>",
"wallet_address": "<string>",
"location": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"device_id": "<string>",
"name": "<string>",
"public_key": "<string>",
"wallet_address": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"status": "active",
"location": "<string>",
"last_communication_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
UUID do sensor no Meters Service.
Response
Sensor atualizado.
