Using REST Api with Cloud installations

First, you should enable REST API via Settings -> Other -> Enable REST API setting.

IceHrm uses OAuth 2.0 bearer authentication. So you have to send the bearer token with every request. Each Icehrm user can find their auth token by opening Basic Information -> Personal Information -> Api Access (tab).

Making the First Api call – Cloud #

If your Icehrm instance name is test1 (https://test1.icehrm.com), your API URL will be

Then according to https://icehrm.docs.apiary.io/# you can view your own data by sending a GET request to

You can use the following request by changing API URL and auth token.

curl -i https://icehrm.com/api/test1/employees/me \
  -H "Authorization: Bearer RRRRRRRR6fdeb20bb04b2c23DDDDD"

For creating an employee you can use

curl -X POST -H "Authorization: Bearer 9RRRRRRRR6fdeb20bb04b2c23DDDDD" -H "Content-Type: application/json" -d '{
  "employee_id": "D101",
  "first_name": "IceHrm 123",
  "middle_name": "Sample Ex1",
  "last_name": "Employee",
  "nationality": "35",
  "birthday": "1984-03-17",
  "gender": "Male",
  "marital_status": "Married",
  "ssn_num": "",
  "nic_num": "294-38-3535",
  "other_id": "294-38-3535",
  "driving_license": "",
  "employment_status": "3",
  "job_title": "11",
  "pay_grade": "2",
  "work_station_id": "",
  "address1": "2772 Flynn Street",
  "address2": "Willoughby",
  "city": "Willoughby",
  "country": "US",
  "province": "41",
  "postal_code": "44094",
  "home_phone": "440-953-4578",
  "mobile_phone": "440-953-4578",
  "work_phone": "440-953-4578",
  "work_email": "[email protected]",
  "private_email": "[email protected]",
  "joined_date": "2005-08-03",
  "confirmation_date": "0000-00-00",
  "supervisor": "1",
  "indirect_supervisors": "[\"3\",\"4\"]",
  "department": "1",
  "termination_date": "0000-00-00",
  "status": "Active",
  "approver1": "5",
  "approver2": "6",
  "approver3": "7"
}' "https://icehrm.com/api/test1/employees"

Powered by BetterDocs