Skip to main content
POST
/
sensors
Post Sensors
curl --request POST \
  --url https://api.sandbox.isometric.com/mrv/v0/sensors \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-client-secret: <x-client-secret>' \
  --data '
{
  "measurement_property": {},
  "reference": "<string>",
  "units": "<string>",
  "facility_id": "fcl_1G8QT5ZAB1S0XSDW",
  "manufacturer": "<string>",
  "model": "<string>",
  "storage_location_id": "slc_1F3PMGVC91S0SBK3"
}
'
import requests

url = "https://api.sandbox.isometric.com/mrv/v0/sensors"

payload = {
"measurement_property": {},
"reference": "<string>",
"units": "<string>",
"facility_id": "fcl_1G8QT5ZAB1S0XSDW",
"manufacturer": "<string>",
"model": "<string>",
"storage_location_id": "slc_1F3PMGVC91S0SBK3"
}
headers = {
"x-client-secret": "<x-client-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'x-client-secret': '<x-client-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
measurement_property: {},
reference: '<string>',
units: '<string>',
facility_id: 'fcl_1G8QT5ZAB1S0XSDW',
manufacturer: '<string>',
model: '<string>',
storage_location_id: 'slc_1F3PMGVC91S0SBK3'
})
};

fetch('https://api.sandbox.isometric.com/mrv/v0/sensors', 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://api.sandbox.isometric.com/mrv/v0/sensors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'measurement_property' => [

],
'reference' => '<string>',
'units' => '<string>',
'facility_id' => 'fcl_1G8QT5ZAB1S0XSDW',
'manufacturer' => '<string>',
'model' => '<string>',
'storage_location_id' => 'slc_1F3PMGVC91S0SBK3'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-client-secret: <x-client-secret>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.sandbox.isometric.com/mrv/v0/sensors"

payload := strings.NewReader("{\n \"measurement_property\": {},\n \"reference\": \"<string>\",\n \"units\": \"<string>\",\n \"facility_id\": \"fcl_1G8QT5ZAB1S0XSDW\",\n \"manufacturer\": \"<string>\",\n \"model\": \"<string>\",\n \"storage_location_id\": \"slc_1F3PMGVC91S0SBK3\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-client-secret", "<x-client-secret>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.sandbox.isometric.com/mrv/v0/sensors")
.header("x-client-secret", "<x-client-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"measurement_property\": {},\n \"reference\": \"<string>\",\n \"units\": \"<string>\",\n \"facility_id\": \"fcl_1G8QT5ZAB1S0XSDW\",\n \"manufacturer\": \"<string>\",\n \"model\": \"<string>\",\n \"storage_location_id\": \"slc_1F3PMGVC91S0SBK3\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.isometric.com/mrv/v0/sensors")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-client-secret"] = '<x-client-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"measurement_property\": {},\n \"reference\": \"<string>\",\n \"units\": \"<string>\",\n \"facility_id\": \"fcl_1G8QT5ZAB1S0XSDW\",\n \"manufacturer\": \"<string>\",\n \"model\": \"<string>\",\n \"storage_location_id\": \"slc_1F3PMGVC91S0SBK3\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "sns_1GJ82BEMB1S0FBFV",
  "manufacturer": "<string>",
  "measurement_property": {},
  "model": "<string>",
  "project_id": "<string>",
  "reference": "<string>",
  "units": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}

Authorizations

Authorization
string
header
required

A JWT Bearer token header for authentication and authorization, in the format Authorization: Bearer <token>

Headers

x-client-secret
string
required

A secret token identifying the client connecting to the API

Example:

"Syou3EZiO5vuMEgNyBeA8cjEMYOnQDwP"

Body

application/json
measurement_property
MeasurementProperty · object
required

The physical quantity this sensor measures

reference
string
required

What the supplier refers to this sensor by

Maximum string length: 255
units
string
required

The units of measurement for this sensor

facility_id
string | null

The facility where the sensor is installed

Required string length: 20 - 37
Example:

"fcl_1G8QT5ZAB1S0XSDW"

manufacturer
string | null

The manufacturer of the sensor

model
string | null

The model of the sensor

storage_location_id
string | null

The storage location where the sensor is stored

Required string length: 20 - 37
Example:

"slc_1F3PMGVC91S0SBK3"

Response

Successful Response

id
string
required
Required string length: 20 - 37
Examples:

"sns_1GJ82BEMB1S0FBFV"

"sns_1CCYZYWFWSBXYG38"

manufacturer
string | null
required
measurement_property
MeasurementProperty · object
required
model
string | null
required
project_id
string
required
reference
string
required
units
string
required