$expand Method Requests - Intergraph Smart Instrumentation - Version 2.3.1 - Training - Intergraph

Intergraph Smart Instrumentation Smart API Tutorial

Language
English (United States)
Product
Intergraph Smart Instrumentation
Search by Category
Training
Smart Instrumentation Web Version
2.3.1

The following set of queries uses the $expand query option to expose the source entity as well as the target item. When using $expand, always provide the Id of the source item (do not use the $expand method without stating which item Id to expand).

GET request $expand - (Instrument -> Loop)

This request navigates from the Instrument (Id '4196') to its Loop, with a subset of three of the instrument properties: Id, InstrumentName, and PIDDrawing. The payload also includes all the properties of the loop.

  • Select the 06.01 $expand - (Instrument -> Loop) request and click Send.

    {{baseUri}}api/si/{{versionNumber}}/Sites('{{SiteId}}')/PlantGroups('{{PlantGroupId}}')/Projects('0')/InstrumentProject('4196')?$select=Id,InstrumentName,PIDDrawing&$expand=InstrumentLoop

GET request $expand - (Loop -> Instrument) + expanded properties

This request expands the loop to display its instruments with a subset of both loop and instrument properties.

  • Select the 06.02 $expand - (Loop -> Instrument) + expanded properties request and click Send.

    {{baseUri}}api/si/{{versionNumber}}/Sites('{{SiteId}}')/PlantGroups('{{PlantGroupId}}')/Projects('0')/LoopProject('4195')?$select=Id,LoopName,LoopService&$expand=InstrumentLoop($select=Id,InstrumentName,InstrumentType)

GET request $expand - (Loop -> Instrument) + expanded properties & count

This request is similar to the previous one, with the addition of the '$count' option, to reveal the number of Instruments associated with this Loop.

  • Select the 06.03 $expand - (Loop -> Instrument) + expanded properties & count request and click Send.

    {{baseUri}}api/si/{{versionNumber}}/Sites('{{SiteId}}')/PlantGroups('{{PlantGroupId}}')/Projects('0')/LoopProject('4195')?$select=Id,LoopName,LoopService&$expand=InstrumentLoop($select=Id,InstrumentName,InstrumentType;$count=true)

GET request $expand - (Loop -> Instrument), + expanded properties, count, and sort order

This request is similar to the previous one, with the addition of the '$orderby' option, to reveal the number of Instruments connected to this Loop, and to display them in descending order.

  • Select the 06.04 $expand - (Loop -> Instrument) + expanded properties, count & orderby request and click Send.

    {{baseUri}}api/si/{{versionNumber}}/Sites('{{SiteId}}')/PlantGroups('{{PlantGroupId}}')/Projects('0')/LoopProject('4195')?$select=Id,LoopName,LoopService&$expand=InstrumentLoop($select=Id,InstrumentName,InstrumentType;$count=true;$orderby=InstrumentName desc)

GET request $expand (Line > Instrument), plus expanded properties & filter

This request demonstrates the use of $filter query option for an expanded item.

  • Select the 06.05 $expand - (Line > Instrument) + expanded properties & filter request and click Send.

    {{baseUri}}api/si/{{versionNumber}}/Sites('{{SiteId}}')/PlantGroups('{{PlantGroupId}}')/Projects('0')/LineProject('4139')?$select=Id,LineNumberName,PipeSize,LineSizeUnits&$expand=InstrumentLine1st($select=Id,InstrumentName,LoopName,PIDDrawing;$filter=LoopName eq '101-F -100')

GET request $expand Cable to End1Panel & End2Panel

This request expands a cable to the destination panels at both ends.

  • Select the 06.06 $expand Cable to CableEnd1Panel, CableEnd2Panel request and click Send.

    {{baseUri}}api/si/{{versionNumber}}/Sites('{{SiteId}}')/PlantGroups('{{PlantGroupId}}')/Cables('4568')?$select=Id,CableName&$expand=CableEnd1Panel($select=Id,PanelName),CableEnd2Panel($select=Id,PanelName)