API Roles
The get_roles action returns every Role in the account, active and inactive, with each Role's ID (ROID) and the skills staff need for it. Use the ROIDs when you send roster shifts, timesheets and pay lines.
| Action | get_roles |
|---|---|
| Business key access | Account: Read Only |
Before you start, make your keys and test your connection: see Microkeeper API.
Get the Roles
Send status set to all:
| Field | Value |
|---|---|
mk_action | get_roles |
mk_data | {"status":"all"} |
Response
{
"success": "1",
"authenticated": "1",
"message": "Roles data",
"data": {
"roles": [
{
"ROID": "681",
"title": "Bar",
"GID": "0",
"JID": "0",
"active": "1",
"skill_list": [
{ "SMID": "275", "title": "Responsible Service of Alcohol (RSA)" }
]
},
{
"ROID": "682",
"title": "Duty Manager",
"GID": "0",
"JID": "0",
"active": "1",
"skill_list": []
}
]
}
}Roles are listed by title. Each one has:
| Field | What it is |
|---|---|
ROID | The Role's ID in Microkeeper |
title | The Role's name |
GID | The Group the Role is limited to, or 0 for everyone |
JID | The Role's default Job, or 0 for none |
active | "1" active, "0" inactive |
skill_list | The skills the Role needs, each with its skill ID (SMID) and title. Empty if none |
Errors
The status variable must be included: sendstatus.Roles API field status must be set to all:statusmust beall.There are no roles in Microkeeper yet: the account has no Roles.
Add or change Roles
Roles are added and changed in Microkeeper, in Menu > Settings > General > Roles: see Roles. Read them again with get_roles to pick up changes.