Roles API Retrieve Roles
This guide documents the Roles endpoint:
get_roles export the current list of roles from Microkeeper
Retrieving Roles (get_roles)
The get_roles call returns all roles (active and inactive) that belong to the authenticated business, including their associated skills.
| Variable | Values & example |
|---|
| mk_action | get_roles |
| mk_data | { "status":"all" } |
Response
| Field | Description |
|---|
| roles | Array of role objects (see below) |
| Field | Description | Example |
|---|
| ROID | Microkeeper Role ID | 1234 |
| title | Role name / title | Bar Manager |
| GID | Group ID | 269 |
| JID | Job ID | 5 |
| active | "1" (active) or "0" (inactive) | 1 |
| skill_list | Array of skills associated with this role | [{"SMID":"10","title":"Driver License"},{"SMID":"15","title":"RSA"}] |
skill_list array objects
| Field | Description | Example |
|---|
| SMID | Skill Management ID | 10 |
| title | Skill name / title | Driver License |
Example Response
{
"success": "1",
"authenticated": "1",
"message": "Roles data",
"data": {
"roles": [
{
"ROID": "1234",
"title": "Senior Developer",
"GID": "269",
"JID": "5",
"active": "1",
"skill_list": [
{
"SMID": "10",
"title": "JavaScript"
},
{
"SMID": "15",
"title": "PHP"
},
{
"SMID": "22",
"title": "Database Design"
}
]
},
{
"ROID": "1235",
"title": "Project Manager",
"GID": "270",
"JID": "6",
"active": "1",
"skill_list": [
{
"SMID": "25",
"title": "Project Management"
},
{
"SMID": "30",
"title": "Team Leadership"
}
]
},
{
"ROID": "1236",
"title": "Junior Developer",
"GID": "269",
"JID": "5",
"active": "0",
"skill_list": []
}
]
}
}
Error Responses
| Error | Description | Response |
|---|
| Missing status | The status variable must be included | { "success":"0", "authenticated":"1", "message":"The status variable must be included" } |
| Invalid status | Status must be set to 'all' | { "success":"0", "authenticated":"1", "message":"Roles API field status must be set to all" } |
| No roles found | No roles exist in the account | { "success":"0", "authenticated":"1", "message":"There are no roles in Microkeeper yet" } |
Adding and Updating Roles
This feature is not yet available via the Microkeeper API, reach out to our support staff to discuss your options.