Difference between revisions of "Simple Groups API/invite"
From SmartBots Developers Docs
m (Gg moved page HTTP API/Simple Groups/invite to Simple Groups API/invite) |
|||
(One intermediate revision by the same user not shown) | |||
Line 12: | Line 12: | ||
{{API Variable|message|no}} the optional message to send along with invitation (can't contain international characters) | {{API Variable|message|no}} the optional message to send along with invitation (can't contain international characters) | ||
{{API Variable|force|no}} if equals to 1 - invite existing group members also (otherwise silently ignore them) | {{API Variable|force|no}} if equals to 1 - invite existing group members also (otherwise silently ignore them) | ||
− | {{API Variable|cooldown|no}} set to X seconds = do not send other invitation to this resident during next X seconds | + | {{API Variable|cooldown|no}} set to X seconds = do not send other invitation to this resident during next X seconds. Maximum value is 86400 seconds (24 hours) |
{{API Variable|location|no}} put a location address here, it will be visible in statistics instead of automatic one. | {{API Variable|location|no}} put a location address here, it will be visible in statistics instead of automatic one. | ||
Latest revision as of 15:10, 14 October 2019
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. Maximum value is 86400 seconds (24 hours) | |
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(
"https://api.mysmartbots.com/api/simple.html",
[HTTP_METHOD,"POST"],
params
);
}
<< return back to group commands