API IDTRACK
- Create token
METHODE : POST
URL: http://server-gps.com:8082/login/create_token
Body: sesuai user password yang telah dbuat
{“Username”:”demo@server-gps.com”, “Password”:”1234″}
Result:
{
“access_token”: “eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MDA1ODQwMzYsInVzZXJfaWQiOjYyfQ.RwhxSUJ2xTWHYr28-TMv_vNGl4M_S9LL2VespDx9gMU”,
“code”: 200,
“expire”: “2020-03-09T09:15:12+07:00”,
“login_type”: “login”,
“refresh_token”: “eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MDA1ODQwMzYsInVzZXJfaWQiOjYyfQ.RwhxSUJ2xTWHYr28-TMv_vNGl4M_S9LL2VespDx9gMU”
}
- List Device/truk
Method : GET
FORMAT : http://server.gpsku.co.id:8082/api/device?apikey=[API_KEY]
RESULT :
[
{
“DeviceID”: 4210,
“Nopol”: “B2152BZP”
},
{
“DeviceID”: 4211,
“Nopol”: “B9169BCE”
},
{
“DeviceID”: 4212,
“Nopol”: “B9347BCR”
}
]
- List Marker POI
Methode: GET
Result :
[
{
“IDMarker”: 115,
“Name”: “Lotte Avenue”,
“Address”: “”,
“Lat”: -6.224055,
“Lng”: 106.82308,
“IconPoi”: “47.png”,
“PoiGrupID”: 0,
“AreaID”: 0
},
{
“IDMarker”: 114,
“Name”: “Kota Kasablanka”,
“Address”: “”,
“Lat”: -6.2235756,
“Lng”: 106.84268,
“IconPoi”: “47.png”,
“PoiGrupID”: 0,
“AreaID”: 0
}
]
- Set SPJ to Device
METHODE: POST
BODY :
{
“DeviceID”: 115,
“PickupMarkerID”: 99,
“DestinationMarkerID”: 100,
“PickupDate”: “2019-03-10T07:00:00+07:00”,
“Driver”: “Arif Raharjo”,
“NomorSurat”: “7403-ZLF-83324894”,
“UrlCallback”: “http://domainAnda.com/……..”
}
- Callback Status SPJ
Update status ketika truck sudah sampai di destination marker
METHODE: POST
URL : Sesui dengan UrlCallback (ini merupakan Server API milik anda sendiri)
BODY :
{
“DeviceID”: 115,
“NomorSurat”: “7403-ZLF-83324894”,
“DestinationMarkerID”: 100,
“DestinationMarkerInDate”: “2019-03-25T07:00:00+07:00”
}
RESULT
OK
- Show Device Position
Mencari posisi truk berdasarkan DeviceID
Methode: GET
Parameter : Device ID
RESULT:
{
“DeviceID”: 4210,
“Imei”: “864180030920172”,
“Nopol”: “B2152BZP”,
“DriverName”: “RAHARJO”,
“DestinationMarkerID”: 100,
“Address”: “Jl. Bambu no 46 Yogyakarta”,
“LastUpdatePostionDate”: “2017-10-01T10:22:37+07:00”
}
- List Device Status ONLINE/OFFLINE
Melihat semua truk dengan kondisi online/offline
Methode: GET
RESULT:
[
{
“ID”: 1781,
“Nama”: “USER
“,
“Devices”: [
{
“DeviceID”: 4210,
“Imei”: “864180030920172”,
“Phone”: “081139xxxxx”,
“Nopol”: “B2152BZP”,
“Icon”: “http://server-gps.com/images/gps/mobil2/0-on.png”,
“LastUpdate”: “2018-10-04T10:17:33+07:00”,
“Latitude”: -6.30489,
“Longitude”: 106.64405,
“Direction”: 90,
“Status”: “EXPIRED”
},
{
“DeviceID”: 4211,
“Imei”: “864180030888940”,
“Phone”: “08119837xxxxx”,
“Nopol”: “B9169BCE”,
“DriverName”: “”,
“Icon”: “http://server-gps.com/images/gps/mobil2/0-on.png”,
“LastUpdate”: “2018-10-03T16:21:50+07:00”,
“Latitude”: -6.1650515,
“Longitude”: 106.82367,
“Direction”: 0,
“Status”: “ACTIVE”
},
{
“DeviceID”: 4212,
“Imei”: “864180036279391”,
“Phone”: “982374xxxx4”,
“Nopol”: “B9347BCR”,
“DriverName”: “”,
“Icon”: “http://server-gps.com/images/gps/mobil2/90-on.png”,
“LastUpdate”: “2018-10-03T14:18:23+07:00”,
“Latitude”: -6.163515,
“Longitude”: 106.821754,
“Direction”: 96,
“Status”: “NOT UPDATE”
}
]
}
]