API v2: Examples

This article provides examples of retrieving data using the Cezanne HR API.

API Query Examples

1. Return All People

To return all people including leavers and new hires who have not joined the following request can be made:

https://API-URL/CezanneOnDemand/v2/Dataservice.svc/People 

2. Return Active Employees

Return all active employees:

https://API-URL/CezanneOnDemand/v2/dataservice.svc/People?$filter=ActiveEmployee%20eq%201 

3. Return Top 20 People

Return the top 20 people via the API:

https://API-URL/CezanneOnDemand/v2/Dataservice.svc/People?$top=20 

4. Return Selected Fields

Return all people who have "ab" in their surname, order by surname and only return the surname and first name of the employees:

https://API-URL/CezanneOnDemand/v2/DataService.svc/People()?$filter=substringof('ab',tolower(FamilyName))&$orderby=FamilyName&$select=FamilyName,FirstName 

5. Return Selected Person by Key

Return the person with a Person Code of CEZ01 using the key. Two examples are provided, one returning XML and the other in JSON format.

https://API-URL/CezanneOnDemand/v2/DataService.svc/People('CEZ01') 
https://API-URL/CezanneOnDemand/v2/DataService.svc/People('CEZ01')?$format=json 

6. Return the Current Primary Employment

Return the current primary employment information for a person with a code of CEZ01:

https://API-URL/CezanneOnDemand/v2/DataService.svc/People('CEZ01')/PeopleToEmploymentCurrentPrimary