Difference between revisions of "Simple Groups API/invite"
From SmartBots Developers Docs
(Created page with "{{DISPLAYTITLE: invite (HTTP Group Command)}} <onlyinclude>Sends the group invitation to specific resident.</onlyinclude> {{API Variables Table}} {{API HTTP Group Required V...") |
|||
Line 29: | Line 29: | ||
The following example sends a direct group invitation to a resident touching the object (the group name is "My Group Name"). The greeting IM is being delivered along with the invitation. | The following example sends a direct group invitation to a resident touching the object (the group name is "My Group Name"). The greeting IM is being delivered along with the invitation. | ||
− | <syntaxhighlight> | + | <syntaxhighlight lang="lsl"> |
touch_start(integer num) { | touch_start(integer num) { | ||
string params = llDumpList2String([ | string params = llDumpList2String([ |
Revision as of 13:35, 29 June 2016
Sends the group invitation to specific resident.
Variables
The following table shows input values (you send them with the API call) and returned output values.
Variable | Required | Description | |
---|---|---|---|
Input base: | |||
action | yes | = invite | |
apikey | yes | Your personal developer's API key. | |
secret | yes | Security code of the group you are using. | |
secret_sha1 | optional | The same as "secret" but hashed using SHA1 (useful if you don't want to keep plain customer's passwords) | |
Input: | |||
group | yes | the group name (must be listed with SmartBots!) | |
slkey | yes | the UUID of the resident | |
role | optional | the group role name (default 'Everyone') | |
message | optional | the optional message to send along with invitation (can't contain international characters) | |
force | optional | if equals to 1 - invite existing group members also (otherwise silently ignore them) | |
cooldown | optional | set to X seconds = do not send other invitation to this resident during next X seconds | |
location | optional | put a location address here, it will be visible in statistics instead of automatic one.
Format: REGION NAME/X/Y/Z | |
misc | optional | set the custom "Misc" value in group invitation statistics.
Format: any text, 60 characters max | |
Output (plain text returned): | |||
OK | command completed successfully | ||
anything else | Request failed, the fail reason is returned |
Example
The following example sends a direct group invitation to a resident touching the object (the group name is "My Group Name"). The greeting IM is being delivered along with the invitation.
touch_start(integer num) {
string params = llDumpList2String([
"action=" + "invite",
"apikey=" + llEscapeURL(yourApiKey),
"secret=" + llEscapeURL(groupSecretCode),
"group=" + llEscapeURL("My Group Name"),
"slkey=" + (string)llDetectedKey(0),
"force=" + "1", // Invite group members too
"message=" + llEscapeURL("Welcome!")], // Send a greeting IM
"&");
llHTTPRequest(
"http://api.mysmartbots.com/api/simple.html",
[HTTP_METHOD,"POST"],
params
);
}
<< return back to group commands