HTTP API

From SmartBots Developers Docs
Revision as of 15:18, 14 October 2019 by Gg (Talk | contribs)

Jump to: navigation, search

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("https://api.mysmartbots.com/api/bot.html",
 [HTTP_METHOD,"POST"], params);

Check HTTP API examples to see how to control your bot from LSL.

The basics

Basically the whole process consists of the following steps:

  1. Compose the query string and send it using llHTTPRequest (either GET or POST).
  2. Pickup the SmartBots reply using http_response.
  3. Decode the reply.

Read Doing HTTP API Calls for more info.