Difference between revisions of "HTTP API/Examples/Sending group invitation"
From SmartBots Developers Docs
(Created page with "{{DISPLAYTITLE: Group Invite}} The following example demonstrates the usage of group_invite API command. It delivers invitation to ever...") |
|||
Line 6: | Line 6: | ||
== Sending the group invitation to avatar == | == Sending the group invitation to avatar == | ||
− | <syntaxhighlight> | + | <syntaxhighlight lang="lsl"> |
string sbApiKey="..."; | string sbApiKey="..."; | ||
string sbBotName="..."; | string sbBotName="..."; |
Revision as of 16:18, 29 June 2016
The following example demonstrates the usage of group_invite API command.
It delivers invitation to everyone who touches your object.
Sending the group invitation to avatar
string sbApiKey="...";
string sbBotName="...";
string sbBotAccessCode="...";
key groupUUID="....";
key roleUUID="..."; // NULL_KEY for "Everyone"
string message="Welcome to our group!";
default {
touch_start(integer total_number) {
string params = llDumpList2String([
"action=" + "group_invite",
"apikey=" + llEscapeURL(sbApiKey),
"botname=" + llEscapeURL(sbBotName),
"secret=" + llEscapeURL(sbBotAccessCode),
"avatar=" + llEscapeURL(llDetectedKey(0)),
"groupuuid=" + llEscapeURL((string)groupUUID),
"roleuuid=" + llEscapeURL((string)roleUUID),
"message=" + llEscapeURL(message),
], "&");
llHTTPRequest("http://api.mysmartbots.com/api/bot.html",
[HTTP_METHOD,"POST"], params);
}