Difference between revisions of "HTTP API/Bot Commands/listgroups extended"
From SmartBots Developers Docs
| Line 10: | Line 10: | ||
{{API HTTP Required Vars|listgroups}} | {{API HTTP Required Vars|listgroups}} | ||
| + | |||
| + | {{API Variable Group|Input}} | ||
| + | {{API Variable|limit_name|no}} list only the groups which name '''contains''' this text | ||
| + | {{API Variable|limit_uuid|no}} list only the groups which UUID '''exactly matches''' this value | ||
{{API Variable Group|Output}} | {{API Variable Group|Output}} | ||
| Line 27: | Line 31: | ||
* permissions - the comma-separated list of bot's permissions | * permissions - the comma-separated list of bot's permissions | ||
| − | == Return | + | == Return value == |
| − | This command returns complex data and available only when requesting JSON output (''dataType=json''). | + | * This command returns complex data and available only when requesting JSON output (''dataType=json''). |
| − | + | * Also note that order of the group details (name, uuid etc) in the object may vary (see the order in example below). | |
| − | Also note that order of the group details (name, uuid etc) in the object may vary (see the order in example below). | + | * The result may be quite long for LSL HTTP query since it is limited to 1024 characters. To limit the result to specific group only, use ''limit_name'' and ''limit_uuid'' parameters. |
== Example == | == Example == | ||
| Line 62: | Line 66: | ||
"fee": "0", | "fee": "0", | ||
"permissions": "JoinChat,AllowVoiceChat,AllowSetHome,Accountable,ReceiveNotices" | "permissions": "JoinChat,AllowVoiceChat,AllowSetHome,Accountable,ReceiveNotices" | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | The example of the ''limit_name=Earn2'' parameter usage: | ||
| + | |||
| + | |||
| + | <syntaxhighlight lang="javascript"> | ||
| + | { | ||
| + | "action": "listgroups_extended", | ||
| + | "result": "OK", | ||
| + | "groups": [ | ||
| + | { | ||
| + | "name": "Earn2Life - earn L$500-1000 a day", | ||
| + | "uuid": "41ff4c6b-e3c0-a2b9-f53b-797e78532374", | ||
| + | "fee": "0", | ||
| + | "open": 0, | ||
| + | "permissions": "Invite,Eject,AssignMemberLimited,RemoveMember,JoinChat,AllowFly,AllowLandmark,AllowVoiceChat,AllowSetHome,LandManageAllowed,LandManageBanned,LandEjectAndFreeze,ModerateChat,SendNotices,ReceiveNotices,StartProposal,VoteOnProposal,MemberVisible" | ||
} | } | ||
] | ] | ||
Revision as of 19:59, 7 March 2018
Returns the bot's groups list, with additional details.
// See "LSL Helper Functions" page for this function
smartbotsAPI("groups_extended", []);
Variables
The following table shows input values (you send them with the API call) and returned output values.
| Variable | Required | Description | ||
|---|---|---|---|---|
| Input basic parameters: | ||||
| action | yes | = listgroups | ||
| apikey | yes | Your personal developer's API key. | ||
| botname | yes | Your bot's SL login. | ||
| secret | yes | Bot access code of your bot. | ||
| dataType | optional | Set to "json" to get JSON reply instead of URL-encoded string | ||
| custom | optional | The custom data (string) to be passed back to caller script. This value will be returned back to the caller in HTTP response. | ||
| Input: | ||||
| limit_name | optional | list only the groups which name contains this text | ||
| limit_uuid | optional | list only the groups which UUID exactly matches this value | ||
| Output: | ||||
| (to be received in http_response LSL event, see docs for details) | ||||
| result | OK - command completed successfully FAIL - command failed | |||
| resulttext | Detailed reason for the failure. | |||
| custom | The value from input "custom" parameter. See above. | |||
| groups | The JSON-array (only JSON!) containing bot's groups (see below) | |||
Details
The API command returns the bot's groups with additional details. Each groups array entry is an object containing:
- name - the name of the group
- uuid - the group UUID
- open - 1 if group is open to join, 0 otherwise
- fee - the group joining price (0 when free)
- permissions - the comma-separated list of bot's permissions
Return value
- This command returns complex data and available only when requesting JSON output (dataType=json).
- Also note that order of the group details (name, uuid etc) in the object may vary (see the order in example below).
- The result may be quite long for LSL HTTP query since it is limited to 1024 characters. To limit the result to specific group only, use limit_name and limit_uuid parameters.
Example
The example of the groups list returned:
{
"action": "listgroups_extended",
"result": "OK",
"groups": [
{
"name": "HMG SYSTEM",
"uuid": "051b19c0-2deb-a716-8894-1cf5701bf6e6",
"open": 0,
"fee": "0",
"permissions": "JoinChat,AllowVoiceChat,AllowSetHome,Accountable,ReceiveNotices"
},
{
"name": "Earn2Life - earn L$500-1000 a day",
"uuid": "41ff4c6b-e3c0-a2b9-f53b-797e78532374",
"fee": "0",
"open": 0,
"permissions": "Invite,Eject,AssignMemberLimited,RemoveMember,JoinChat,AllowFly,AllowLandmark,AllowVoiceChat,AllowSetHome,LandManageAllowed,LandManageBanned,LandEjectAndFreeze,ModerateChat,SendNotices,ReceiveNotices,StartProposal,VoteOnProposal,MemberVisible"
},
{
"name": ".oO [KB] Kitty Boom Oo.",
"uuid": "5611bcb8-8a0f-be6e-2e17-b3c6ec629716",
"open": 0,
"fee": "0",
"permissions": "JoinChat,AllowVoiceChat,AllowSetHome,Accountable,ReceiveNotices"
}
]
}
The example of the limit_name=Earn2 parameter usage:
{
"action": "listgroups_extended",
"result": "OK",
"groups": [
{
"name": "Earn2Life - earn L$500-1000 a day",
"uuid": "41ff4c6b-e3c0-a2b9-f53b-797e78532374",
"fee": "0",
"open": 0,
"permissions": "Invite,Eject,AssignMemberLimited,RemoveMember,JoinChat,AllowFly,AllowLandmark,AllowVoiceChat,AllowSetHome,LandManageAllowed,LandManageBanned,LandEjectAndFreeze,ModerateChat,SendNotices,ReceiveNotices,StartProposal,VoteOnProposal,MemberVisible"
}
]
}
<< return back to Bot commands
(Miss an API call or parameter? Submit your request in forum)