Create new Dataset
curl --request PUT \
--url https://api.serial.io/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"process_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"usl": 123,
"lsl": 123,
"unit": "<string>"
}
'import requests
url = "https://api.serial.io/datasets"
payload = {
"name": "<string>",
"process_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"usl": 123,
"lsl": 123,
"unit": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
process_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
usl: 123,
lsl: 123,
unit: '<string>'
})
};
fetch('https://api.serial.io/datasets', 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.serial.io/datasets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'process_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'usl' => 123,
'lsl' => 123,
'unit' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.serial.io/datasets"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"process_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"usl\": 123,\n \"lsl\": 123,\n \"unit\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.serial.io/datasets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"process_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"usl\": 123,\n \"lsl\": 123,\n \"unit\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.serial.io/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"process_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"usl\": 123,\n \"lsl\": 123,\n \"unit\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"process_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data_type": "PARAMETRIC_QUANTITATIVE",
"created_at": "2023-11-07T05:31:56Z",
"process_revision": 123,
"order": 123,
"lsl": 123,
"usl": 123,
"unit": "<string>",
"child_component_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_value": true,
"is_active": true,
"values": [
"<string>"
]
}Datasets
Create Dataset
Endpoint for creating datasets (also referred to as data keys).
PUT
/
datasets
Create new Dataset
curl --request PUT \
--url https://api.serial.io/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"process_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"usl": 123,
"lsl": 123,
"unit": "<string>"
}
'import requests
url = "https://api.serial.io/datasets"
payload = {
"name": "<string>",
"process_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"usl": 123,
"lsl": 123,
"unit": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
process_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
usl: 123,
lsl: 123,
unit: '<string>'
})
};
fetch('https://api.serial.io/datasets', 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.serial.io/datasets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'process_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'usl' => 123,
'lsl' => 123,
'unit' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.serial.io/datasets"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"process_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"usl\": 123,\n \"lsl\": 123,\n \"unit\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.serial.io/datasets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"process_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"usl\": 123,\n \"lsl\": 123,\n \"unit\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.serial.io/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"process_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"usl\": 123,\n \"lsl\": 123,\n \"unit\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"process_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data_type": "PARAMETRIC_QUANTITATIVE",
"created_at": "2023-11-07T05:31:56Z",
"process_revision": 123,
"order": 123,
"lsl": 123,
"usl": 123,
"unit": "<string>",
"child_component_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_value": true,
"is_active": true,
"values": [
"<string>"
]
}Authorizations
API Key or Token formatted as Bearer <YOUR_KEY_OR_TOKEN>
Body
application/json
Indicates what type of dataset you would like to create.
Available options:
TEXT, NUMERICAL, BOOLEAN, FILE, IMAGE, DATETIME User-facing name for the dataset.
Process id that the dataset will be associated with.
FOR NUMERICAL DATA. Upper spec limit for the dataset
FOR NUMERICAL DATA. Lower spec limit for the dataset
FOR NUMERICAL DATA. Unit that should be displayed for the dataset
Response
OK
Database id for the dataset
User facing name for the dataset
Process id associated with the dataset
Available options:
PARAMETRIC_QUANTITATIVE, PARAMETRIC_QUALITATIVE, CHECKBOX, LINK, IMAGE, FILE, UID Order in which the dataset shows up relative to others
Available options:
true, false Used for property datasets, is a LRU cache of used values

