Description
Once you have set up an integration & authenticated a third party app (learn more here), there are several endpoints that you can call to create, delete and get project data as well as retrieving the blueprint specification that is behind the project. These are explained in more detail below:
Step-by-step explanation
Call the endpoints through the external authenticated app
Endpoint 1: Get project information
By entering the [project ID] as a parameter, this endpoint can be used to obtain the following information:
ID of the project (GUID);
ID of the blueprint that is used (GUID);
The name of the project (string);
The last time it was updated (timestamp).
The project ID can be copied from the URL, it is the GUID placed after ‘projects’ once you have opened a project in levvr as displayed in the example below:
Endpoint 2: Get blueprint specification
By entering the [project ID] as a parameter, this endpoint can be used to obtain the following information::
The blueprint ID (GUID);
The blueprint name (string);
A list of all nodes with per node:
ID (GUID)
The (technical) name (string)
All relations to other (target)nodes, with per relationship:
ID (GUID)
The (technical) name (string)
The reverse name (string)
The target node ID (GUID)
The behavior of the relationship, where:
1 = Select
2 = Create
All fields (properties) defined for this node, which includes:
ID (GUID)
Technical name (string)
Field (property) type, where:
1 = number
2 = text
5 = date
20 = number or picklist (database value)
A list of all modules with per module:
ID (GUID)
The (display) name (string)
The (technical) name (string)
Color (string)
All nodes (list of GUID)
All relations (list of GUID)
All fields (list of GUID)
A list of all queries with per query:
StartNode (node)
ID (GUID)
The (technical) name (string)
All relations
All fields
Endpoint 3: Get query result
By entering the [project ID] and the [query ID] as parameters, this endpoint can be used to get the query resultset in a JSON format. You should also provide a request body (as shown below):
{
“targetNodesId”: list of GUID
}
The query ID can be found in the URL after opening a grid, it is the GUID placed after ‘data’ once you’ve opened a grid in levvr as displayed in the example below:
The ID of a target node can be found in the URL after opening a grid, it is the GUID placed after ‘d’ and before ‘details’. Once you’ve opened a grid in levvr and selected the details of a node it will be shown like in the example below:
Endpoint 4: Create node & fields
By entering the [project ID] and the [query ID] as parameters and the [body] (as shown below), this endpoint can be used to create a datanode:
{
"properties": {
"propName1": "value1",
"propName2": "value2",
"propName3": "value3"
}
}
If you don’t want to specify all the property names and values you can just leave it empty (like {}) and the node will be created containing all properties with default values.
Endpoint 5: Create a create relationship & targetnode
By entering the [project ID], [query ID] and [target node ID] as parameters and the [body] (as shown below), this endpoint can be used to create a create relationship & target node:
{
"rootDataNodeId": GUID,
"parentDataNodeId": GUID,
"nodes": list of string
}
Endpoint 6: Create a select relationship between 2 nodes
By entering the [project ID], [query ID] and [data node ID] as parameters and the [body] (as shown below), this endpoint can be used to create a create relationship & target node:
{
"rootDataNodeId": GUID,
"parentDataNodeId": GUID,
"nodes": list of GUID
}
Endpoint 7: Create child node & decomposable relationship
By entering the [project ID], [query ID] and [target node ID] as parameters and the [body] (as shown below), this endpoint can be used to create a child node & decomposable relationship:
{
"resultSetId": string,
"rootDataNodeId": GUID,
"parentDataNodeId": GUID,
"propertyData": {
"propName1": "value1",
"propName2": "value2",
"propName3": "value3"
}
}
If you don’t want to specify all the property names and values you can just leave it empty (like {}) and the node will be created containing all properties with default values.
Endpoint 8: Delete node
By entering the [project ID], the [template node ID] & the [data node ID] as parameters, this endpoint can be used to delete a node on the project.
Template node ID & project node ID can be requested through the get blueprint specification & get query result endpoints.
Endpoint 9: Delete relationship
By entering the [project ID], the [node ID] & the [edge ID] as parameters, this endpoint can be used to delete a relationship on the project.
{
"startNodeTemplateNodeId": GUID,
"edgeTemplateRelationId": GUID,
"targetNodeId": GUID,
"targetNodeTemplateNodeId": GUID
}
Node & edge ID’s can be requested through the get blueprint specification & get query result endpoints.
Visit the levvr project API Swagger page and learn more about the various operations on offer.