Page tree
Skip to end of metadata
Go to start of metadata


cURL


curl -X POST \
  https://eu1.loriot.io/1/rest \
-H 'Authorization: Bearer vngP0gAAAA1ldTEubG9yaW90Lmlvbwvpo9vGjp9iwWFRtybpKA==' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"cmd": "tx",
"EUI": "0004A30B001AF421",
"port": 33,
"confirmed": false,
"data": "0ffff0",
"appid": "BE010037"
}'


In the body, you need to replace EUI, port, data, confirmed, appid for proper values according to your needs.

In the auth header, Bearer token is the Application token which you can find in the Access Tokens sub-menu.

PHP


<?php


$request = new HttpRequest();
$request->setUrl('https://eu1.loriot.io/1/rest');
$request->setMethod(HTTP_METH_POST);


$request->setHeaders(array(
  'Authorization' => 'Bearer vngP0gAAAA1ldTEubG9yaW90Lmlvbwvpo9vGjp9iwWFRtybpKA==',
  'Content-Type' => 'application/json'
));


$request->setBody('{
        "cmd": "tx",
        "EUI": "0004A30B001AF421",
        "port": 33,
        "confirmed": false,
        "data": "0ffff0",
        "appid": "BE010037"
}');


try {
  $response = $request->send();


  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
  • No labels