Introduction
The Groups API allows you to interact with our groups data
Usage
list
List all Groups that the user has the authority to see within the context of a Business
Parameters
Property | Type | Required | Example |
---|
pageNumber | number | | 1 |
Usage
const groups = await Xedi.Groups.list();
Response
[
{
"_id": "96GE2a3e-boi0-11e9-b308-013533e48b37",
"name": "Team Cap",
"owner": "c52abc50-b499-11ea-a48c-0100f1a50c6e",
"group_type_id": "79fb3a3e-fcc0-11e9-b308-010060e48b37",
"created_at": "2020-07-04 12:00:00",
"updated_at": "2020-07-28 02:21:48"
},
{
"_id": "69PD8a3e-nic0-11e9-b308-010060e48b37",
"name": "Team Iron Man",
"owner": "c52abc50-b499-11ea-a48c-0100f1a50c6e",
"group_type_id": "79fb3a3e-fcc0-11e9-b308-010060e48b37",
"created_at": "2020-07-04 12:00:00",
"updated_at": "2020-08-01 21:32:53"
}
]
Get
Retrieve a Group by ID that the user has the authority to see within the context of a Business
Parameters
Property | Type | Required | Example |
---|
id | Xuid | | '96GE2a3e-boi0-11e9-b308-013533e48b37' |
Usage
const group = await Xedi.Groups.get('96GE2a3e-boi0-11e9-b308-013533e48b37');
Response
{
"_id": "96GE2a3e-boi0-11e9-b308-013533e48b37",
"name": "Team Cap",
"owner": "c52abc50-b499-11ea-a48c-0100f1a50c6e",
"group_type_id": "79fb3a3e-fcc0-11e9-b308-010060e48b37",
"created_at": "2020-07-04 12:00:00",
"updated_at": "2020-07-28 02:21:48"
}
Get by User
Pagination EnabledList all the groups a particular user is associated with.
Parameters
Property | Type | Required | Example |
---|
user_id | UUID | | f3ce14b8-b542-11ea-aded-01002da17977 |
pageNumber | number | | 1 |
Usage
const groups = await Xedi.Groups.getByUser('f3ce14b8-b542-11ea-aded-01002da17977');
Response
{
"current_page": 1,
"data": [
{
"_id": "f3ce14b8-b542-11ea-aded-01002da17977",
"name": "users",
"owner": "d8cde5a8-3eaa-11ea-9ad1-0100f1a50c6e",
"group_type_id": "79fb3a3e-fcc0-11e9-b308-010060e48b37",
"created_at": "2020-07-03 13:58:10",
"updated_at": "2020-07-03 13:58:10"
}
],
"first_page_url": "https://api.xedi.com/1/groups?page=1",
"from": 1,
"last_page": "https://api.xedi.com/1/groups?page=1",
"last_page_url": null,
"next_page_url": null,
"path": "https://api.xedi.com/1/groups",
"per_page": 15,
"prev_page_url": null,
"to": 1,
"total": 1
}