Difference between revisions of "HTTP API"
From SmartBots Developers Docs
Line 20: | Line 20: | ||
There are two types of HTTP API at SmartBots. Open one of the following pages for complete list of the commands: | There are two types of HTTP API at SmartBots. Open one of the following pages for complete list of the commands: | ||
− | # [[HTTP API/ | + | # [[HTTP API/Bot Commands|Bot API]] - recommended set of routines to fully control your bot |
− | # [[HTTP API/ | + | # [[HTTP API/Simple Groups|Simple groups API]] - easy-to-use API to control group invitations |
− | ''' | + | '''Bot API''' provides full more control over your bot. |
− | ''' | + | '''Simple Group API''' has been designed to send invitations and eject members by sending simple HTTP queries. |
== The basics == | == The basics == |
Revision as of 08:31, 21 December 2016
HTTP API allows controlling SL groups and Second Life bots using HTTP queries. The query can be send from SL object (LSL script) or online:
string params = llDumpList2String([
"action=" + "get_balance",
"apikey=" + llEscapeURL(sbApiKey),
"botname=" + llEscapeURL(sbBotName),
"secret=" + llEscapeURL(sbBotAccessCode)
], "&");
llHTTPRequest("http://api.mysmartbots.com/api/bot.html",
[HTTP_METHOD,"POST"], params);
Check HTTP API examples to see how to control your bot from LSL.
API Types
There are two types of HTTP API at SmartBots. Open one of the following pages for complete list of the commands:
- Bot API - recommended set of routines to fully control your bot
- Simple groups API - easy-to-use API to control group invitations
Bot API provides full more control over your bot.
Simple Group API has been designed to send invitations and eject members by sending simple HTTP queries.
The basics
Basically the whole process consists of the following steps:
- Compose the query string and send it using llHTTPRequest (either GET or POST).
- Pickup the SmartBots reply using http_response.
- Decode the reply.
Read Doing HTTP API Calls for more info.