PHP

ThingsOn HTTP API / PHP

PHP programlama dilini kullanarak platforma veri göndermek için aşağıdaki örneği kullanabilirsiniz.

Write
<?php
$request = new HttpRequest();
$request->setUrl('http://cloud.thingson.io:8086/write');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData(array(
'db' => '[DB_NAME]'
));
$request->setHeaders(array(
'Authorization' => 'Basic [API_KEY]'
));
$request->setBody('[TABLE_NAME] [FIELD_1=90],[FIELD_2=90],[FIELD_3=90]');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}