Querying workers API to fetch primary email — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Querying workers API to fetch primary email

Summary:

I have a requirement where I wanted to fetch basic person and assignment details for employees in a single API call. I was trying to leverage the query parameters to query and filter the child collections of the workers, but I see all email addresses were being fetched -primary and non-primary.

https://xx99xx.oraclecloud.com/hcmRestApi/resources/latest/workers?q=PersonNumber=99 and emails.PrimaryFlag=true&fields=PersonNumber,PersonId;names:DisplayName;emails:EmailAddress,PrimaryFlag;nationalIdentifiers:NationalIdentifierNumber,LegislationCode,PrimaryFlag&onlyData=true

I found that this behavior is similar if I want to fetch a specific NID i.e., fetches all instead of one. There was an earlier post in this community that mentioned that we can verify if an attribute is queryable using /describe and I have seen that both NID and Email PrimaryFlag attribute says queryable: true. I am aware that I can do a second call to these child objects and then fetch the primary one using any query parameters or finder attributes. But I am

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!