The following OData examples use the Web API v3 to query for objects.
Collection
Query to return a collection of objects.
Query |
Description |
Example |
---|---|---|
Query for all Objects |
This example is a query for all SPFFolders |
GET . . /api/v3/ADW/SPFFolders |
Query for objects with a filter on a property |
This query is for SPFFolders with a filter on a property |
GET . . /api/v3/ADW/SPFFolders?$filter=Class eq 'SPFFolder' |
Query for objects showing only the selected properties |
This query is for all SPFFolders showing only the selected properties |
GET . . /api/v3/ADW/SPFFolders?$select=Name,Class,UID |
Query for the first 5 objects which includes a count of the number of objects in the response |
This query is for the first five SPFFolders and include a count of the number of SPFFolders in the response |
GET . . /api/v3/ADW/SPFFolders?$top=5&$count=true |
Query for objects with a filter on related objects |
This query is for SPFFolders with a filter on related objects |
GET . . /api/v3/ADW/DevelopmentTags?$filter=Documents_DEV/any/(doc: doc/Name eq 'Doc001') |
Entity by key
Query for a specific entity using a key.
Query |
Description |
Example |
---|---|---|
Query for an object with a given id in the form of OBID |
This query is for SPFFolders that use the key 6FII000A |
GET . . /api/v3/ADW/SPFFolders('6FII000A') |
Query for an object with an Id in the form of DomainUID~~UID |
The query is for SPFFolders that use a specific SPF Domain UID |
GET . . /api/v3/ADW/SPFFolders('SPF~~3bb6a505-9c81-472c-9edb-49d72e563fdf') |
Relationship expansions
Query for objects using a relationship expansion.
Query |
Description |
Example |
---|---|---|
Query for objects and expand a relationship |
This query is for SPFFolders and expand the relationship to PlantItems |
GET . . /api/v3/ADW/SPFFolders?$expand=PlantItems |
Query for a given object and expand a relationship |
This query is for as specific SPFFolders object and expand the relationship to PlantItems |
GET . . ./api/v3/ADW/SPFFolders('6FHH000A')?$expand=PlantItems |
Query for all the related objects from a given object and relationship |
This query is for all related objects to a specific SPFFolders and expand the relationship to PlantItems |
GET . . /api/v3/ADW/SPFFolders('6FHH000A')/PlantItems |
Query for a given object and expand all related objects |
This query is for a specific SPFFolders object and expand to all related objects |
GET . . /api/v3/ADW/SPFFolders('6FHH000A')?$expand=* |
Object relationships are exposed using a related interface definition. To expose all possibilities of expansion for an object, you have to expose every related interface definition. However, you can just expose the interface definition as an entity type. For example:
<InterfaceDef>
<IObject UID="ISPFDocument" />
<ISPFServicesInterfaceDefExt SPFInterfaceDefExposedSetName="ISPFDocument" SPFInterfaceDefExposedName="ISPFDocument" />
</InterfaceDef>
Property
Query by a unique property.
Query |
Description |
Example |
---|---|---|
Query for the specfic property of a given object |
This query is for the specific property UniqueKey for the specific SPFFolders object |
GET . . /api/v3/ADW/SPFFolders('6FHH000A')/UniqueKey |
Query the specified property of a given object, in plain output |
This query is for the specific property UniqueKey for the specific SPFFolders object and display in plain output |
GET . . /api/v3/ADW/SPFFolders('6FHH000A')/UniqueKey/$value |
Query by a navigation property.
Query |
Description |
Example |
---|---|---|
Query for the specific property of a given object |
This query is for the specific property UniqueKey for the specified SPFFolders object |
GET . . /api/v3/ADW/SPFFolders('6FHH000A')/PlantItems('0039IDA')/UniqueKey |
Query the specified property of a given object, in plain output |
This query is for the specific property UniqueKey for the specified SPFFolders object and display in plain output |
GET . . /api/v3/ADW/SPFFolders('6FHH000A')/PlantItems('0039IDA')/UniqueKey/$value |
In order to expose entity navigation properties (reldefs/edgedefs) in the OData metadata document, the end entity of the relationship (or edge) must also be exposed in the metadata. The end entity can be exposed using either an interface definition or a class definition.
Request Data
Query to request a specific type of data.
Query |
Description |
Example |
---|---|---|
Query for the specific type of data |
This query is for the ISIOObjects |
GET . . /api/v3/SIO/ISIOObjects |