OData Query Options Supported for EcoSys Smart API - EcoSys - Administration & Configuration - Hexagon PPM

EcoSys Smart API

Language
English
Product
EcoSys
Search by Category
Administration & Configuration
EcoSys Version
8.7

OData (Open Data Protocol) defines a protocol for querying and updating of data utilizing existing Web protocols. OData is a REST-based protocol for querying and updating data and is built on standardized technologies such as HTTP, Atom/XML, and JSON.

The OData API Services model is used to control the data that you want to be expose in the OData Metadata, and how the exposed data is grouped for consumption by multiple client applications. The OData API Metadata generation process automatically seeks out and configures relationship definitions and edge definitions based on the user's access and permissions. No further configuration is required.

Odata query

Description

Syntax and examples

$orderby

Using $orderby, data can be ordered based on any column.(Column names can be found in the property tags in the metadata). Data can be ordered either in ascending or descending order.

https:// /<server name>/ /ecosys/smartapi/CostObjects?$orderby=CostObjectID desc

$top

Using $top, you can obtain the top rows from the database.

https://<server name>/ /ecosys/smartapi/CostObjects?$select=CostObjectID,BudgetEndDate&$top=5

In this example, the query fetches the top 5 rows from the database.

$select

Using $select, you can obtain the data of particular columns.

https://<servername> /ecosys/smartapi/CostObjects?$select=CostObjectID,BudgetEndDate

In this example, the query fetches all the rows with specified columns from the database.

$skip

Using $skip, you can skip the number of rows you do not want to see.

https/<servername> /ecosys/smartapi/CostObjects?$select=CostObjectID,BudgetEndDate&$skip=0&$$top=2

$count

The $count system query option allows clients to request a count of the matching resources included with the resources in the response.

https://<server name>/ /ecosys/smartapi/CostObjects?$count=true

$expand

The $expand system query option specifies the related resources to be included in line with retrieved resources. $expand is used to get navigation property data.

https://<server name>/ /ecosys/smartapi/CostObjects?$expand=WorkingForecastTransactions

$filter

Using this query, you can:

  • Directly filter the data using the attribute from cost object API.

  • Filter the data using the attributes from navigation properties

  • Filter the data using complex properties such as custom fields, numbering, and forecasting.

  • https://<server name>/ /ecosys/smartapi/CostObjects?$filter=CostObjectID eq 'SmartAPI CO 1'

In this example, data is directly filtered using the attributes from cost object API.

  • https:// <server name>/ecosys/smartapi/CostObjects?$filter=ParentCostObject/CostObjectID eq 'SMARTAPI CO 2'

In this example, data is filtered using the attributes from navigation properties.

  • https://<server name>/ecosys/smartapi/CostObjects?$filter=CustomFields/APICFText eq 'test 8'

In this example, data is filtered using complex properties such as custom fields, numbering, and forecasting.