# JSON specification

The formats of requests and responses to the API comply with the specification [JSON API v1.0](http://jsonapi.org/format/1.0).

The method of dispatch is always **`POST`**

Query headers should always contain&#x20;

```
Content-type: text/json; charset=utf-8;
```

JSON document encoding: **`UTF-8`**

#### Server address for sending requests

<mark style="color:red;">`http://lk.mysmpp.ru`</mark>

### Examples of JSON transfer

{% tabs %}
{% tab title="PHP" %}

<pre class="language-php"><code class="lang-php">&#x3C;?php
    // JSON-document
    $src = json_encode([
        "login" => "login",
        "password" => "password"
    ]);
    // server address
<strong>    $href = 'http://server/script.php';
</strong>    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: text/json; charset=utf-8'));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CRLF, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $src);
    curl_setopt($ch, CURLOPT_URL, $href);
    $result = curl_exec($ch);
    curl_close($ch);
    echo $result;
</code></pre>

{% endtab %}
{% endtabs %}
