Get device sensor data
curl --request GET \
--url https://app.mertani.co.id/external/v1/devices/{device_id}/data \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://app.mertani.co.id/external/v1/devices/{device_id}/data"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://app.mertani.co.id/external/v1/devices/{device_id}/data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.mertani.co.id/external/v1/devices/{device_id}/data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.mertani.co.id/external/v1/devices/{device_id}/data"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.mertani.co.id/external/v1/devices/{device_id}/data")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.mertani.co.id/external/v1/devices/{device_id}/data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"message": "Success",
"data": [
{
"timestamp": "2026-05-05T07:00:00+07:00",
"sensors": [
{
"id": "DEV001-sig",
"value": 15,
"unit": "."
},
{
"id": "DEV001-batt",
"value": 92,
"unit": "%"
},
{
"id": "DEV001-flTemp",
"value": 29.8,
"unit": "C"
},
{
"id": "DEV001-flLev",
"value": 152.45,
"unit": "cm"
}
]
},
{
"timestamp": "2026-05-05T07:15:00+07:00",
"sensors": [
{
"id": "DEV001-sig",
"value": 16,
"unit": "."
},
{
"id": "DEV001-batt",
"value": 91,
"unit": "%"
},
{
"id": "DEV001-flTemp",
"value": 30.2,
"unit": "C"
},
{
"id": "DEV001-flLev",
"value": 153.1,
"unit": "cm"
}
]
}
]
}{
"message": "Bad Request",
"data": null
}{
"message": "Unauthorized",
"data": null
}{
"message": "Forbidden",
"data": null
}{
"message": "Device not found",
"data": null
}{
"message": "Method Not Allowed",
"data": null
}{
"message": "To Many Request",
"data": null
}Open API
Get Device Sensor Data
Mengambil data sensor berdasarkan rentang waktu.
GET
/
devices
/
{device_id}
/
data
Get device sensor data
curl --request GET \
--url https://app.mertani.co.id/external/v1/devices/{device_id}/data \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://app.mertani.co.id/external/v1/devices/{device_id}/data"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://app.mertani.co.id/external/v1/devices/{device_id}/data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.mertani.co.id/external/v1/devices/{device_id}/data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.mertani.co.id/external/v1/devices/{device_id}/data"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.mertani.co.id/external/v1/devices/{device_id}/data")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.mertani.co.id/external/v1/devices/{device_id}/data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"message": "Success",
"data": [
{
"timestamp": "2026-05-05T07:00:00+07:00",
"sensors": [
{
"id": "DEV001-sig",
"value": 15,
"unit": "."
},
{
"id": "DEV001-batt",
"value": 92,
"unit": "%"
},
{
"id": "DEV001-flTemp",
"value": 29.8,
"unit": "C"
},
{
"id": "DEV001-flLev",
"value": 152.45,
"unit": "cm"
}
]
},
{
"timestamp": "2026-05-05T07:15:00+07:00",
"sensors": [
{
"id": "DEV001-sig",
"value": 16,
"unit": "."
},
{
"id": "DEV001-batt",
"value": 91,
"unit": "%"
},
{
"id": "DEV001-flTemp",
"value": 30.2,
"unit": "C"
},
{
"id": "DEV001-flLev",
"value": 153.1,
"unit": "cm"
}
]
}
]
}{
"message": "Bad Request",
"data": null
}{
"message": "Unauthorized",
"data": null
}{
"message": "Forbidden",
"data": null
}{
"message": "Device not found",
"data": null
}{
"message": "Method Not Allowed",
"data": null
}{
"message": "To Many Request",
"data": null
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
Query Parameters
Timestamp awal data (ISO 8601). Jika tidak diisi, default hari ini jam 00:00:00. Format: YYYY-MM-DDTHH:MM:SSZ
Timestamp akhir data (ISO 8601). Jika tidak diisi, default waktu sekarang. Format: YYYY-MM-DDTHH:MM:SSZ
Last modified on June 11, 2026
⌘I