Description:

  • Get current battery status,date and time,latitude and longitude

Version:

Ver. Maker Established Date Revision Date
1.0.0 lenny 2021-12-31

Request URL:

Request Method:

  • POST

Request Header:

Parameter Name Whether Must Type Instructions
Content-Type Yes string Request Type: x-www-form-urlencoded

Request Parameter:

Parameter Name Whether Must Type Instructions
gpsLockNo Yes string asset ID
fTokenID Yes string Token

Return Example:

Return when correct:

{
    "Result": 200,
    "Message": null,
    "FObject": {
        "GPSLockNo": "207010199999",
        "Battery": 57,
        "Latitude": 22.580979,
        "Longitude": 113.916719,
        "LocationType": 1,
        "LockStatus": 1,
        "GPSTime": "2021-08-23T02:09:39",
        "RecvTime": "2021-08-23T02:10:01.4764541Z",
        "Speed": 0,
        "Direction": 0,
        "Address": "创业二路, Bao'an District, Shenzhen City, Guangdong, 518100, PRC"
    }
}

Return on error:

{
    "Result": 105,
    "Message": "Fail:tripId is null",
    "FObject": null
}

{
    "Result": 105,
    "Message": "Fail:without this trip ID",
    "FObject": null
}

{
    "Result": 105,
    "Message": "Fail:token error or timeout",
    "FObject": null
}

Return Parameter Description:

TrackInfoList

Parameter Name Type Instructions
GPSLockNo String Asset ID
Battery Int Battery
Latitude Float Latitude
Longitude Float Longitude
LocationType Int LocationType 1:Satellite 2:LBS 3:Cell 4:Phone 0:Unlocated
LockStatus Int LockStatus(1:open;0:close)
GPSTime DateTime Satellite Time(UTC)
RecvTime DateTime Receive Time(UTC)
Speed Int Speed
Direction Int Direction 1: N 2:NE 3:E 4:SE 5:S 6:SW 7:W 8:NW Other:N
Address String Address

Request Example:

String result = "";
//request url
String url ="http://icloud.assetscontrols.com:8092/api/AscentPH/GetCurrentDeviceInfo?gpsLockNo=207010199999&FTokenID=DB7F20D9-84C3-44C3-B05A-06A9C392A189";
//Create post request object
  HttpPost post = new HttpPost(url);
 CloseableHttpClient client = HttpClients.createDefault();
 //Start the execution request and get the return value
 HttpResponse response = client.execute(post);
 //Get the returned entity object
HttpEntity entity = response.getEntity();
//Convert entity object to string
String result = EntityUtils.toString(entity, "UTF-8");
 return result;
文档更新时间: 2023-02-06 16:05   作者:刘家帅