curl --request PUT \
--url https://api.serial.io/components/instances/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"parent_component_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"child_component_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"process_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"break_prior_links": true
}
'import requests
url = "https://api.serial.io/components/instances/links"
payload = {
"parent_component_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"child_component_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"process_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"break_prior_links": True
}
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({
parent_component_instance_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
child_component_instance_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
process_entry_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
dataset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
break_prior_links: true
})
};
fetch('https://api.serial.io/components/instances/links', 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/components/instances/links",
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([
'parent_component_instance_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'child_component_instance_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'process_entry_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'dataset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'break_prior_links' => true
]),
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/components/instances/links"
payload := strings.NewReader("{\n \"parent_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"child_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"process_entry_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dataset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"break_prior_links\": true\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/components/instances/links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"parent_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"child_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"process_entry_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dataset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"break_prior_links\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.serial.io/components/instances/links")
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 \"parent_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"child_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"process_entry_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dataset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"break_prior_links\": true\n}"
response = http.request(request)
puts response.read_body{
"broken_links": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"has_child_of_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"process_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unique_identifier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"removed_at": "2023-11-07T05:31:56Z"
}
],
"new_link": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"has_child_of_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"process_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unique_identifier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"removed_at": "2023-11-07T05:31:56Z"
},
"prior_link": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"has_child_of_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"process_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unique_identifier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"removed_at": "2023-11-07T05:31:56Z"
}
}Create Component Instance Link
Endpoint to create a link between two component instances
curl --request PUT \
--url https://api.serial.io/components/instances/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"parent_component_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"child_component_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"process_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"break_prior_links": true
}
'import requests
url = "https://api.serial.io/components/instances/links"
payload = {
"parent_component_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"child_component_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"process_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"break_prior_links": True
}
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({
parent_component_instance_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
child_component_instance_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
process_entry_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
dataset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
break_prior_links: true
})
};
fetch('https://api.serial.io/components/instances/links', 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/components/instances/links",
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([
'parent_component_instance_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'child_component_instance_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'process_entry_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'dataset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'break_prior_links' => true
]),
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/components/instances/links"
payload := strings.NewReader("{\n \"parent_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"child_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"process_entry_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dataset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"break_prior_links\": true\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/components/instances/links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"parent_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"child_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"process_entry_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dataset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"break_prior_links\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.serial.io/components/instances/links")
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 \"parent_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"child_component_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"process_entry_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dataset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"break_prior_links\": true\n}"
response = http.request(request)
puts response.read_body{
"broken_links": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"has_child_of_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"process_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unique_identifier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"removed_at": "2023-11-07T05:31:56Z"
}
],
"new_link": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"has_child_of_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"process_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unique_identifier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"removed_at": "2023-11-07T05:31:56Z"
},
"prior_link": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"has_child_of_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"process_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unique_identifier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"removed_at": "2023-11-07T05:31:56Z"
}
}Authorizations
API Key or Token formatted as Bearer <YOUR_KEY_OR_TOKEN>
Body
Database id for the parent component instance id.
Database id for the child component instance id. Note, if this component instance is serialized (component type "SN"), then it will automatically break any links it had with prior parents.
Database id for the process entry where the link occured
Database id for the dataset for which the link was created.
If true, will break all prior links for the parent. I.e. if an axle had a tire linked to it, and a new link was created with this option set to true, that link between the axle and tire would be broken.
Response
OK
List of broken component instance links
Show child attributes
Show child attributes
Newly created component instance link
Show child attributes
Show child attributes
If a specific link already exists between a parent and child for a given dataset & process, that already created link is returned here
Show child attributes
Show child attributes

