Group items belong to groups and form part of the user grouping or company hierarchy. Possible group item examples for group 'Countries' might be USA, Ukraine, Brazil etc.
Group items are added to a group and can then be assigned to a user. The group items are then used as part of user access rights and to determine how the user's KPI entries are grouped for analytics and reporting purposes.
The object has the following properties:
Name | Type | Is Read Only | Is Mandatory | Max Length | Notes |
---|---|---|---|---|---|
id | integer | yes | no | Automatically assigned when creating a group item | |
parent_group_id | integer | no | yes | The id of the group the item belongs in | |
name | string | no | yes | 50 | The name of the item |
{ "id": 2, "group_id": 1, "name": "New York" }
<GroupItem xmlns="http://schemas.datacontract.org/2004/07/Waytobi.App.Api.Models" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <id>2</id> <group_id>1</group_id> <name>New York</name> </GroupItem>
GET /api/groups/{group_id}/items
curl https://app.waytobi.com/api/groups/{group_id}/items -v -u {token}
Status: 200 OK [ {
"id": 2, "group_id": 1, "name": "New York" }, { "id": 3, "group_id": 1, "name": "Kiev" } ]
GET /api/groups/{group_id}/items/{id}
curl https://app.waytobi.com/api/groups/{group_id}/items/{id} -v -u {token}
Status: 200 OK { "id": 2, "group_id": 1, "name": "New York" }
POST /api/groups/{group_id}/items
curl https://app.waytobi.com/api/groups/{group_id}/items -H "Content-Type: application/json" -d '{"name": "My Group item"}' -v -u {token} -X POST
Status: 201 Created Location: https://app.waytobi.com/api/groups/{group_id}/items/{id} { "id": 2, "group_id": 1, "name": "My Group item" }
PUT /api/groups/{group_id}/items/{id}
curl https://app.waytobi.com/api/groups/{group_id}/items/{id} -H "Content-Type: application/json" -d '{"name": "My Group Item"}' -v -u {token} -X PUT
Status: 200 OK {
"id": 2,
"group_id": 1,
"name": "My Group item"
}
DELETE /api/groups/{group_id}/items/{id}
curl https://app.waytobi.com/api/groups/{group_id}/items/{id} -v -u {token}
Status: 200 OK
Looking for anything specific article which resides in general queries? Just browse the various relevant folders and categories and then you will find the desired article.
Contact Us