Objects - API DOCS
Each entity on an Arcentry diagram is an object: Components, Areas, Line Groups, Images, Widgets, and Icons can all be created and manipulated in realtime using this API.
Get Object by ID
Returns all properties for the object with the given ID
GET
https://arcentry.com/api/v1/doc/docId/obj/objId
{
"type": "label",
"data": {
"text": "Monitoring Endpoint",
"color": "#EA4335",
"fontSize": 0.5,
"position": { "x": -28.25, "y": -25.5 },
"rotation": 0,
"fontStyle": { "bold": true, "italic": false },
"textAlign": "right",
"dimensions": { "width": 4, "height": 1 },
"fontFamily": "\"Open Sans\",-apple-system, BlinkMacSystemFont, \"Helvetica Neue\", sans-serif",
"outlineColor": "#FFFFFF",
"outlineWidth": 0.1
}
}
curl --header "Authorization: Bearer YOUR_API_KEY" https://arcentry.com/api/v1/doc/d341ef2f-9f9f-4ad8-900b-7c1715d3324a/obj/1chsmqmgt-q6lfvkevo
Retrieve Data for Objects matching a selector
Retrieves all objects where Metadata matches a given Selector
GET
https://arcentry.com/api/v1/doc/docId/obj/where/selector
{
"1cml7vrs0-ef6r4n2uv": {
"type": "component",
"data": {
"meta": { "dockerImg": "mysql-small" },
"opacity": 1,
"position": { "x": 6, "y": 1 },
"rotation": 0,
"componentId": "database.mysql",
"showMetaData": true,
"metaDataFontSize": 0.5,
"metaDataRotation": 0,
"showMetaDataKeys": true,
"metaDataTextAlign": "center"
}
},
"1cml7v3dp-13nr9eg006": {
"type": "component",
"data": {
"meta": { "dockerImg": "mysql-small" },
"opacity": 1,
"position": { "x": 2, "y": 1 },
"rotation": 0,
"componentId": "database.mysql",
"showMetaData": true,
"metaDataFontSize": 0.5,
"metaDataRotation": 0,
"showMetaDataKeys": true,
"metaDataTextAlign": "center"
}
}
}
curl --header "Authorization: Bearer YOUR_API_KEY" https://arcentry.com/api/v1/doc/a9b5a951-1ff6-4ea8-a28d-ec5956187354/obj/where/%5B%22dockerImg%22,%22eq%22,%22mysql-small%22%5D
Create a new object
Request Parameters
-
The type of the object, can be 'component', 'line-group', 'label', 'icon', 'area', 'widget' or 'image'
-
The properties to create the object with. Different types support different properties, please find a detailed list here. Any property that isn't specified will be replaced by its default value. Please note: for components (type == 'component') you must specify componentId as a property.
POST
https://arcentry.com/api/v1/doc/docId/obj/
{
"type": "label",
"props":{
"text":"Hello World!",
"position":{
"x":-10,
"y":20
}
}
}
{
success: true,
objId: "1cml7v3dp-13nr9eg006"
}
curl \
-d '{"type":"label", "props":{"text":"Hello World","position":{"x":-10,"y":20}}}' \
-H "Authorization: Bearer 9ce7f16d4a6647f3d74491560ec64ff87a6faa015c4178a7c5739dca900aa4bf" \
-H "Content-Type: application/json" \
-X POST \
https://arcentry.com/api/v1/doc/d341ef2f-9f9f-4ad8-900b-7c1715d3324a/obj/1chsmqmgt-q6lfvkevo/obj
Update an existing object
Updates the properties of an existing object. You can set as few or as many properties as you like - any JSON will be merged into the object's current data structure. Please note that the merge is non-recursive, so nested properties, e.g. "position":{"x":2,"y":3} need to contain all fields.
Request Parameters
-
One or more properties to merge into the existing object data. Different object types support different properties, please find a detailed list here.
POST
https://arcentry.com/api/v1/doc/docId/obj/objId
{
"props":{
"color": "#F0000F",
"position":{
"x":5,
"y":2
}
}
}
{ success: true }
curl \
-d '{"props":{"color": "#F0000F","position":{"x":5,"y":2}}}' \
-H "Authorization: Bearer 9ce7f16d4a6647f3d744915605434ff87a6577015c4178a7ccf59dca900aa4bf" \
-H "Content-Type: application/json" \
-X POST \
https://arcentry.com/api/v1/doc/980482ba-54d7-427d-8dbf-f23745d233fa/obj/1claqoit6-12ft652qhj
Update multiple objects in bulk
Updates the properties of multiple existing objects. You can set as few or as many properties as you like - any JSON will be merged into the object's current data structure. Please note that the merge is non-recursive, so nested properties, e.g. "position":{"x":2,"y":3} need to contain all fields.
Request Parameters
-
A map of objId to object properties - any data will be merged into existing object properties. Please find more details on object properties here.
POST
https://arcentry.com/api/v1/doc/docId
{
"objects":{
"1cn24l762-mro0uporu":{
"text":"Critical",
"color":"#259E07"
},
"1cn24l762-8qo4f10hg":{
"fillColor":"#FFFFFF"
}
}
}
{ success: true }
-d '{"objects":{"1cn24l762-mro0uporu":{"text":"Enabled","color":"#259E07"},"1cn24l762-8qo4f10hg":{"fillColor":"#FFFFFF"}}}' \
-H "Authorization: Bearer 9ce7f16d4a6647f3d744915605434ff87a6577015c4178a7ccf59dca900aa4bf" \
-H "Content-Type: application/json" \
-X POST \
https://arcentry.com/api/v1/doc/980482ba-54d7-427d-8dbf-f23745d233fa/
Update multiple objects matching a selector
Similar to the id based update object endpoint, but this can update multiple objects at once, based on their Metadata.
Request Parameters
-
A selector that finds objects based on their associated metadata. Please find more here.
-
One or more properties to merge into the existing object data. Different types support different properties, please find a detailed list here.
POST
https://arcentry.com/api/v1/doc/docId/obj/where
{
"selector":["status","eq","running"],
"props":{"backgroundColor": "#00FF00"}
}
{
"success": true,
"updatedObjectCount": 2,
"updatedObjectIds": [
"1cml7vrs0-ef6r4n2uv",
"1cml7v3dp-13nr9eg006"
]
}
curl \
-d '{"selector":["status","eq","running"],"props":{"backgroundColor": "#00FF00"}}' \
-H "Authorization: Bearer 9ce7f16d4a6647f3d744915605434ff87a6577015c4178a7ccf59dca900aa4bf" \
-H "Content-Type: application/json" \
-X POST \
https://arcentry.com/api/v1/doc/980482ba-54d7-427d-8dbf-f23745d233fa/obj/where/
Delete an Object
Deletes an object from its document
POST
https://arcentry.com/api/v1/doc/docId/obj/objId/delete
{"success":true}
curl \
-H "Authorization: Bearer 9ce7f16d4a6647f3d74491560ec64ff87a6faa015c4178a7c5739dca900aa4bf" \
-H "Content-Type: application/json" \
-X POST \
https://arcentry.com/api/v1/doc/980482ba-54d7-427d-8dbf-f23745d233fa/obj/1claqoit6-12ft652qhj/delete