Skip to main content
POST
/
measurement_samples
Post Measurement Samples
curl --request POST \
  --url https://api.sandbox.isometric.com/mrv/v0/measurement_samples \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-client-secret: <x-client-secret>' \
  --data '
{
  "feedstock_batch_id": "ftb_1DYYDB3C91S0ZHPX",
  "measured_at": "2023-11-07T05:31:56Z",
  "measurement_location_id": "mlc_1CCZASA6Q1S0V8T4",
  "project_id": "prj_1CTWZQGKE1S0VAXA",
  "storage_location_id": "slc_1F3PMGVC91S0SBK3",
  "supplier_reference_id": "<string>",
  "values": [
    {
      "measurement_property": {},
      "value": {
        "magnitude": 123,
        "unit": "<string>",
        "standard_deviation": 123
      }
    }
  ],
  "production_batch_id": "ptb_1GAFJ4C051S06E0Z"
}
'
import requests

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

payload = {
"feedstock_batch_id": "ftb_1DYYDB3C91S0ZHPX",
"measured_at": "2023-11-07T05:31:56Z",
"measurement_location_id": "mlc_1CCZASA6Q1S0V8T4",
"project_id": "prj_1CTWZQGKE1S0VAXA",
"storage_location_id": "slc_1F3PMGVC91S0SBK3",
"supplier_reference_id": "<string>",
"values": [
{
"measurement_property": {},
"value": {
"magnitude": 123,
"unit": "<string>",
"standard_deviation": 123
}
}
],
"production_batch_id": "ptb_1GAFJ4C051S06E0Z"
}
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({
feedstock_batch_id: 'ftb_1DYYDB3C91S0ZHPX',
measured_at: '2023-11-07T05:31:56Z',
measurement_location_id: 'mlc_1CCZASA6Q1S0V8T4',
project_id: 'prj_1CTWZQGKE1S0VAXA',
storage_location_id: 'slc_1F3PMGVC91S0SBK3',
supplier_reference_id: '<string>',
values: [
{
measurement_property: {},
value: {magnitude: 123, unit: '<string>', standard_deviation: 123}
}
],
production_batch_id: 'ptb_1GAFJ4C051S06E0Z'
})
};

