Get Links
The "Get Links" endpoint return the list of all units available linked on the specified unit.
Arke is a distributed computing environment, a topology with parent/child relations defines a hierarchical
structure among interconnected nodes.
So in our request we have to indicate if direction is Parent (upper nodes) or Child (lower nodes), by the param
url parent/child
.
The additional parameter depth
allows to define the number of nodes that we want reach.
⚠️
Set depth=0 as default to avoid loading links at a depth not of interest
Headers
Key | Value |
arke-project-key | <YOUR_PROJECT_ID> |
Authorization | Bearer <ACCESS_TOKEN> |
content-type | application/json |
HTTP Response status
Status code | Description |
200 | OK |
401 | Unauthorized |
403 | Forbidden |
500 | Internal server error |
Code samples for "Get Links"
GET
/api/lib/{parent_arke_id}/unit/{parent_unit_id}/link/{direction}
curl --location 'https://arkehub.com/api/lib/arke/unit' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response with linked Unit list
{
"content": {
"count": 2,
"items": [
{
"arke_id": "example_arke",
"id": "aabc8ca7-e9a5-4a76-bf3e-ddbb60c1ead7",
"label": "Example parent unit 1",
...
},
{
"arke_id": "example_arke_2",
"id": "e55ae094-9372-4f85-9214-a6fd386b4c1b",
"label": "Example parent unit 2",
...
},
]
},
"messages": []
}
Create Link
Code samples for "Create Link"
POST
/{parent_arke_id}/unit/{parent_unit_id}/link/{link_id}/{child_arke_id}/unit/{child_unit_id}
curl --location 'https://arkehub.com/api/lib/{parent_arke_id}/unit/{parent_unit_id}/link/{link_id}/{child_arke_id}/unit/{child_unit_id}' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response with association
{
"content": {
{
"child_id": "986233a4-4374-4590-9690-3b3e980ed64a";
"parent_id": "99d77c36-cf71-4acd-b744-09b2614cc11d";
"type": "link";
},
},
"messages": []
}
Remove Link
Code samples for "Remove Link in a Group"
DELETE
/parent_arke_id/unit/{parent_unit_id}/link/{link_id}/{child_arke_id}/unit/{child_unit_id}
curl --location 'https://arkehub.com/api/lib/parent_arke_id/unit/{parent_unit_id}/link/{link_id}/{child_arke_id}/unit/{child_unit_id}' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response with no content
{
"content": null,
"messages": []
}