Document toolboxDocument toolbox

Explore Documents and Spots with API (use case)

This article is related to low-level API concepts, which require a basic understanding of REST API requests and JSON.

 


Goal

The goal is to utilize an object ID to retrieve associated data, such as documents directly linked to this object or documents containing a reference to this object.

API calls

Find documents connected directly to this object

When dealing with a Building object that has various linked documents, obtaining a comprehensive list of all the related documents can be achieved through a Perspective call.

This approach is employed due to the fact that Documents are handled similarly to objects (essentially being objects with additional linked content). As a result, there isn't a dedicated "documents function." Instead, we require a perspective that instructs the system on which classes of linked objects it should seek out. 

Perspectives are also capable of utilizing grouping by parent class, which is frequently applicable for Document classes.

 

Getting the data

Get child objects (objects that have an incoming link from our object)

Selected Perspective Set for documents: 10

Object class: 105

Object ID: 76924

ID can be translated to specific domain by using additional API calls.



http://localhost:8080/api/perspective/json/10/105/76924

The result includes all matched objects (filtered by perspective, system versioning, security)

{ "children": [{ "hasChildren": false, "isDefault": false, "metadata": {}, "contentType": 2, "contentId": 45582, "subType": 0, "securityMask": "7", "objectName": "Building facade", "objectId": "210831", "classId": "120" }, { "hasChildren": false, "isDefault": false, "metadata": {}, "contentType": 2, "contentId": 45581, "subType": 0, "securityMask": "7", "objectName": "Building facade", "objectId": "210830", "classId": "111" }], "hasChildren": true, "isDefault": false, "metadata": {}, "contentType": 0, "contentId": 0, "subType": 0, "securityMask": "7", "objectName": "1", "objectId": "76924", "classId": "105" }

Check what is the default document for this object (if any)

http://localhost:8080/api/object/default/105/76924/10

Result - a default object if present in given perspective set. Please note, that each perspective set can have diferent default object!


Check for documents that have spots of this object

 

Repsonse will be as follows, if the content is found:

For today, the function to find a specific document (that has this content attached) is not available.

Using the obtained information

The obtained information can be used to create individual HOPA calls or to build a simplified viewer showing available documents.