staff.employees

SUPPORTED METHODS:

GET

ParametersTypeDescription
token (required)Valid token
schedule (accepted)integerPosition ID
Parameter for filtering purpose. If set, only employees assigned on that position will be fetched.
location (accepted)integerLocation ID
disabled (accepted)enum (0, 1)0: do not show disabled employees
1: show disabled employees
inactive (accepted)enum (0,1)0: show inactive employees
1: Show inactive employees
with_custom_fields (accepted)min length 1Retrieves custom fields
0: Do not retrieve employee custom fields
check_permission (accepted)min length 1Check permissions
with_settings (accepted)enum (0,1)0: do not show employee settings
1: show employee settings
include_deleted (accepted)enum (0,1)0: do not include deleted employees
1: include deleted employees
scheduler_users (accepted)min length 1Retrieves staff user can see on schedule if staff gallery is off (min length 1)
updated_atdatetimeFilters out only employees created/updated after datetime

CREATE

Params

  • token (Required): valid token

UPDATE

ParametersTypeDescription
token (required)valid token
ids (required)varcharemployee id's
group_idintegerSets permission level (manager, supervisor, employee)
languagevarcharLanguage
timezone_idintegerTimezone
work_start_datedateWork start
employee_typeintegersets employee type (full time, part time, seasonal... )
wageintegersets wage
pay_typeintegersets pay type (hourly, salary, commission...)
genderenum(M,F)Gender
add_positionvarcharAdds position
remove_positionvarcharremoves position
add_skillvarcharadds skill
remove_skillvarcharremoves skill
leave_typesvarcharassigns specific leave type

DOCUMENTATION

GET
Returns array of all employees (activated, not activated). If you have specified schedule or location, it will return array of all employees related to specified schedule or location. Disabled employees can be retrieved with parameter "disabled":1, Not activated employees can be retrieved with "inactive":1
Level 5 is required

--

Example Request:

{
   "module":"staff.employees",
   "method":"GET",
   "request":{
       "schedule":"192278"
   }
}

Example Response:

{
 "status":1,
 "data": [{
        "p_email": "1",
        "custom": {
            "2183": {
                "toggle": "0",
                "access": "1",
                "values": "",
                "name": "wage",
                "type": "1",
                "value": "",
                "text": "",
                "id": "2183"
            },
            "2182": {
                "toggle": "0",
                "access": "1",
                "values": "",
                "name": "email",
                "type": "1",
                "value": "",
                "text": "",
                "id": "2182"
            },
            "2181": {
                "toggle": "0",
                "access": "1",
                "values": "",
                "name": "id",
                "type": "1",
                "value": "e-id",
                "text": "",
                "id": "2181"
            },
            "2180": {
                "toggle": "0",
                "access": "1",
                "values": "",
                "name": "checkbox",
                "type": "4",
                "value": "",
                "text": "",
                "id": "2180"
            },
            "2179": {
                "toggle": "0",
                "access": "1",
                "values": "S,M,L,XL",
                "name": "T-shirt size",
                "type": "3",
                "value": "L",
                "text": "",
                "id": "2179"
            },
            "2184": {
                "toggle": "0",
                "access": "1",
                "values": "",
                "name": "Cs1",
                "type": "1",
                "value": "",
                "text": "",
                "id": "2184"
            }
        },
        "location": "48371",
        "birth_day": "0",
        "ical": "http://www.humanity.com/ical/7e892ad79509f8931ea9ba6bc06.ics",
        "nick_name": "",
        "group_name": "Employee",
        "schedules": {"192278": "Exapmle Position"},
        "address": "",
        "username": "testsp.com",
        "state": "",
        "home_phone": "",
        "status_name": "Activated",
        "wage": "",
        "group": "5",
        "cell_phone": "",
        "avatar_url": null,
        "eid": "",
        "notes": "",
        "id": "277429",
        "p_phone": "1",
        "email": "[email protected]",
        "timezone": "152",
        "language": "",
        "status": "1",
        "city": "",
        "work_start_date": "2013-10-08 10:41:00",
        "timezone_name": "America/New_York",
        "last_active": "0",
        "zip": "",
        "avatar": {
            "medium": "http://cdn.humanity.com/app/layout/0/images/no_avatar.png",
            "large": "http://cdn.humanity.com/app/layout/0/images/no_avatar.png",
            "small": "http://cdn.humanity.com/app/layout/0/images/no_avatar.png"
        },
        "registered": "1381221699",
        "birth_month": "0",
        "name": "Example Employee"
    }],
   "token":"xxxxxxx"
}

UPDATE

Example request

{
   "token":"xxxxxxxxxxxx",
   "module":"staff.employees",
   "method":"UPDATE",
   "ids":"3881938,3842516",
   "gender":"M",
   "employee_type":"4",
   "add_position":"Guitar"
}

Example response

{
    "status": 1,
    "data": {
        "message": "Employees were updated!"
    },
    "token": "xxxxxxxxxxxx"
}