fetch('https://api.sandbox.isometric.com/mrv/v0/measurement_samples', 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/measurement_samples",
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([
'feedstock_batch_id' => 'ftb_1DYYDB3C91S0ZHPX',
'measured_at' => '2023-11-07T05:31:56Z',
'measurement_location_id' => 'mlc_1CCZASA6Q1S0V8T4',
'project_id' => 'prj_1CTWZQGKE1S0VAXA',
'storage_location_id' => 'slc_1F3PMGVC91S0SBK3',
'supplier_reference_id' => '<string>',
'values' => [
[
'measurement_property' => [

],
'value' => [
'magnitude' => 123,
'unit' => '<string>',
'standard_deviation' => 123
]
]
],
'production_batch_id' => 'ptb_1GAFJ4C051S06E0Z'
]),
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/measurement_samples"

payload := strings.NewReader("{\n \"feedstock_batch_id\": \"ftb_1DYYDB3C91S0ZHPX\",\n \"measured_at\": \"2023-11-07T05:31:56Z\",\n \"measurement_location_id\": \"mlc_1CCZASA6Q1S0V8T4\",\n \"project_id\": \"prj_1CTWZQGKE1S0VAXA\",\n \"storage_location_id\": \"slc_1F3PMGVC91S0SBK3\",\n \"supplier_reference_id\": \"<string>\",\n \"values\": [\n {\n \"measurement_property\": {},\n \"value\": {\n \"magnitude\": 123,\n \"unit\": \"<string>\",\n \"standard_deviation\": 123\n }\n }\n ],\n \"production_batch_id\": \"ptb_1GAFJ4C051S06E0Z\"\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/measurement_samples")
.header("x-client-secret", "<x-client-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"feedstock_batch_id\": \"ftb_1DYYDB3C91S0ZHPX\",\n \"measured_at\": \"2023-11-07T05:31:56Z\",\n \"measurement_location_id\": \"mlc_1CCZASA6Q1S0V8T4\",\n \"project_id\": \"prj_1CTWZQGKE1S0VAXA\",\n \"storage_location_id\": \"slc_1F3PMGVC91S0SBK3\",\n \"supplier_reference_id\": \"<string>\",\n \"values\": [\n {\n \"measurement_property\": {},\n \"value\": {\n \"magnitude\": 123,\n \"unit\": \"<string>\",\n \"standard_deviation\": 123\n }\n }\n ],\n \"production_batch_id\": \"ptb_1GAFJ4C051S06E0Z\"\n}")
.asString();
require 'uri'
require 'net/http'

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

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 \"feedstock_batch_id\": \"ftb_1DYYDB3C91S0ZHPX\",\n \"measured_at\": \"2023-11-07T05:31:56Z\",\n \"measurement_location_id\": \"mlc_1CCZASA6Q1S0V8T4\",\n \"project_id\": \"prj_1CTWZQGKE1S0VAXA\",\n \"storage_location_id\": \"slc_1F3PMGVC91S0SBK3\",\n \"supplier_reference_id\": \"<string>\",\n \"values\": [\n {\n \"measurement_property\": {},\n \"value\": {\n \"magnitude\": 123,\n \"unit\": \"<string>\",\n \"standard_deviation\": 123\n }\n }\n ],\n \"production_batch_id\": \"ptb_1GAFJ4C051S06E0Z\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "mts_1D7HS15KD1S03M0Z",
  "measured_at": "2023-12-25",
  "measurement_location_id": "mlc_1CCZASA6Q1S0V8T4",
  "production_batch_id": "ptb_1GAFJ4C051S06E0Z",
  "supplier_reference_id": "<string>",
  "values": [
    {
      "datapoint_id": "dtp_1DVKHKS101S0Q61Q",
      "measurement_property": {},
      "value": {
        "magnitude": 123,
        "unit": "<string>",
        "standard_deviation": 123
      }
    }
  ]
}
{
"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
feedstock_batch_id
string | null
required
Required string length: 20 - 37
Example:

"ftb_1DYYDB3C91S0ZHPX"

measured_at
string<date-time>
required
measurement_location_id
string | null
required
Required string length: 20 - 37
Example:

"mlc_1CCZASA6Q1S0V8T4"

measurement_type
enum<string>
required
Available options:
biochar_production_batch,
biochar_soil,
pyrolysis_reactor,
ew_soil,
ew_porewater,
ew_field_biomass,
ew_mineral_feedstock,
ew_ion_exchange_resin
project_id
string
required
Required string length: 20 - 37
Examples:

"prj_1CTWZQGKE1S0VAXA"

"prj_1E0QTWB22SBX34D1"

storage_location_id
string | null
required
Required string length: 20 - 37
Example:

"slc_1F3PMGVC91S0SBK3"

supplier_reference_id
string | null
required

A string that must be unique for all resources created by a specific supplier. It can be used by a client to identify the correct objects in their system.

Required string length: 1 - 200
values
CreateMeasurementSampleValueRequest · object[]
required
production_batch_id
string | null
Required string length: 20 - 37
Example:

"ptb_1GAFJ4C051S06E0Z"

Response

Successful Response

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

"mts_1D7HS15KD1S03M0Z"

"mts_1FN0MEX2ZSBX40DT"

measured_at
string<date>
required
measurement_location_id
string | null
required
Required string length: 20 - 37
Example:

"mlc_1CCZASA6Q1S0V8T4"

production_batch_id
string | null
required
Required string length: 20 - 37
Example:

"ptb_1GAFJ4C051S06E0Z"

supplier_reference_id
string | null
required

A string that must be unique for all resources created by a specific supplier. It can be used by a client to identify the correct objects in their system.

Required string length: 1 - 200
values
MeasurementValue · object[]
required