- Oracle Global Human Resources Cloud REST APIREST API for Oracle Fusion Cloud HCM
- Learn More
- Manage Resources
- Navigate
Navigate
Retrieve the Total Number of Items
To retrieve the total number of items in a collection, set the totalResults parameter to true. The default value is false. If a query is provided, totalResults indicates the number of items matching the query criteria. Here's an example.
GET /hcmRestApi/resources/11.13.18.05/workers?q=names.FirstName like '%Ki%'&totalResults=true
Response
{
"items": [
{
"PersonId": 30,
"PersonNumber": "30",
"CorrespondenceLanguage": null,
"BloodType": null,
"DateOfBirth": "1959-12-30",
"DateOfDeath": null,
"CountryOfBirth": null,
"RegionOfBirth": null,
"TownOfBirth": null,
"ApplicantNumber": null,
"CreatedBy": "1006",
"CreationDate": "1997-02-18T00:00:00+00:00",
"LastUpdatedBy": "1551",
"LastUpdateDate": "1998-03-17T14:53:51+00:00",
"links": [...]
}
],
"totalResults": 89,
"count": 25,
"hasMore": true,
"limit": 25,
"offset": 0,
"links": [...]
}
Set the Page Size
To set the page size, use the limit parameter. Each call to a collection resource returns a fragment of the collection (a single page). The default size of the page is 25 items. You can change the size by specifying the value of the limit parameter. For example, this request returns four items on a page.
GET /hcmRestApi/resources/11.13.18.05/workers?q=names.FirstName like '%Ki%'&limit=4
Page through a Collection
To page through a collection, use the offset parameter. The default value of this parameter is 0, which retrieves items from the beginning of the collection. To retrieve the next page of the collection, increase the offset by the limit value.
- The hasMore parameter in the response indicates if there is more data to retrieve. Therefore, to retrieve all the items, you must repeat the process until hasMore is false.
- The count parameter in the response indicates the number of items retrieved in the response.
In this example, there are 89 items in the collection and 4 items are retrieved in a single call.
Request
GET /hcmRestApi/resources/11.13.18.05/workers?q=names.FirstName='Kim'&limit=4
Response
{
"items": [
{
"PersonId": 30,
"PersonNumber": "30",
"CorrespondenceLanguage": null,
"BloodType": null,
"DateOfBirth": "1959-12-30",
"DateOfDeath": null,
"CountryOfBirth": null,
"RegionOfBirth": null,
"TownOfBirth": null,
"ApplicantNumber": null,
"CreatedBy": "1006",
"CreationDate": "1997-02-18T00:00:00+00:00",
"LastUpdatedBy": "1551",
"LastUpdateDate": "1998-03-17T14:53:51+00:00",
"links": [...]
}
],
"count": 4,
"hasMore": true,
"limit": 4,
"offset": 0,
"links": [...]
}
Request
GET /hcmRestApi/resources/11.13.18.05/workers?q=names.FirstName like '%Ki%'&limit=4&offset=4
Response
{
{
"items": [
{
"PersonId": 300100032490916,
"PersonNumber": "KiranEmp008PersonNumber",
"CorrespondenceLanguage": null,
"BloodType": null,
"DateOfBirth": "1975-01-01",
"DateOfDeath": null,
"CountryOfBirth": null,
"RegionOfBirth": null,
"TownOfBirth": null,
"ApplicantNumber": null,
"CreatedBy": "FUSION_APPS_HCM_ESS_LOADER_APPID",
"CreationDate": "2013-12-26T20:25:44+00:00",
"LastUpdatedBy": "FUSION_APPS_HCM_ESS_LOADER_APPID",
"LastUpdateDate": "2013-12-26T20:25:47.309+00:00",
"links": [...]
}
],
"count": 4,
"hasMore": true,
"limit": 4,
"offset": 4,
"links": [...]
}
Request
GET /hcmRestApi/resources/11.13.18.05/workers?q=names.FirstName like '%Ki%'&limit=4&offset=88
Response
{
"items": [
{
"PersonId": 100100096445732,
"PersonNumber": "CAN58792059776",
"CorrespondenceLanguage": null,
"BloodType": null,
"DateOfBirth": "1993-12-28",
"DateOfDeath": null,
"CountryOfBirth": null,
"RegionOfBirth": null,
"TownOfBirth": null,
"ApplicantNumber": null,
"CreatedBy": "FUSION_APPS_HCM_ESS_LOADER_APPID",
"CreationDate": "2018-09-29T05:32:34.231+00:00",
"LastUpdatedBy": "FUSION_APPS_HCM_ESS_LOADER_APPID",
"LastUpdateDate": "2018-09-29T05:32:35.200+00:00",
"links": [...]
}
],
"count": 1,
"hasMore": false,
"limit": 4,
"offset": 88,
"links": [...]
}