GET Requests to expose Items and their Properties - Intergraph Smart Electrical - 2.1 - Help - Intergraph

Intergraph Smart Electrical Smart API Help

Language
English (United States)
Product
Intergraph Smart Electrical
Search by Category
Help
Smart Electrical Web Version
2.1

Motors

The following request runs on motors in a plant. "/Motors" is added to the request after the plant Id, in this case "PLANT001". The payload exposes only common properties.

  • Select the request 03.01 Motors and click Send.

    https://apiservername.domain.com/WebApi/SEL/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/Motors

    The number of items that is retrieved in the payload is limited to 24. A link at the bottom of the payload provides access to the next 24 items, including all their related properties. To view the next 24 items, scroll down to the bottom of the payload to find a link and then copy and paste the link into the URL address bar. The example provided here is based on our tutorial environment:

    https://apiservername.domain.com/WebApi/SEL/V2/Sites%28%27WEBAPISITE001%27%29/Plants%28%27PLANT001%27%29/Motors?%24skip=24

Motors plus count

The following request includes the total count of motors in the payload.

  • Select the request 03.02 Motors + count and click Send.

    https://apiservername.domain.com/WebApi/SEL/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/Motors?$count=true

    Use $count=true when dealing with data. This lets the service know how many items are needed to report and avoids the need for an unnecessary link to the next page. The count appears at the beginning of the payload and is shown highlighted:

    The count shows the total number of items in the entire payload and not just on the current page of the response.

Motors plus count plus selected properties

The following request is built on the previous one, with additional parameters for selected properties.

  • Select the request 03.03 Motors + count + selected properties and click Send.

    https://apiservername.domain.com/WebApi/SEL/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/Motors/Com.Ingr.SEL.V2.WEBAPISITE001.PLANT001.Motor/?$count=true&$select=Id,ItemTag,MotorRatedPower,RatedVoltage,aabbcc_code

    • When selected properties appear in the request, you must include the namespace containing the specific site, plant, and item type:

      /Com.Ingr.SEL.V2.WEBAPISITE001.PLANT001.Motor

      This is necessary because the properties are defined at the level of the plant metadata.

    • Any invalid characters in site or plant names such as space, colon, backslash, are replaced by a double underscore (__) in the namespace.

    • For selection of more than one property, each property parameter is separated by a comma, without spaces.

      For your convenience in this tutorial, the namespace variables {{Namespace Site}} and {{Namespace Plant}} are included in the environment and in the requests.

Motors ordered by item tag in ascending order plus selected properties

The following request adds the method of sorting items by their item tags in ascending order.

  • Select the request 03.04 Motors + order by Item Tag Asc + selected properties and click Send.

    https://apiservername.domain.com/WebApi/SEL/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/Motors/Com.Ingr.SEL.V2.WEBAPISITE001.PLANT001.Motor/?$orderby= ItemTag&$select=Id,ItemTag,MotorRatedPower,RatedVoltage,aabbcc_code

Motors ordered by item tag in descending order plus selected properties

The following request adds the method of sorting items by their item tags in descending order.

  • Select the request 03.05 Motors + order by Item Tag Desc + selected properties and click Send.

    https://apiservername.domain.com/WebApi/SEL/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/Motors/Com.Ingr.SEL.V2.WEBAPISITE001.PLANT001.Motor/?$orderby= ItemTag desc&$select=Id,ItemTag,MotorRatedPower,RatedVoltage,aabbcc_code

In the above requests, we used the entity type ‘Motor’. There are other collections of entity types in the plant. Those collections are exposed in the request 02.02 Common metadata. In the response, search for the string: ‘EntityType Name=Plant’ to reveal a list of all the navigation properties of the plant.

Specific motor

The following request retrieves a specific motor based on its item tag using the $filter function. In the example below, the filter is used to find a motor with an Item Tag value = ‘M-2’.

  • Select the request 03.06 Specific motor and click Send.

    https://apiservername.domain.com/WebApi/SEL/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/Motors?$filter=ItemTag eq 'M-2'

    This filter retrieves the motor with all its properties. For details of other ways in which the $filter function can be used, see GET Requests using Filters (see ).

Specific motor + selected properties

The following request is built on the previous one, with additional parameters for selected properties.

  • Select the 03.07 Specific motor + selected properties request and click Send.

    https://apiservername.domain.com/WebApi/SEL/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/Motors/Com.Ingr.SEL.V2.WEBAPISITE001.PLANT001.Motor/?$filter=ItemTag eq 'M-2'&$select=Id,ItemTag,MotorRatedPower,RatedVoltage,aabbcc_code

Specific motor + expand cable side 2

This request retrieves all the properties of a specified entity (motor) and of the instances of an associated entity type (cables). For this purpose, the $expand function for the entity is used in the request. In this request, you will specify the motor by entering its Id as discovered in the previous request.

  • Select the 03.08 Specific motor + expand cable side 2 request and click Send.

    https://apiservername.domain.com/WebApi/SEL/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/Motors('95A884DDC4714DF0FF30A6ABA5F869F2')?$expand=CableSide2s

    In the payload, search for the string: ‘PLANT001.Cable’. The number of occurrences of this string corresponds to the number of cables attached on side 2 of the specified motor.

Cables + count + selected properties for specific motor

This request uses the same motor Id as the previous request and a similar syntax to the request 03.03 Motors + count + selected properties to count the number of cables and display selected properties of those cables. Unlike the previous request, the $expand function is not used and so the properties of the motor are not shown in the payload.

  • Select the 03.09 Cables + count + selected properties and click Send.

    https://apiservername.domain.com/WebApi/SEL/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/Motors('95A884DDC4714DF0FF30A6ABA5F869F2')/Cables/Com.Ingr.SEL.V2.WEBAPISITE001.PLANT001.Cable/?$count=true&$select=Id,ItemTag,ItemTypeIdentifier,SP_CircuitID,aabbcc_code

    +