Groups
The Groups API allows for managing groups by fetching a list of groups, creating, updating, and deleting group entries.
Data Schema
The Groups API uses the following data structure:
Field | Type | Description |
---|---|---|
id |
integer |
Unique identifier for the group |
name |
string |
Name of the group |
groupId |
integer |
Parent group identifier |
attributes |
object |
Additional attributes stored for group |
Fetch a List of Groups
Retrieves a list of groups based on the user's authorization.
🛠Endpoint:
GET /groups
Authorization:
- Requires either Basic Authentication (
basicAuth
) or Cookie Authentication
Query Parameters:
Parameter | Type | Description |
---|---|---|
all |
boolean |
Can only be used by admins or managers to fetch all entities. |
userId |
integer |
Standard users can use this only with their own userId . |
cURL Requests:
Basic Auth
curl -u username:password -X GET "https://itsochvts.com/api/groups" \
-H "Content-Type: application/json"
Cookie Auth
curl -X GET "https://itsochvts.com/api/groups" \
-H "Content-Type: application/json" \
-H "Cookie: JSESSIONID=your_session_cookie"
200 OK - Response Body
[
{
"id": 0,
"name": "string",
"groupId": 0,
"attributes": {}
}
]
Create a Group
Creates a new group.
🛠Endpoint:
POST /groups
Authorization:
- Requires either Basic Authentication (
basicAuth
) or Cookie Authentication
Request Body:
{
"id": 0,
"name": "string",
"groupId": 0,
"attributes": {}
}
cURL Requests:
Basic Auth
curl -u username:password -X POST "https://itsochvts.com/api/groups" \
-H "Content-Type: application/json" \
-d '{
"id": 0,
"name": "string",
"groupId": 0,
"attributes": {}
}'
Cookie Auth
curl -X POST "https://itsochvts.com/api/groups" \
-H "Content-Type: application/json" \
-H "Cookie: JSESSIONID=your_session_cookie" \
-d '{
"id": 0,
"name": "string",
"groupId": 0,
"attributes": {}
}'
200 OK - Response Body
{
"id": 0,
"name": "string",
"groupId": 0,
"attributes": {}
}
400 No Permission
Update a Group
Updates an existing group.
🛠Endpoint:
PUT /groups/{id}
Authorization:
- Requires either Basic Authentication (
basicAuth
) or Cookie Authentication
Path Parameters:
Parameter | Type | Description |
---|---|---|
id |
integer |
The group ID to update. |
Request Body:
```json
{
"id": 0,
"name": "string",
"groupId": 0,
"attributes": {}
}
```
cURL Requests:
Basic Auth
curl -u username:password -X PUT "https://itsochvts.com/api/groups/{id}" \
-H "Content-Type: application/json" \
-d '{
"id": 0,
"name": "string",
"groupId": 0,
"attributes": {}
}'
Cookie Auth
curl -X PUT "https://itsochvts.com/api/groups/{id}" \
-H "Content-Type: application/json" \
-H "Cookie: JSESSIONID=your_session_cookie" \
-d '{
"id": 0,
"name": "string",
"groupId": 0,
"attributes": {}
}'
200 OK - Response Body
{
"id": 0,
"name": "string",
"groupId": 0,
"attributes": {}
}
Delete a Group
Deletes an existing group.
🛠Endpoint:
DELETE /groups/{id}
Authorization:
- Requires either Basic Authentication (
basicAuth
) or Cookie Authentication
Path Parameters:
Parameter | Type | Description |
---|---|---|
id |
integer |
The group ID to delete. |
cURL Requests:
Basic Auth
curl -u username:password -X DELETE "https://itsochvts.com/api/groups/{id}" \
-H "Content-Type: application/json"
Cookie Auth
curl -X DELETE "https://itsochvts.com/api/groups/{id}" \
-H "Content-Type: application/json" \
-H "Cookie: JSESSIONID=your_session_cookie"