//Пример кода на PHP
$ch = curl_init();
$data = ['email' => 'ivan@mail.ru','api_key' => '123456'];
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Accept: application/json', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_URL, '
https://demo.s20.online/v2api/auth/login');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch), true);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_errno($ch))
throw new \Exception('Curl error');
curl_close($ch);
if ($code !== 200)
throw new \Exception($result['name'] . ' - ' . $result['message']);
$token = $result['token'];