Skip To Content

Query

Description

The query operation allows you to query the associations table and return association information for network features in a utility network.

Request parameters

ParameterDetails
f

Description: The response format. The default response format is html.

Values: html | json

gdbVersion

Description: Optional parameter specifying the name of the geodatabase version. The default is Default.

Syntax: gdbVersion=<version>

moment

Description: Optional parameter specifying the session moment. The default is the version's current moment. This should only be specified when you do not want to use the current moment.

Syntax: moment=<Epoch time in milliseconds>

types

Description: Optional parameter that specifies an array of association types to be queried; this is provided as an array of strings. The default is all association types.

Values: "attachment" | "containment" | "junctionJunctionConnectivity" |"junctionEdgeFromConnectivity" | "junctionMidspanConnectivity" | "junctionEdgeToConnectivity"

Example: types=["attachment", "containment"]

elements

Description: The feature or object elements for which the association is queried.

Syntax:

[ 
  {
    “networkSourceId” : <long>,
    “globalId” : <guid>,
    “terminalId” : <long>   // optional
  }
]

returnDeletes

Description: Optional Boolean parameter specifying whether to return logically deleted associations. The default is false.

Values: true | false

JSON Response syntax


{
  “associations” : [
    {
      “globalId” : <guid>,
      “fromNetworkSourceId” : <long>,
      “fromGlobalId” : <guid>,
      “fromTerminalId” : <long>,
      “toNetworkSourceId” : <long>,
      “toGlobalId” : <guid>,
      “toTerminalId”: <long>,
      “percentAlong”: <double>,
      “associationType” : “attachment” | “containment” | “junctionJunctionConnectivity” |“junctionEdgeFromConnectivity” |“junctionMidspanConnectivity” | “junctionEdgeToConnectivity”,
      “status” : <long>,
      “errorCode” : <long>,
      “errorMessage” : <string>,
      “isContentVisible” : <boolean>
    }
  ],
  “success” : <boolean>,
  “error” : {                   // only if success is false
    “extendedCode” : <HRESULT>,
    “message” : <string>,
    “details” : [ <string> ]
}
}

Example usage

Request URL and parameters:

https://myserver.esri.com/server/rest/services/LandUse/UtilityNetworkServer/associations/query


types=["containment"]
elements=[{"networkSourceId":19,"globalId":"{AE323515-8E6F-4CC2-B9A8-1DB963E769AB}"}]
{
   "associations":[
      {
         "globalId":"{ABD4CB00-2D54-4DAD-B70D-F8A2EDBB7302}",
         "fromNetworkSourceId":19,
         "fromGlobalId":"{AE323515-8E6F-4CC2-B9A8-1DB963E769AB}",
         "fromTerminalId":-1,
         "toNetworkSourceId":21,
         "toGlobalId":"{24FAB600-E235-4A63-A4EC-037A9493D7F2}",
         "toTerminalId":-1,
         "associationType":"containment",
         "status":0,
         "errorCode":0,
         "errorMessage":"",
         "isContentVisible":true
      },
      {
         "globalId":"{00E51A4E-9AD3-45B4-86DF-DAFF0E8CCB96}",
         "fromNetworkSourceId":4,
         "fromGlobalId":"{B7E78E04-0E67-4287-88AE-08A4D135FA67}",
         "fromTerminalId":-1,
         "toNetworkSourceId":19,
         "toGlobalId":"{AE323515-8E6F-4CC2-B9A8-1DB963E769AB}",
         "toTerminalId":-1,
         "associationType":"containment",
         "status":0,
         "errorCode":0,
         "errorMessage":"",
         "isContentVisible":true
      }
   ],
   "success":true
}