Entity Filtering
Specify entity filters in the form of endpoint query parameters to restrict the contents of endpoint responses to objects that match particular criteria. For example, to ensure the /resource/externallySourced?type=resource
endpoint only returns objects with a status of active, add a status==active
query parameter to the requested endpoint: /resource/externallySourced?type=resource&filters=resourceStatus==active
.
Note: Some API services do not support this functionality. See Service Feature Support for more information on the functionality supported by each API service.
The Oracle Prime Projects API supports several entity filtering options. The following table lists supported entity filter operations:
Name | Operator | Description | URL Encoded Operator | Examples |
Equals | == or = | Excludes response objects that do not contain properties with values matching the value specified in the filter parameter. | %3D%3D or %3D | Only return objects with a resourceId value of 1001: URL encoded form: URL encoded form: |
Does not Equal | != | Only includes response objects that contain properties with values that do not match the value specified in the filter parameter. | !%3D | Only return resources with resourceId values that are not equal to 1001: URL encoded form: |
Less than or Equal to | <= | Include response objects that contain properties with values less than or equal to the value specified in the filter parameter. This filter operation only supports numeric values. |
%3C%3D | Only return resources with defaultUnitsPerHour values less than or equal to 8: URL encoded form: |
Greater than or Equal to | >= | Include response objects that contain properties with values greater than or equal to the value specified in the filter parameter. This filter operation only supports numeric values. |
%3E%3D | Only return resources with defaultUnitsPerHour values greater than or equal to 8: URL encoded form: |
Less than | < | Include response objects that contain properties with values less than the value specified in the filter parameter. This filter operation only supports numeric values. |
%3C | Only return resources with defualtUnitsPerHour values less than 8: URL encoded form: |
Greater than | > | Include response objects that contain properties with values greater than the value specified in the filter parameter. This filter operation only supports numeric values. |
%3E | Only return resources with defaultUnitsPerHour values greater than 8:
URL encoded form: |
Combining Filters
You can combine entity filters using logical operators. For example, the /resource/externallySourced?type=resource&filters=resourceName==John;resourceType=LABOR
endpoint combines resouceName and resouceType value filters using a logical AND (;). The following table lists supported logical operators for combining entity filters.
Name | Operator | Description | Examples |
AND | ; | The logical AND operator restricts response objects to entities that match all specified filter values. | Only return objects with resourceId values of 1001 and calendar values of 12001: URL encoded form: |
OR | , | The logical OR operator restricts response objects to entities that match one or more of the specified filter values. | Only return objects with resourceId values not equal to 1001 or with calendar values equal to 1201. URL encoded form: |
Use parentheses ( ) to combine logical operators and construct complex filters. For example, to match an object with a resource ID of 101 OR 102, AND a calendar ID of 1201, enclose the contents of the OR filter in parentheses, as in the following endpoint: /resource/externallySourced?type=resource&filters=(resourceId==1001,resourceId==1002);calendar==1201.
Filter values enclosed in parentheses are applied first. When combining logical operators, the API will only return response objects that match all of the applied filters.
Wildcards
Use wildcard entity filters to limit response objects based on textual patterns. For example, the /resource/externallySourced?type=resource&filters=resourceName==jacob*
endpoint returns resource objects containing a resourceName value of "jacob" followed by any string. The following table lists supported entity filter wildcards:
Name | Operator | Description | Examples |
Any String | * | The Any String wildcard matches any string value of one or more characters. This filter operation only supports string values. |
Only return objects with resourceName values containing the string "smith" preceded by any number of alphanumeric characters: URL encoded form: |