How to Retrieve Assets

There are two endpoints dedicated to retrieving information related to the assets of the current project.

The first endpoint, which can be used with the GET method, is as follows:

get

Return the list of assets. At the moment also info about assets are returned.

Authorizations
AuthorizationstringRequired

The identity provider authentication token.

Query parameters
filterstringOptional

Filtro basato sui campi supportati.

Responses
chevron-right
200

OK

application/json
get
/assets

For example, if you wanted to retrieve all the assets of the project, you could simply invoke the Data Manager in this way:

This would yield a response of the following type:

Within the query, it is possible to indicate a parameter named "filter" in which to specify a string to filter the data that will be returned. For example, you can filter out machines that do not belong to a certain timezone, retrieve data only from a specific machine, or get a list of all machines of a certain type.

Some usage examples are provided below:

This call allows for retrieving only the machine named "40-line-1".

This call enables retrieving all machines that have the timezone "Europe/Rome" and simultaneously the type is "40factory.FACTORY".

circle-info

For the syntax to use in constructing the filters, refer to the page General Rules of the Data Manager.

The second method to obtain information about the assets refers to an endpoint that, taking the ID of a machine of interest, allows returning all the data related to that machine. The endpoint to use with the GET method is as follows:

get

Return the data representing the specified asset.

Authorizations
AuthorizationstringRequired

The identity provider authentication token.

Path parameters
assetIdstringRequired

Asset instance ID.

Responses
chevron-right
200

Success.

application/json
get
/assets/{assetId}

As can be seen, it is necessary to add the ID of the asset being analyzed in the URL. The response will contain only the information of the requested machine.

Last updated