Searching Nested Objects

  • Available Since API Version – 2.7

Octopus API query syntax also makes it possible to perform searches on sub-properties of compound objects using the same set of comparison operators. For example, if you wanted to search for any Address Book entries whose address is located in a particular city, you could do so with a single Octopus API search query like so:

{
  "Address":{
    "City":{
      "$EQ":"Vancouver"
    }
  }
}

The syntax for comparing complex objects is the same as for a basic comparison operator, but with the operand nested within the hierarchy of object properties, with the property under comparison being the leaf node in the hierarchy:

{
  "Property":{
    "Sub-Property1":{
      "Sub-Property2":{
        Operand
      }
    }
  }
}

Here, "Operand" represents the comparison object, and the property under comparison is "Sub-Property2".

You can nest queries for sub-properties as deeply as you wish; however, not all sub-properties of all entities are queryable. If a given sub-property cannot be queried, the API will return an error code and a message in the response indicating that querying the property is not supported.