1
1
{
2
2
"swagger" : " 2.0" ,
3
3
"info" : {
4
- "version" : " 3.15 " ,
4
+ "version" : " 4.8 " ,
5
5
"title" : " traccar"
6
6
},
7
7
"host" : " demo.traccar.org" ,
168
168
{
169
169
"name" : " deviceId" ,
170
170
"in" : " query" ,
171
+ "description" : " Internal device identifier. Only works if device has already reported some locations" ,
172
+ "required" : false ,
171
173
"type" : " integer"
172
174
},
175
+ {
176
+ "name" : " protocol" ,
177
+ "in" : " query" ,
178
+ "description" : " Protocol name. Can be used instead of device id" ,
179
+ "required" : false ,
180
+ "type" : " string"
181
+ },
173
182
{
174
183
"name" : " textChannel" ,
175
184
"in" : " query" ,
185
+ "description" : " When `true` return SMS commands. If not specified or `false` return data commands" ,
186
+ "required" : false ,
176
187
"type" : " boolean"
177
188
}
178
189
],
286
297
}
287
298
}
288
299
},
289
- "/devices/{id}/distance " : {
300
+ "/devices/{id}/accumulators " : {
290
301
"put" : {
291
- "summary" : " Update the distance counter of the Device" ,
302
+ "summary" : " Update total distance and hours of the Device" ,
292
303
"parameters" : [
293
304
{
294
305
"$ref" : " #/parameters/entityId"
298
309
"in" : " body" ,
299
310
"required" : true ,
300
311
"schema" : {
301
- "$ref" : " #/definitions/DeviceTotalDistance "
312
+ "$ref" : " #/definitions/DeviceAccumulators "
302
313
}
303
314
}
304
315
],
1350
1361
}
1351
1362
}
1352
1363
}
1364
+ },
1365
+ "/maintenance" : {
1366
+ "get" : {
1367
+ "summary" : " Fetch a list of Maintenance" ,
1368
+ "description" : " Without params, it returns a list of Maintenance the user has access to" ,
1369
+ "parameters" : [
1370
+ {
1371
+ "$ref" : " #/parameters/all"
1372
+ },
1373
+ {
1374
+ "$ref" : " #/parameters/userId"
1375
+ },
1376
+ {
1377
+ "$ref" : " #/parameters/deviceId"
1378
+ },
1379
+ {
1380
+ "$ref" : " #/parameters/groupId"
1381
+ },
1382
+ {
1383
+ "$ref" : " #/parameters/refresh"
1384
+ }
1385
+ ],
1386
+ "responses" : {
1387
+ "200" : {
1388
+ "description" : " OK" ,
1389
+ "schema" : {
1390
+ "type" : " array" ,
1391
+ "items" : {
1392
+ "$ref" : " #/definitions/Maintenance"
1393
+ }
1394
+ }
1395
+ }
1396
+ }
1397
+ },
1398
+ "post" : {
1399
+ "summary" : " Create a Maintenance" ,
1400
+ "parameters" : [
1401
+ {
1402
+ "$ref" : " #/parameters/Maintenance"
1403
+ }
1404
+ ],
1405
+ "responses" : {
1406
+ "200" : {
1407
+ "description" : " OK" ,
1408
+ "schema" : {
1409
+ "$ref" : " #/definitions/Maintenance"
1410
+ }
1411
+ }
1412
+ }
1413
+ }
1414
+ },
1415
+ "/maintenance/{id}" : {
1416
+ "put" : {
1417
+ "summary" : " Update a Maintenance" ,
1418
+ "parameters" : [
1419
+ {
1420
+ "$ref" : " #/parameters/entityId"
1421
+ },
1422
+ {
1423
+ "$ref" : " #/parameters/Maintenance"
1424
+ }
1425
+ ],
1426
+ "responses" : {
1427
+ "200" : {
1428
+ "description" : " OK" ,
1429
+ "schema" : {
1430
+ "$ref" : " #/definitions/Maintenance"
1431
+ }
1432
+ }
1433
+ }
1434
+ },
1435
+ "delete" : {
1436
+ "summary" : " Delete a Maintenance" ,
1437
+ "parameters" : [
1438
+ {
1439
+ "$ref" : " #/parameters/entityId"
1440
+ }
1441
+ ],
1442
+ "responses" : {
1443
+ "204" : {
1444
+ "description" : " No Content"
1445
+ }
1446
+ }
1447
+ }
1353
1448
}
1354
1449
},
1355
1450
"definitions" : {
1408
1503
"type" : " number"
1409
1504
},
1410
1505
"network" : {
1411
- "type" : " string"
1506
+ "type" : " object" ,
1507
+ "additionalProperties" : true
1412
1508
},
1413
- "attributes" : {}
1509
+ "attributes" : {
1510
+ "type" : " object" ,
1511
+ "additionalProperties" : true
1512
+ }
1414
1513
}
1415
1514
},
1416
1515
"User" : {
1427
1526
"readonly" : {
1428
1527
"type" : " boolean"
1429
1528
},
1430
- "admin " : {
1529
+ "administrator " : {
1431
1530
"type" : " boolean"
1432
1531
},
1433
1532
"map" : {
1471
1570
"limitCommands" : {
1472
1571
"type" : " boolean"
1473
1572
},
1573
+ "poiLayer" : {
1574
+ "type" : " string"
1575
+ },
1474
1576
"token" : {
1475
1577
"type" : " string"
1476
1578
},
1477
- "attributes" : {}
1579
+ "attributes" : {
1580
+ "type" : " object" ,
1581
+ "additionalProperties" : true
1582
+ }
1478
1583
}
1479
1584
},
1480
1585
"Server" : {
1503
1608
"mapUrl" : {
1504
1609
"type" : " string"
1505
1610
},
1611
+ "poiLayer" : {
1612
+ "type" : " string"
1613
+ },
1506
1614
"latitude" : {
1507
1615
"type" : " number"
1508
1616
},
1524
1632
"coordinateFormat" : {
1525
1633
"type" : " string"
1526
1634
},
1527
- "attributes" : {}
1635
+ "attributes" : {
1636
+ "type" : " object" ,
1637
+ "additionalProperties" : true
1638
+ }
1528
1639
}
1529
1640
},
1530
1641
"Command" : {
1541
1652
"type" : {
1542
1653
"type" : " string"
1543
1654
},
1544
- "attributes" : {}
1655
+ "attributes" : {
1656
+ "type" : " object" ,
1657
+ "additionalProperties" : true
1658
+ }
1545
1659
}
1546
1660
},
1547
1661
"Device" : {
1558
1672
"status" : {
1559
1673
"type" : " string"
1560
1674
},
1675
+ "disabled" : {
1676
+ "type" : " boolean"
1677
+ },
1561
1678
"lastUpdate" : {
1562
1679
"type" : " string" ,
1563
1680
"format" : " date-time" ,
1587
1704
"type" : " integer"
1588
1705
}
1589
1706
},
1590
- "attributes" : {}
1707
+ "attributes" : {
1708
+ "type" : " object" ,
1709
+ "additionalProperties" : true
1710
+ }
1591
1711
}
1592
1712
},
1593
1713
"Group" : {
1601
1721
"groupId" : {
1602
1722
"type" : " integer"
1603
1723
},
1604
- "attributes" : {}
1724
+ "attributes" : {
1725
+ "type" : " object" ,
1726
+ "additionalProperties" : true
1727
+ }
1605
1728
}
1606
1729
},
1607
1730
"Permission" : {
1624
1747
"type" : " integer"
1625
1748
},
1626
1749
"calendarId" : {
1627
- "description" : " Geofence Id, can be second parameter only and only in combination with userId" ,
1750
+ "description" : " Calendar Id, can be second parameter only and only in combination with userId" ,
1628
1751
"type" : " integer"
1629
1752
},
1630
1753
"attributeId" : {
1665
1788
"calendarId" : {
1666
1789
"type" : " integer"
1667
1790
},
1668
- "attributes" : {}
1791
+ "attributes" : {
1792
+ "type" : " object" ,
1793
+ "additionalProperties" : true
1794
+ }
1669
1795
}
1670
1796
},
1671
1797
"Notification" : {
1688
1814
"sms" : {
1689
1815
"type" : " boolean"
1690
1816
},
1691
- "attributes" : {}
1817
+ "calendarId" : {
1818
+ "type" : " integer"
1819
+ },
1820
+ "attributes" : {
1821
+ "type" : " object" ,
1822
+ "additionalProperties" : true
1823
+ }
1692
1824
}
1693
1825
},
1694
1826
"NotificationType" : {
1720
1852
"geofenceId" : {
1721
1853
"type" : " integer"
1722
1854
},
1723
- "attributes" : {}
1855
+ "maintenanceId" : {
1856
+ "type" : " integer"
1857
+ },
1858
+ "attributes" : {
1859
+ "type" : " object" ,
1860
+ "additionalProperties" : true
1861
+ }
1724
1862
}
1725
1863
},
1726
1864
"ReportSummary" : {
1878
2016
}
1879
2017
}
1880
2018
},
1881
- "DeviceTotalDistance " : {
2019
+ "DeviceAccumulators " : {
1882
2020
"properties" : {
1883
2021
"deviceId" : {
1884
2022
"type" : " integer"
1885
2023
},
1886
2024
"totalDistance" : {
1887
2025
"type" : " number" ,
1888
2026
"description" : " in meters"
2027
+ },
2028
+ "hours" : {
2029
+ "type" : " number"
1889
2030
}
1890
2031
}
1891
2032
},
1901
2042
"type" : " string" ,
1902
2043
"description" : " base64 encoded in iCalendar format"
1903
2044
},
1904
- "atributes" : {}
2045
+ "attributes" : {
2046
+ "type" : " object" ,
2047
+ "additionalProperties" : true
2048
+ }
1905
2049
}
1906
2050
},
1907
2051
"Attribute" : {
1935
2079
"uniqueId" : {
1936
2080
"type" : " string"
1937
2081
},
1938
- "atributes" : {}
2082
+ "attributes" : {
2083
+ "type" : " object" ,
2084
+ "additionalProperties" : true
2085
+ }
2086
+ }
2087
+ },
2088
+ "Maintenance" : {
2089
+ "properties" : {
2090
+ "id" : {
2091
+ "type" : " integer"
2092
+ },
2093
+ "name" : {
2094
+ "type" : " string"
2095
+ },
2096
+ "type" : {
2097
+ "type" : " string"
2098
+ },
2099
+ "start" : {
2100
+ "type" : " number"
2101
+ },
2102
+ "period" : {
2103
+ "type" : " number"
2104
+ },
2105
+ "attributes" : {
2106
+ "type" : " object" ,
2107
+ "additionalProperties" : true
2108
+ }
1939
2109
}
1940
2110
}
1941
2111
},
2056
2226
"$ref" : " #/definitions/Notification"
2057
2227
}
2058
2228
},
2229
+ "Maintenance" : {
2230
+ "name" : " body" ,
2231
+ "in" : " body" ,
2232
+ "required" : true ,
2233
+ "schema" : {
2234
+ "$ref" : " #/definitions/Maintenance"
2235
+ }
2236
+ },
2059
2237
"deviceIdArray" : {
2060
2238
"name" : " deviceId" ,
2061
2239
"in" : " query" ,
2097
2275
"description" : " Basic HTTP authorization with _email_ and _password_"
2098
2276
}
2099
2277
}
2100
- }
2278
+ }
0 commit comments