Query Services examples

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Bizagi from external applications > Bizagi API > OData RESTful services > Bizagi API examples >

Query Services examples

Overview

Bizagi features OData services that help external applications work with the data held in Bizagi.

This section describes how to use the OData services that let you execute queries. You can only perform these queries on Master entities and their attributes. Unlike the query service provided by the Data Services, these service doesn't require an associated Bizagi query.

 

Query services base URL

To access the Query services, start from this URL:

[your_bizagi_project_url]/odata/query

 

Customizations:

[your_bizagi_project_url]: Corresponds to the URL where end users access the Bizagi Work portal.

For Automation Service projects, such URL would be:

https://[project_environment]-[your_project]-[your_company].bizagi.com/odata/query

 

Resources in Query services

The following table provides a reference for further resources handled by the Query services:

 

Resource

Description

URL example

Entity

Returns a list of all the exposed entities and their xpaths.

[your_bizagi_project_url]/odata/query/entity

executeEntityQuery

Executes a query on a specific entity.

[your_bizagi_project_url]/odata/query/executeEntityQuery

 

Examples

In this section you'll find an example of what you can use in each of this services.

 

Entity

The following image illustrates how you can send an HTTP GET for this resource:

 

ODataQuery001

 

The service returns a list of entities inside the value element, where each have the following information:

@odata.id: The unique URL to access the element.

Id: A string-based GUID representing the URI of the element.

Name: The unique name of the entity, as defined in Bizagi Studio.

IsProcessEntity: Whether the entity is a Process entity or not.

ProcessesRelated: The list of processes associated with this entity.

The available attributes of these processes are:

oId: A string-based GUID of the processes.

odisplayName: The display name of the processes.

Attribs: An array of the available XPaths or entities that can be queried from this entity.

oId: A string-based GUID.

odisplayName: The display name.

oxpaths: A list of XPath names.

 

The following image shows an example of the "attribs" key:

 

ODataQuery002

 

If the entity is a Process entity, you can find some special attributes at the end of the "attribs" key.

 

@ProcessId: Unique ID of the process.

@CaseNumber: Number of the case.

@CreationDate: Creation date of the case.

@EstimatedSolutionDate: Estimated solution date of the case.

@SolutionDate: Actual solution date of the case.

@Closed: Whether the case has been closed or not.

@WorkItems: Information about pending work items.

 

ODataQuery003

 

executeEntityQuery

This POST service executes a Query for a single entity determined through a JSON. This JSON must also contain the list of XPaths to fetch. These XPaths must match the values returned by the Entity service.

The expected elements of the JSON are

QueryParameter: The parameters for the entity query

oEntity: the name of the entity. Do not use the display name.

oProcessId: ID of the process that you want to query through a Process entity.

oXpaths: A list of XPaths that you want to query.

 

This service returns a list of XPath values for each record of the entity along with a total count.

The following image shows an example of the JSON and the answer provided by the endpoint:

 

ODataQuery004

 

Considerations

If you don't provide an XPath, the service only returns the BIzagiID.

For Process entities, if you don't provide a processId, the query uses the first associated process.

For non-Process entities, the service should not use a processId.

You can only access two layer of information using this service.

You can't retrieve collections information using this service.


Last Updated 2/4/2022 3:32:55 PM