Read data by ID
curl --request GET \
--url https://apiweb.mile.app/api/v4/data/{dataId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v4/data/{dataId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiweb.mile.app/api/v4/data/{dataId}', 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://apiweb.mile.app/api/v4/data/{dataId}",
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: Bearer <token>"
],
]);
$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://apiweb.mile.app/api/v4/data/{dataId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v4/data/{dataId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/data/{dataId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"_id": "6aec2e6974e959b1f2094655",
"dataTypeId": "6abcadb6a138a6318d023ec5",
"hubId": "65c1f68ea735b522d370ea25",
"dataId": "OUT-0012",
"outletName": "Toko Sumber Rejeki",
"channel": "retail",
"region": {
"_id": "6abcadb6a138a6318d02a001",
"dataId": "JBR",
"regionName": "West Java"
},
"limitUser": [
"all"
],
"organizationId": "65c1f4eeca7c4816d94587b2",
"createdBy": "admin@example.com",
"createdTime": "2026-11-05 07:21:13",
"updatedTime": "2026-11-05 07:21:13",
"data_type": {
"_id": "6abcadb6a138a6318d023ec5",
"name": "Outlet"
}
}
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Data Source
Read data by ID
Returns one record by its _id. Each relation field is expanded one level into the linked record (its _id, Title and fields); expand=1 expands one more level. Fields hidden from the caller’s role stay hidden, and a linked record the caller may not read is left as its id.
v4 differences: relations are expanded, and the read is not limited by Limit Data by User.
Requires permission view/data.
GET
/
data
/
{dataId}
Read data by ID
curl --request GET \
--url https://apiweb.mile.app/api/v4/data/{dataId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v4/data/{dataId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiweb.mile.app/api/v4/data/{dataId}', 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://apiweb.mile.app/api/v4/data/{dataId}",
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: Bearer <token>"
],
]);
$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://apiweb.mile.app/api/v4/data/{dataId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v4/data/{dataId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/data/{dataId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"_id": "6aec2e6974e959b1f2094655",
"dataTypeId": "6abcadb6a138a6318d023ec5",
"hubId": "65c1f68ea735b522d370ea25",
"dataId": "OUT-0012",
"outletName": "Toko Sumber Rejeki",
"channel": "retail",
"region": {
"_id": "6abcadb6a138a6318d02a001",
"dataId": "JBR",
"regionName": "West Java"
},
"limitUser": [
"all"
],
"organizationId": "65c1f4eeca7c4816d94587b2",
"createdBy": "admin@example.com",
"createdTime": "2026-11-05 07:21:13",
"updatedTime": "2026-11-05 07:21:13",
"data_type": {
"_id": "6abcadb6a138a6318d023ec5",
"name": "Outlet"
}
}
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}