# HTTP API

![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/89ebd547-4bf3-44c4-b52c-73f3295d916a/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T141500Z&X-Amz-Expires=86400&X-Amz-Signature=fa98ed06a8e95b0c3be4498da2ef1c4b3a35b9574919e18100b57266ddd300bf&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject " =1536x1024")

HTTP API allows controlling your Second Life bot using HTTP queries. The query can be send from SL object (LSL script), website code or your application.

## The basics

Basically the API usage consists of the following steps:


1. Compose the query and send it (using **llHTTPRequest** in case of LSL)
2. Wait for the SmartBots reply (using **http_response** in case of LSL)
3. Decode the reply.

Each SmartBots bot comes with HTTP API enabled. You just need to grab the [bot's API token](/doc/c2ff5da0-95cd-4393-8f14-0f153700cfd4) (it is a kind of password for bot's API) and your unique ==Developer's API key==.

## API Testing Suite

There's a special page to compose and test HTTP API queries: <https://www.mysmartbots.com/api/testing.html>

## Usage

### **Raw code**

```javascript
string params = llDumpList2String([
  "action="  + "get_balance",
  "apikey="  + llEscapeURL(sbApiKey),
  "botname=" + llEscapeURL(sbBotName),
  "secret="  + llEscapeURL(sbBotApiToken)
], "&");

llHTTPRequest("https://api.mysmartbots.com/api/bot.html",
 [HTTP_METHOD,"POST"], params);
```

Read ==Doing HTTP API Calls== for more info.

### **Helper functions**

We've written few helper functions to make HTTP API usage easier:

```javascript
smartbotsAPI("status", []); 
```

Check ==LSL Helper Functions== for more info on helpers.

### **More examples**

Check ==HTTP API examples== to see how HTTP API works in LSL.

---

**Documents**

- [Doing HTTP API Calls](https://www.mysmartbots.com/docs/s/dev/doc/doing-http-api-calls-9HK1JdCL48)
- [Bot Commands](https://www.mysmartbots.com/docs/s/dev/doc/bot-commands-KI0c0baOZu)
- [Developer's API Key](https://www.mysmartbots.com/docs/s/dev/doc/developers-api-key-oAHDPgEiOt)
- [LSL Helper Functions](https://www.mysmartbots.com/docs/s/dev/doc/lsl-helper-functions-q99HvYlQ9a)
- [Examples](https://www.mysmartbots.com/docs/s/dev/doc/examples-SeUeXptlbF)
- [Updates & Changes](https://www.mysmartbots.com/docs/s/dev/doc/updates-changes-Ldu1LqJXJC)