Projection Support
You can filter the JSON data returned by the Oracle Prime Projects API. Some JSON responses are large and contain data that you may want to filter out of the response. For example, you may want to request only the project IDs of projects assigned a particular code value. Rather than sift through the large amount of project data returned by the
endpoint, you can use the select query parameter to ensure the JSON response only contains the IDs of the requested projects. project/codeType/{typeId}/codeValue/{code}
Examples
Projections can be performed by adding 'select' query parameters. Use comma-separated values for a multi-select query.
Without using Projections
The following URL:
https://localhost:7001/primeapi/restapi/project/resource/externallySourced/2001
might return JSON output similar to the following:
[ { "isUser": false, "workspaceCode": "Example Workspace", "resourceRoleAssignments": [], "resourceWorkRates": [], "workspaceId": 30002, "sourceId": "1", "workspaceName": "Example Workspace", "resourceName": "Andy Hallman", "resourceType": "LABOR", "resourceClass": "RESOURCE", "resourceId": 18002, "codeValuesResource": [], "calendarName": "Standard 5 Day Workweek", "resourceCode": "HallmanA", "resourceTitleName": "Design Engineer", "resourceStatus": "INACTIVE", "defaultUnitsPerHour": 1, "defaultSyncUnitsFromCost": false, "calendar": 1, "updateDate": "2018-01-25T17:06:37" }, { "isUser": false, "workspaceCode": "Example Workspace", "resourceRoleAssignments": [], "resourceWorkRates": [], "workspaceId": 30002, "sourceId": "2", "workspaceName": "Example Workspace", "resourceName": "Paul Wittgenstein", "resourceType": "LABOR", "resourceClass": "RESOURCE", "resourceId": 18003, "codeValuesResource": [], "calendarName": "Standard 5 Day Workweek", "resourceCode": "WittgensteinP", "resourceTitleName": "Accounts Manager", "resourceStatus": "ACTIVE", "defaultUnitsPerHour": 1, "defaultSyncUnitsFromCost": false, "calendar": 1, "updateDate": "2018-01-25T17:06:37" } ]
Projections using a Single Parameter in the Query
The following URL:
https://localhost:7001/primeapi/restapi/project/resource/externallySourced?select=resourceName
might return JSON output similar to the following:
[
{
"resourceName": "Andy Hallman"
},
{
"resourceName": "Paul Wittgenstein"
}
]
Projections using Multiple Parameters in the Query
The following URL:
https://localhost:7001/primeapi/restapi/project/resource/externallySourced?select=resourceName,resourceId
might return JSON output similar to the following:
[
{
"resourceName": "Andy Hallman",
"resourceId": 18002
},
{
"resourceName": "Paul Wittgenstein",
"resourceId": 18003
}
]
Projections using Nested Fields
Some properties of Prime Projects JSON responses contain nested fields. You can target these nested fields with the select parameter using dot notation. For example, to select the costFlexMap nested field stored as a value of a project actual projectActualConfiguredFields object you can pass the select query
You can specify multiple nested fields in your query parameters. select=projectActualConfiguredFields.costFlexMap.
The following URL:
https://localhost:7001/primeapi/restapi/project/projectActuals/exeternallySourced?select=projectActualConfiguredFields.costFlexMap
might return JSON output similar to the following:
[ "projectActualConfiguredFields": { "costFlexMap": { ...cost flex map fields } } ]