# Commands

Send commands to the liveX. Only one command per request can be sent.

URL: **`http://LIVEX_IP_ADDRESS/api.php?set=command&type=TYPE&entity=ENTITY&text1=TEXT1&text2=TEXT2`**

Method: **`GET`**

Request Parameters:

* **`type`** - Command identifier, documented in the batterX ID Protocol
* **`entity`** - (`Optional | Default: 0`) Command indentifier, documented in the batterX ID Protocol
* **`text1`** - (`Optional | Default: ""`) Documented in the batterX ID Protocol
* **`text2`** - (`Optional | Default: ""`) Documented in the batterX ID Protocol

Response Format: **`BOOLEAN`**

## Response Example

```
1
```

Returns `1` when command is inserted to the queue.

***Note:** This does not mean that the command has (or will) be executed, you need to manually confirm that.*

Returns empty string when command could not be inserted to the queue.

## Examples

#### **`JavaScript Example (jQuery)`**

```javascript
$.get({
    url: "http://LIVEX_IP_ADDRESS/api.php?set=command&type=20737&text1=1&text2=1",
    success: function(response) {
        console.log(response);
    }
});
```

#### **`PHP Example`**

```php
$response = file_get_contents("http://LIVEX_IP_ADDRESS/api.php?set=command&type=20737&text1=1&text2=1");
var_dump(response);
```

#### **`Python Example (requests)`**

```python
import requests
response = requests.get("http://LIVEX_IP_ADDRESS/api.php?set=command&type=20737&text1=1&text2=1")
print(response.text)
```
