group_list2

From SmartBots Developers Docs
Jump to: navigation, search

Returns the bot's groups list as JSON.

// See "LSL Helper Functions" page for this function
smartbotsAPI("group_list2", []);

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 = group_list2
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 (case insensitive)
limit_uuid optional list only the groups which UUID exactly matches this value
with_roles optional set to 1 to get roles of each group. Warning: makes the command slower (up to 15 seconds).
with_titles optional if "with_roles" set, this parameter adds current active title information. Warning: makes the command even more slower (up to 30 seconds).
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 containing bot's groups (see below)


Return value

  • This command returns complex data and available only when requesting JSON output (dataType=json).
  • 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":"SmartBots: group invitation bots",
			"uuid":"0b65a122-8f77-64fe-5b2a-225d4c490d9c",
			"fee":0,
			"open":0,
			"permissions":"Invite,JoinChat,ReceiveNotices",
			"roles": [
				{
					"name":"Owners",
					"uuid":"044ad014-7298-eb70-0945-85d6df01f154",
					"title":"SmartBots CEO",
					"description":"These are the owners of the group.  They always have FULL POWER over the group.",
					"titleSelected":false
				},
				{
					"name":"SmartBots",
					"uuid":"10d7e54f-7c52-8f0e-7ad8-7e0059664cd0",
					"title":"SmartBots",
					"description":"",
					"titleSelected":false
				},
				...
			],
			"acceptNotices":true,
			"listInProfile":true,
			"allowPublish":false
		},
		...
	],
}



<< return back to Bot commands

(Miss an API call or parameter? Submit your request in forum)