Skip to main content

Group API

Warning

This is a legacy API. It is still functional but is not in active development/ maintenance anymore.

These API endpoints allows the admin to manage their groups programmatically.

How to use these API endpoints​

Obtain API Key​

Before using the API, please obtain the API key by following the Getting Started guide.

Send API requests to Holistics​

To use these APIs, simply append Holistics' host URL secure.holistics.io with your chosen endpoint.

For example, to call the API Get all users in a tenant with full information, you will have to use GET request with this URL: secure.holistics.io/user.json.

Get all groups in a tenant​

Sample request:

GET /groups.json

Sample response:

[
{
"id": 1,
"name": "Singapore",
"num_user": 2
},
{
"id": 2,
"name": "Vietnam",
"num_user": 2
},
{
"id": 3,
"name": "Indonesia",
"num_user": 0
}
]

Create a new group​

Sample request:

POST /groups.json

Sample body request:

{
"group":{
"name" : "Test"
}
}

Sample success response:

{
"id": 1,
"name": "Test",
"created_at": "2018-09-07T09:18:43.742Z",
"updated_at": "2018-09-07T09:18:43.742Z",
"tenant_id": 5
}

Update information of an existing group​

Sample request:

PUT /groups/group_id.json

Permitted params:

  • name: The name of your group

Sample body request:

{
"group":{
"name" : "New Admin Group"
}
}

Delete an existing group​

Sample request:

DELETE /groups/group_id.json

Add a user into a group​

Sample request:

PUT /groups/group_id/user/user_id

Sample success response:

{
"status": "OK"
}

Remove a user from a group​

Sample request:

DELETE /groups/34/user/454

Sample success response:

{
"status": "OK"
}

Open Markdown
Let us know what you think about this document :)