Endpoint ini digunakan untuk mengambil data CentraDemo yang telah difilter dan siap digunakan untuk visualisasi peta (map, tracking, playback).
/api/centra-demo/map/filteredGETapplication/json| Parameter | Type | Required | Description |
|---|---|---|---|
hasLatitude |
boolean | No | Filter records that have latitude data (index 2 in the CSV data). |
hasLongitude |
boolean | No | Filter records that have longitude data (index 3 in the CSV data). |
hasCoordinates |
boolean | No | Filter records that have both latitude and longitude data. |
deviceId |
string | No | Filter records by a specific device ID (index 1 in the CSV data). |
cursor |
string (UUID) | No | The ID of the last record from the previous request for pagination. |
take |
number | No | Number of records to retrieve (default: 10, min: 1). |
orderBy |
string | No | Sort order by created_at. Values: asc, desc (default: desc). |
days |
number | No | Limit results to records from the last N days. |
The response follows a standard format:
success: (boolean) Indicates if the request was successful.message: (string) Message describing the result.data: (object)
items: (array) List of filtered and parsed records.
id: (string/UUID) Unique record identifier.data: (string) Raw comma-separated data.created_at: (string/ISO8601) Creation timestamp.updated_at: (string/ISO8601) Last update timestamp.parsedData: (object) Parsed representation of the raw data.
timestamp: (string) UNIX timestamp from data.id: (string) Device ID from data.latitude: (number) Parsed latitude.longitude: (number) Parsed longitude.additionalData: (array) Remaining data fields.meta: (object) Pagination and filter metadata.
take: (number) Items per page.orderBy: (string) Sort order.cursor: (string/null) Start cursor used.hasMore: (boolean) Indicates if more records are available.nextCursor: (string/null) Cursor for the next page.filters: (object) Applied filters.totalFiltered: (number) Total count matching the filters (if applicable).Contoh Request:
GET /api/centra-demo/map/filtered?hasCoordinates=true&take=100&orderBy=desc
Response:
{
"status": "success",
"message": "Filtered CentraDemo records retrieved successfully",
"data": {
"items": [
{
"id": "02684108-6107-42ac-bebe-8fcddb23edf8",
"data": "11:32:38 2026-01-30,111102,-6.190965,106.764906,56.40,0.11,,,1,1",
"created_at": "2026-01-30T04:34:18.495Z",
"updated_at": "2026-01-30T04:34:18.495Z",
"parsedData": {
"timestamp": "11:32:38 2026-01-30",
"id": "111102",
"latitude": -6.190965,
"longitude": 106.764906,
"altitude": 56.4,
"imei": "111102111111111",
"speed": 0.11,
"additionalData": [
"56.40",
"0.11",
"",
"",
"1",
"1"
]
}
},
{
"id": "e40718ae-7614-4dba-87dc-f0b72d0976aa",
"data": "09:50:41 2026-01-29,111100,-6.190979,106.764928,50.00,0.15,,,1,1",
"created_at": "2026-01-29T02:52:20.647Z",
"updated_at": "2026-01-29T02:52:20.647Z",
"parsedData": {
"timestamp": "09:50:41 2026-01-29",
"id": "111100",
"latitude": -6.190979,
"longitude": 106.764928,
"altitude": 50,
"imei": "111100111111111",
"speed": 0.15,
"additionalData": [
"50.00",
"0.15",
"",
"",
"1",
"1"
]
}
},
{
"id": "dea08500-dd4c-454b-88b9-88fbe0168776",
"data": "15:07:22 2026-01-28,,-6.190922,106.764912,46.50,0.30,,,1,1",
"created_at": "2026-01-28T08:09:01.348Z",
"updated_at": "2026-01-28T08:09:01.348Z",
"parsedData": {
"timestamp": "15:07:22 2026-01-28",
"id": null,
"latitude": -6.190922,
"longitude": 106.764912,
"altitude": 46.5,
"imei": "111111111111111",
"speed": 0.3,
"additionalData": [
"46.50",
"0.30",
"",
"",
"1",
"1"
]
}
},
{
"id": "6fc416ee-0246-4ebf-a02b-cb423ebebb86",
"data": "1768474211,111101,-2.160722,103.717386,54.50,0.00,,,1,1",
"created_at": "2026-01-27T09:37:19.228Z",
"updated_at": "2026-01-27T09:37:19.228Z",
"parsedData": {
"timestamp": "1768474211",
"id": "111101",
"latitude": -2.160722,
"longitude": 103.717386,
"altitude": 54.5,
"imei": "111101111111111",
"speed": 0,
"additionalData": [
"54.50",
"0.00",
"",
"",
"1",
"1"
]
}
}
],
"meta": {
"take": 100,
"orderBy": "desc",
"cursor": null,
"hasMore": false,
"nextCursor": null,
"filters": {
"hasCoordinates": true,
"days": null
},
"totalFiltered": 4,
"totalBeforeGrouping": 825
}
}
}
Endpoint ini digunakan untuk mengembalikan data kronologis untuk perangkat tertentu tanpa pengelompokan, berguna untuk pemutaran ulang jejak (track playback).
/api/centra-demo/map/historyGETapplication/json| Parameter | Type | Required | Description |
|---|---|---|---|
deviceId |
string | Yes | Device ID (DMR ID) to retrieve history for. |
cursor |
string (UUID) | No | The ID of the last record from the previous request for pagination. |
take |
number | No | Number of records to retrieve (default: 10, min: 1). |
orderBy |
string | No | Sort order by created_at. Values: asc, desc (default: desc). |
days |
number | No | Limit history to records from the last N days. |
The response follows a standard format:
items: (array) List of coordinate points.
id: (string) Record ID (prefixed with interpolated- for generated points).interpolated: (boolean) true if this point was generated by the system for smoothing.parsedData: (object) Contains latitude and longitude.meta: (object)
totalMatched: Total records found for this device.totalAfterInterpolation: Total records after adding system-generated pointsContoh Request:
GET /api/centra-demo/map/history?deviceId=171008&take=50&orderBy=asc
Response:
{
"success": true,
"message": "CentraDemo history retrieved successfully",
"data": {
"items": [
{
"id": "uuid-asli-1",
"data": "1696536762,171008,-6.191000,106.764776,76.00,,,1,1",
"created_at": "2024-01-01T00:00:00.000Z",
"interpolated": false,
"parsedData": {
"latitude": -6.191,
"longitude": 106.764776
}
},
{
"id": "interpolated-uuid-asli-1-1",
"data": "1696536772,171008,,106.764800:-6.191050:interpolated",
"created_at": "2024-01-01T00:00:10.000Z",
"interpolated": true,
"parsedData": {
"latitude": -6.19105,
"longitude": 106.7648
}
}
],
"meta": {
"take": 50,
"orderBy": "asc",
"deviceId": "171008",
"totalMatched": 120,
"totalAfterInterpolation": 155
}
}
}
Endpoint ini digunakan untuk menyimpan data CentraDemo baru ke database.
/api/centra-demoPOSTapplication/json| Field | Type | Required | Description |
|---|---|---|---|
data |
string | Yes | The content string to be saved. Typically in CSV format for GPS data. |
success: (boolean) Indicates if the record was created.data: (object) The created record object.
id: (string/UUID) The unique identifier of the new record.data: (string) The saved data content.created_at: (string/ISO8601) Server timestamp of creation.Request Body:
{
"data": "1696536762,171008,-6.191000,106.764776,76.00,15.5,270,1,1"
}
Response:
{
"success": true,
"message": "CentraDemo record created successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"data": "1696536762,171008,-6.191000,106.764776,76.00,15.5,270,1,1",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
}
Mengambil daftar seluruh data CentraDemo dalam bentuk halaman (pagination). Endpoint ini mendukung pagination berbasis halaman sederhana serta pemfilteran berdasarkan ID perangkat.
/api/centra-demoGETapplication/json| Parameter | Type | Required | Description |
|---|---|---|---|
cursor |
string | No | Page number for pagination (default: “1”). |
take |
number | No | Number of records per page (default: 10). |
orderBy |
string | No | Sort order by created_at. Values: asc, desc (default: desc). |
deviceId |
string | No | Filter records by a specific device ID (DMR ID). |
data: (object)
items: (array) List of records with parsedData.meta: (object)
currentPage: Current page number.totalCount: Total number of records in the database.hasMore: Boolean indicating if next pages exist.Request:
GET /api/centra-demo?cursor=1&take=2&orderBy=desc
Response:
{
"status": "success",
"message": "CentraDemo records retrieved successfully",
"data": {
"items": [
{
"id": "68c7b81a-d28c-4732-8deb-d23d70787223",
"data": "10:10:36 2026-02-02,111102,-6.190949,106.764919,47.10,0.24,,,1,1",
"created_at": "2026-02-02T03:12:18.232Z",
"updated_at": "2026-02-02T03:12:18.232Z",
"parsedData": {
"timestamp": "10:10:36 2026-02-02",
"id": "111102",
"latitude": -6.190949,
"longitude": 106.764919,
"additionalData": [
"47.10",
"0.24",
"",
"",
"1",
"1"
]
}
},
{
"id": "f55e6b5e-5191-4d8c-848a-7ffc8849087e",
"data": "10:10:34 2026-02-02,111102,-6.190946,106.764918,47.70,0.13,,,1,1",
"created_at": "2026-02-02T03:12:14.248Z",
"updated_at": "2026-02-02T03:12:14.248Z",
"parsedData": {
"timestamp": "10:10:34 2026-02-02",
"id": "111102",
"latitude": -6.190946,
"longitude": 106.764918,
"additionalData": [
"47.70",
"0.13",
"",
"",
"1",
"1"
]
}
}
],
"meta": {
"take": 2,
"orderBy": "desc",
"cursor": "1",
"hasMore": true,
"nextCursor": "2",
"totalCount": 843294,
"currentPage": 1
}
}
}
Mengambil detail satu record menggunakan UUID unik.
/api/centra-demo/{id}GETapplication/json| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string (UUID) | Yes | The unique identifier of the record. |
{
"success": true,
"message": "CentraDemo record found successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"data": "1696536762,171008,-6.191000,106.764776,76.00,15.5,270,1,1",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
}
Melakukan update pada record yang sudah ada
/api/centra-demo/{id}PUTapplication/json| Field | Type | Required | Description |
|---|---|---|---|
data |
string | No | The updated content string. |
{
"success": true,
"message": "CentraDemo record updated successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"data": "Updated content string",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T10:00:00.000Z"
}
}
Menghapus record secara permanen dari database.
/api/centra-demo/{id}DELETEapplication/json{
"success": true,
"message": "CentraDemo record deleted successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"data": "Data that was deleted",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
}