Developer guide to get employee data from PeopleHR API

Introduction

The PeopleHR API offers a powerful way to access and manage employee data within your HR system. Whether you’re building custom HR dashboards, syncing employee information with other apps, or automating internal workflows, understanding how to interact with the API effectively is key.

This article is part of our HRIS API series, where we explore key use cases, best practices, and technical deep dives from authentication and rate limits to real-world integrations.

Getting Employee Data from PeopleHR API

Prerequisites

Before you begin, make sure you have:

  • A valid API key from your PeopleHR system administrator.
  • Access to the PeopleHR Developer Workbench for testing API requests.
  • A working Python environment with the requests and json libraries installed.

API Endpoints

  • Get All Employee Details: https://api.peoplehr.net/Employee
  • Get Individual Employee Details: https://api.peoplehr.net/Employee

Step-by-Step Implementation

1. Get All Employee Details

import requests, json

url = 'https://api.peoplehr.net/Employee'
payload = json.dumps({
    'APIKey': 'your_api_key',
    'Action': 'GetAllEmployeeDetail',
    'IncludeLeavers': 'false'
})
headers = {'Content-Type': 'application/json'}

response = requests.post(url, data=payload, headers=headers)
print(response.json())

This call retrieves all active employee records. Set IncludeLeavers to "true" if you want to include terminated employees as well.

2. Get Individual Employee Details

import requests, json

url = 'https://api.peoplehr.net/Employee'
payload = json.dumps({
    'APIKey': 'your_api_key',
    'Action': 'GetEmployeeDetail',
    'EmployeeId': 'specific_employee_id'
})
headers = {'Content-Type': 'application/json'}

response = requests.post(url, data=payload, headers=headers)
print(response.json())

Use this endpoint when you want to fetch detailed information about a single employee using their unique Employee ID.

Common Pitfalls to Avoid

  1. Invalid API Key: Double-check your key and ensure proper permissions are granted.
  2. Rate Limit Exceeded: The PeopleHR API allows 30 requests per minute per IP. Use throttling or queuing if needed.
  3. Missing Fields: Ensure all required parameters are included in your request body.
  4. Improper JSON Formatting: Always validate your JSON payload before sending.
  5. Unsecured API Keys: Never hardcode your API key in public repositories.
  6. Ignoring Error Codes: Properly handle HTTP 400/401/429/500 responses to improve reliability.
  7. Forgetting Leavers: Set IncludeLeavers as true if your use case involves ex-employees.

Frequently Asked Questions

1. How can I get an API key for PeopleHR?
Contact your PeopleHR system administrator to generate an API key for your application.

2. What is the API rate limit?
The limit is 30 API calls per minute per IP address.

3. Can I test the API before production?
Yes, PeopleHR provides a developer workbench and supports sandbox testing environments.

4. What data format does the API use?
The API uses JSON for both requests and responses.

5. How do I include leavers in the results?
Set "IncludeLeavers": "true" in your API payload.

6. What happens if I exceed the rate limit?
You’ll receive an exception message, and further requests may be temporarily blocked.

7. Is my API key secure?
Yes, as long as you store it securely and do not share or expose it in public codebases.

Why Use Knit for PeopleHR Integration

Integrating directly with PeopleHR can require ongoing maintenance, error handling, and authentication management. Knit simplifies this by offering a unified, secure integration platform that connects with PeopleHR (and dozens of other HRIS systems) via a single API.

By integrating with Knit once, you can:

  • Automate authentication and authorization
  • Simplify data mapping and syncing
  • Eliminate ongoing maintenance overhead

This approach ensures faster deployment, consistent uptime, and smoother workflows for your HR and IT teams.

#1 in Ease of Integrations

Trusted by businesses to streamline and simplify integrations seamlessly with GetKnit.