Appearance
Groups
Manage account hierarchy using groups.
Get List of Groups
Lists groups available in the account, based on the group permissions of the user. Groups are a way to provide hierarchical structure to account vehicles and restrict user permissions.
GET
http
https://api.zubiecar.com/api/v2/zinc/groupsQuery Parameters
| Property | Type | Description |
|---|---|---|
| group_keys | array of strings | Optional list of group_keys (as repeated parameters) to further filter results, only includes those groups and below. Multiple tag values may be provided e.g. ?group_keys=foo&group_keys=bar |
| show_inactive | boolean | Optional boolean, defaults false. Whether to include deactivated groups in hierarchy response. |
Sample response 200
json
{
"groups": [
{
"active": true,
"children": [
{
"active": true,
"key": "SampleKey",
"created": "2018-02-20T00:00:00",
"updated": "2018-02-20T00:00:00",
"children": [
"..."
],
"member_counts": {
"car": 8,
"user": 10
},
"name": "Midwest Sub Region",
"tree_depth": 2
}
],
"created": "2018-02-20 12:00:00",
"key": "SampleKey",
"member_counts": {
"car": 8,
"user": 10
},
"name": "Midwest Region",
"tree_depth": 1,
"updated": "2018-02-20 12:00:00"
}
]
}Create Group
Create a new group.
POST
http
https://api.zubiecar.com/api/v2/zinc/groupsRequest Body Schema
| Property | Type | Description |
|---|---|---|
| name | string required | The group name. |
| parent_group_key | string | The key of the parent group. If omitted, will use the account as parent, for a level 2 node. Parent group must be active. |
Sample request body
json
{
"name": "Midwest Region",
"parent_group_key": "SampleKey"
}Get Group By Key
Retrieve a specific group.
GET
http
https://api.zubiecar.com/api/v2/zinc/group/{group_key}Path Parameters
| Property | Type | Description |
|---|---|---|
| group_key | required | Unique group key. |
Sample response 200
json
{
"active": true,
"children": [
{
"active": true,
"key": "SampleKey",
"created": "2018-02-20T00:00:00",
"updated": "2018-02-20T00:00:00",
"children": [
"..."
],
"member_counts": {
"car": 8,
"user": 10
},
"name": "Midwest Sub Region",
"tree_depth": 2
}
],
"created": "2018-02-20 12:00:00",
"key": "SampleKey",
"member_counts": {
"car": 8,
"user": 10
},
"name": "Midwest Region",
"tree_depth": 1,
"updated": "2018-02-20 12:00:00"
}Update Group
Update a Group name or status.
POST
http
https://api.zubiecar.com/api/v2/zinc/group/{group_key}Path Parameters
| Property | Type | Description |
|---|---|---|
| group_key | required | Unique group key. |
Request Body Schema
| Property | Type | Description |
|---|---|---|
| name | string required | Group name. |
Sample request body
json
{
"name": "Midwest Region"
}Deactivate Group
Deactivate a Group. Must have no members, or child groups.
DELETE
http
https://api.zubiecar.com/api/v2/zinc/group/{group_key}Path Parameters
| Property | Type | Description |
|---|---|---|
| group_key | required | Unique group key. |
Apply Group POST
Modify group memberships. Adds or removes group set from a list of member entities. Note that users are not allowed to edit their own group memberships. It is an error if group removal would escalate a member higher in the hierarchy than the caller (e.g. an user with groups assigned tries to remove all groups from a car).
http
https://api.zubiecar.com/api/v2/zinc/groups/applyQuery Parameters
| Property | Type | Description |
|---|---|---|
| action | required | Default: add The action to apply. One of add, remove or replace |
Request Body Schema
| Property | Type | Description |
|---|---|---|
| member_keys | Array of strings required | A list of entity keys to act on. Must be of a groupable resource (Car and User). Up to 20 member keys may be provided per call. |
| group_keys | Array of strings required | A list of group keys to act with. Groups must be all be accessible the user, unique, and no groups may be a descendant of another group. |
Sample request body
json
{
"member_keys": [
"SampleKey1",
"SampleKey2"
],
"group_keys": [
"SampleKey1",
"SampleKey2"
]
}
