Groups API
POST /groups
Description
This API endpoint retrieves a list of groups based on the provided service group ID.
Request Body
The request utilizes GraphQL to perform the groups
query with the service group ID as a variable.
Query:
query groups ($serviceGroupId: Int!) {
groups (serviceGroupId: $serviceGroupId) {
id
name
description
tagName
duration
price
usernamePostfix
usernamePostfixId
dailyBandwidth
multiLoginCount
downloadUpload
ip
}
}
GraphQL Variables:
{
"serviceGroupId": 0
}
Example Request:
curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query groups ($serviceGroupId: Int!) {\n groups (serviceGroupId: $serviceGroupId) {\n id\n name\n description\n tagName\n duration\n price\n usernamePostfix\n usernamePostfixId\n dailyBandwidth\n multiLoginCount\n downloadUpload\n ip\n }\n}","variables":{"serviceGroupId":0}}'
Response:
-
Success (200 OK):
- The response includes a list of groups associated with the specified service group ID.
{
"data": {
"groups": [
{
"id": 1,
"name": "Basic Plan",
"description": "Standard plan with basic features",
"tagName": "Basic",
"duration": 30,
"price": 29.99,
"usernamePostfix": "BasicUser",
"usernamePostfixId": 101,
"dailyBandwidth": 500,
"multiLoginCount": 2,
"downloadUpload": "Limited",
"ip": "192.168.1.10"
},
{
"id": 2,
"name": "Pro Plan",
"description": "Advanced plan with additional features",
"tagName": "Pro",
"duration": 90,
"price": 99.99,
"usernamePostfix": "ProUser",
"usernamePostfixId": 102,
"dailyBandwidth": 1000,
"multiLoginCount": 3,
"downloadUpload": "Unlimited",
"ip": "192.168.1.20"
}
]
}
} -
Error (4XX/5XX):
- If there is an issue with retrieving the groups, such as an invalid service group ID or server error, the response will include an appropriate error message and status code.
Note:
Ensure the provided serviceGroupId
is valid and corresponds to an existing service group to receive accurate results.