staff.employees

SUPPORTED METHODS:

GET

Parameters

Type

Description

token (required)

Valid token

schedule (accepted)

integer

Position ID
Parameter for filtering purpose. If set, only employees assigned on that position will be fetched.

location (accepted)

integer

Location 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 1

Retrieves custom fields
0: Do not retrieve employee custom fields

check_permission (accepted)

min length 1

Check 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 1

Retrieves staff user can see on schedule if staff gallery is off (min length 1)

updated_at

datetime

Filters out only employees created/updated after datetime

CREATE

Params

  • token (Required): valid token

UPDATE

Parameters

Type

Description

token (required)

valid token

ids (required)

varchar

employee id's

group_id

integer

Sets permission level (manager, supervisor, employee)

language

varchar

Language

timezone_id

integer

Timezone

work_start_date

date

Work start

employee_type

integer

sets employee type (full time, part time, seasonal... )

wage

integer

sets wage

pay_type

integer

sets pay type (hourly, salary, commission...)

gender

enum(M,F)

Gender

add_position

varchar

Adds position

remove_position

varchar

removes position

add_skill

varchar

adds skill

remove_skill

varchar

removes skill

leave_types

varchar

assigns 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"
}