# HTTP API

![](https://outline-production-attachments.s3-accelerate.amazonaws.com/uploads/fe746996-bd68-4ba8-a15e-e239ddd741be/a08ea29c-e964-4d81-a710-c4cbdf2342e1/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4EOUDTOVUICLPZ4P%2F20260919%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260919T064500Z&X-Amz-Expires=86400&X-Amz-Signature=c85311c1804f0faa40282dc529de28259ad9e252253a1574d824112299db8451&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 access code](https://www.mysmartbots.com/docs/Bot_access_code) (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(sbBotAccessCode)
], "&");

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**

- [Updates & Changes](https://sb-docs-dev.getoutline.com/s/dev/doc/updates-changes-fmfzLz9o0L)
- [Bot Commands](https://sb-docs-dev.getoutline.com/s/dev/doc/bot-commands-LY1lryPggd)
- [Doing HTTP API Calls](https://sb-docs-dev.getoutline.com/s/dev/doc/doing-http-api-calls-c6FSEMF7bP)
- [Developer's API Key](https://sb-docs-dev.getoutline.com/s/dev/doc/developers-api-key-tw8bQj4LSJ)
- [LSL Helper Functions](https://sb-docs-dev.getoutline.com/s/dev/doc/lsl-helper-functions-fYw8fhXN6V)
- [Examples](https://sb-docs-dev.getoutline.com/s/dev/doc/examples-0vYmTvNB3S)