Contents

The navigation on the left serves as the table of contents for this documentation.

Overview

Benefit of TTS Open API, distributor or application vendor could provide tracking service to customers by calling the API and use your own GUI client, App or Website, this might improve the localization or user experience.

Your App or web client should connect to your application server, rather than connect to TTS API Server directly , use your application server connect to TTS Server instead.

Usage

  1. Contact us to apply your appKey and appSecrect, you need to provide your account.
  2. According to this document to implement your application server to obtain access_token.
  3. Calling other interfaces with access_token to fulfil your business logic.

Conventions

Encoding, format & Timezone

UTF-8 and JSON is used by default.

Context-Type: default application/json charset=utf-8

The API use UTC (GMT +0)time in default: format yyyy-MM-dd HH:mm:ss

Common response fields

Key Type Required Description
code int Yes result code
message string No Description

Result code description

Code Value Description
-1 -1 The system is busy
0 0 success
1XXX 1001 Parameter error (lack of required parameters or format error). See interface description for details
1002 Illegal user/illegal device (not their own or subordinate account or device)
1003 Repeat operation
1004 Illegal access, token exception! (Token failure or nonexistent)
1005 Illegal access, IP access exceeds limit!
1006 Illegal access, too frequently request!
1007 Illegal access, request method error!
1008 Illegal access, abnormal incoming!
12001 Platform account creation failed
12002 Device transfer failed
12003 Geo-fence creation failed
12004 Geo-fence deletion failed
12005 Fail to send command

Error code:

Code Value Description
Create account 213 Account already exist
214 Account does not exist
215 User type error. Possible reasons: 1. User type is empty; 2. User type does not exist; 3.
Current login user does not have permission to create new type of user.
Device transfer 217 Target user does not exist
218 User can only transfer/sale devices to sub-account
219 IMEI list is illegal
220 Number of IMEI exceeds limitation.
Geo-fence 41001 Exceed max number of Geo-fences supported
41002 Fence name is already exists
41003 The device is not online
41004 Geo-fence operation failed
Command 225 time out
226 Parameter error
227 The command is not executed correctly
228 The device is not online
229 Network error, connection error, etc.
238 Device interrupted
240 Data format error
243 Not supported by device
252 The device is busy

Work Flow

API Work Flow

API Features

Interface Type Method Description
Access token tts.oauth.token.get Get access_token.
tts.oauth.token.refresh Refresh access_token.
User API tts.user.child.list List all sub-account.
tts.user.device.list List all devices of current account.
tts.user.child.create Create sub-account
tts.user.child.del Remove sub-account
tts.user.child.move Move sub-account to another account.
tts.track.device.detail Get device detail information for specific IMEI
tts.user.device.location.list Get the latest location for all devices.
Device API tts.device.location.get Get the latest location data for specific IMEI.
tts.device.location.URL.share Get URL for showing location on the Map.
tts.user.device.expiration.update Change user expiration date for devices
tts.device.track.list Obtain track data according to IMEI.
tts.device.track.mileage Get mileage report for devices.
tts.open.device.update Modify the vehicle information for device.
tts.device.media.URL Get URL of photo or video capture by camera.
tts.device.live.page.url Get device live streaming page URL
Command API tts.open.instruction.list Gets commands supported by the device.
tts.open.instruction.send Send command to device.
tts.open.instruction.result Get the command result.
tts.open.instruction.raw.send Send raw command data to device
tts.open.instruction.raw.receive TTS push raw data to specified client’s server URL.
tts.device.meida.cmd.send Send media instruction
Geo-fence API tts.open.device.fence.delete Remove the Geo fence for the device.
tts.open.device.fence.create Create an Geo fence for the device.
LBS-API tts.lbs.address.get Wi-Fi base station location analysis.
Message tts.push.device.alarm Push alarm notification.
tts.device.alarm.list Get alarm list for device
Scooter API
(Deprecated)
tts.scooter.instruction.send Send command to scooter device.
tts.scooter.device.detail Get scooter status and other detail information.

API Description

Request URL

The unique request URL is:

https://openapi-tts-tracker.tanaka-tracker-system.jp/route/rest

Security

Client should get access_token first before calling the interface, which is generated by TTS Server by calling tts.oauth.token.get interface(method=tts.oauth.token.get) with provided appKey and appSecrect.

appKey and access_token are required to sign request parameters when calling API. TTS server will validate the the request parameters by checking the sign value.

Common Parameters

The parameters of each request should include common parameters and interface private parameters. For example, if you call the “tts.oauth.token.get” interface, you need to provide:

7(common parameters) + 3(private parameters) = 10 (parameters, key/value)

Following are the common parameters:

Name Type Required Description Remark Default
method string Yes API interface name
timestamp string Yes Timestamp, format: yyyy-MM-dd HH:mm:ss. Plus or minus 10 minutes is allowed. e.g: 2012-03-25 20:00:00 GMT(UTC) time.
app_key string Yes appKey from TTS
sign string Yes A signature based on parameters, appKey, appSecrect.
sign_method string Yes Optional, signature method. Available value: md5 md5 md5
v string Yes Optional, specify the API version. System default 1.0, support version: 0.9, 1.0 0.9: no signature checking
1.0: check signature
format string Yes Optional, specify response format. json

The parameter V uses a difference of 0.9 and 1.0:

  • Using 0.9 will not perform Sign signature verification
  • Using 1.0 will verify the Sign signature

Function description of Sign signature verification: The data receiving end gets the transmission text, but needs to confirm whether the text is the content sent by the sender, and whether it has been tampered with in the middle. Therefore, the receiver uses its own public key to decrypt the signature and obtains the digest of the text, then uses the same method as the sender to calculate the digest value of the text, and compares it with the decrypted digest, and finds that the two are exactly the same. It means that the text has not been tampered with.

Signature

To protect API calling from hacked, any API calling needs to be with a signature. TTS server will check signature based on request parameters. Illegal signature request will be rejected. Signature algorithms supported is: md5 (sign_method is a common parameter mentioned above).

Following is the algorithm of signature:

  1. Sort all request parameters with parameter key in alphabetical order (including common parameters and method specific parameters, but NOT include sign and byte type parameter).

    For example:
    foo=1, bar=2, foo_bar=3, foobar=4
    Result:
    bar=2, foo=1, foo_bar=3, foobar=4
  2. Remove all equal sign and comma:
    bar2foo1foo_bar3foobar4
  3. Then concatenate appSecrect to the before and end of the result string and get the md5 value. E.g:
    md5(appSecrect+bar2foo1foo_bar3foobar4+appSecrect)
    like:
    md5(h9lri085eachcz4sn7gwnkh6j0jt0yz4bar2foo1foo_bar3foobar4h9lri085eachcz4sn7gwnkh6j0jt0yz4)
    Note that the string should be in UTF-8 encoding.
    Note that the sign should be upper case string.
  4. If the parameter value is a byte stream, it should be converted to hexadecimal. For example:
    hex(“helloworld”.getBytes(“utf-8”)) = “68656C6C6F776F726C64”
  5. MD5 is the 128-bit summary algorithm and is in hexadecimal. A hexadecimal character can represent four bits, so the signature string length is 32 hexadecimal characters.

JAVA example:
Algorithm

public static String signTopRequest(Map<String, String> params, String seccode, String signMethod) throws IOException {
    // 1: sort parameter key
    String[] keys = params.keySet().toArray(new String[0]);
    Arrays.sort(keys);

    // 2: put all parameter names and parameter values together
    StringBuilder query = new StringBuilder();
    if (Constants.SIGN_METHOD_MD5.equals(signMethod)) {
        query.append(seccode);
    }

    for (String key : keys) {
        String value = params.get(key);
        if (StringUtils.areNotEmpty(key, value)) {
            query.append(key).append(value);
        }
    }

    // 3: use MD5/HMAC to encrypt
    byte[] bytes;
    if (Constants.SIGN_METHOD_HMAC.equals(signMethod)) {
        bytes = encryptHMAC(query.toString(), seccode);
    } else {
        query.append(seccode);
        bytes = encryptMD5(query.toString());
    }

    // 4: convert binary to uppercase hexadecimal
    return byte2hex(bytes);
}

public static byte[] encryptHMAC(String data, String seccode) throws IOException {
    byte[] bytes = null;
    try {
        seccodeKey seccodeKey = new seccodeKeySpec(seccode.getBytes(Constants.CHARSET_UTF8), "HmacMD5");
        Mac mac = Mac.getInstance(seccodeKey.getAlgorithm());
        mac.init(seccodeKey);
        bytes = mac.doFinal(data.getBytes(Constants.CHARSET_UTF8));
    } catch (GeneralSecurityException gse) {
        throw new IOException(gse.toString());
    }
    return bytes;
}

public static byte[] encryptMD5(String data) throws IOException {
    return encryptMD5(data.getBytes(Constants.CHARSET_UTF8));
}

public static String byte2hex(byte[] bytes) {
    StringBuilder sign = new StringBuilder();
    for (int i = 0; i < bytes.length; i++) {
        String hex = Integer.toHexString(bytes[i] & 0xFF);
        if (hex.length() == 1) {
            sign.append("0");
        }
        sign.append(hex.toUpperCase());
    }
    return sign.toString();
}

Get Access Token

Description

Client(distributor’s server) should stored the access_token locally, do NOT get access_token per request, instead, use the local access_token before it become invalid. TTS server will not allow to access if the request frequency is too high from client.

The access token can be used for about 2 hours(depend on the value for expires_in parameter), do NOT try to get token for every request.

Request URL

See the unique request URL.
Method: tts.oauth.token.get

HTTP request method

POST

Request parameter

  • (1)Common parameters
  • (2)Private parameters as follow:
Name Type Required Description Remark Default
user_id String Yes User ID User’s account
user_pwd_md5 String Yes user’s password (md5) lowercase md5 value.
expires_in number Yes access token expired seconds. 60–7200

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result String Result
Key Type Description
accessToken string Access token, required by any other following interfaces.
expiresIn string Access token expired seconds.
account string User’s account.
appKey string AppKey from TTS.
refreshToken string Refresh token, which is used for updating accessToken
time string Token generated time.

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": {
    "appKey": "8FB345B8693CCD003CC2DAB61EC8791D",
    "account": "ttstest",
    "accessToken": "7da3330ec28e3996b6ef4a7e3390ba71",
    "expiresIn": 60,
    "refreshToken": "7da3330ec28e3996b6ef4a7e3390ba71",
    "time": "2017-06-15 10:00:00"
  }
}

Return error example:

{"code":xxx,"message":"Incorrect user name or password"}

Postman Demo

user_id = your account.
user_pwd_md5 = md5(your account password).
Sign = md5(<app_secrect>your alphabet ordered parameters keyvalue, without equal-sign, comma and not include sign field<app_secrect>).
Note that sign is a 32-length upper case string.

For example:

<app_secrect>app_key9FB345B8693CCD0054E44ADF99139409expires_in7200formatjsonmethodtts.oauth.token.getsign_methodmd5timestamp2017-09-28 01:55:00user_id<account>user_pwd_md5<password_md5>v1.0<app_secrect>

Refresh Access Token

Description

This interface is used to update token manually when access token is about to be invalid.

Request URL

See the unique request URL.
Method: tts.oauth.token.refresh

HTTP request method

POST

Request Parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Description Remark Default
access_token String YES Access token
refresh_token String YES Authorized refresh access token
expires_in number YES Access token expired seconds 60–7200

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string Result
Key Type Description
accessToken string Access token, required for subsequently interface access.
expiresIn string Access token expired seconds.
account string Requested account
appKey string From TTS
refreshToken string Refresh token for updating access token
time string Token generated time

Example for correct Response:

{
  "code": 0,
  "message": "success",
  "result": {
    "appKey": "8FB345B8693CCD003CC2DAB61EC8791D",
    "account": "ttstest",
    "accessToken": "7da3330ec28e3996b6ef4a7e3390ba71",
    "expiresIn": 60,
    "refreshToken": "7da3330ec28e3996b6ef4a7e3390ba71",
    "time": "2017-06-15 10:00:00"
  }
}

Return error example:

{"code":xxx,"message":"Illegal request,token is invalid"}

List all sub-account

Description

List all sub-account of a specified account.

Request URL

See the unique request URL.
Method: tts.user.child.create

HTTP request method

POST

Request Parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes - Access token for security access TTS Server.
target string Yes - The specified account for inquired.

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned parameters

Result

Key Type Description
account string Log in account
name string Name
type int Account Type
3: App user
8: Distributor
9: ordinary users
10: ordinary distributor
11: sales
displayFlag int Available or not (1: Available, 0: Not available)
address string Location
birth string Birthday
companyName string Company Name
email string Mailbox
phone string Contact number
language string Language (zh, en)
sex int Gender (0: Male, 1: Female)
enabledFlag int Flag: 1 Available, 0 Not available
remark string Remark

Correct return example

{
  "code": 0,
  "message": "success",
  "result": [
    {
      "account": "123123",
      "name": "test",
      "type": 8,
      "displayFlag": 1,
      "address": null,
      "birth": "2017-04-22 00:00:00",
      "companyName": "",
      "email": "",
      "phone": "",
      "language": "zh",
      "sex": 0,
      "enabledFlag": 1,
      "remark": null
    }
  ]
}

Wrong return example

{"code":xxx,"message":"The account does not exist"}

create sub-account

description

create a sub-account of a specified account.

Request URL

See the unique request URL.
Method: tts.user.child.create

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters
Parameter Type Required Remark Description
access_token string yes - Access token for security access TTS Server.
super_account string no - The specified parent account. If not provided, use API account instead.
account_id string yes Account id, length of 3~30 characters. Support special characters like “_@.” as well as a-Z, 0-9.
nick_name string yes Nick name or customer name
account_type int yes 1-Distributor 2-End User 3-Sales
password string yes Password with md5.
telephone string no
email string yes User could retrieve password if forgot it.
contact_person string no
company_name string no
permissions string yes 6 permissions can be set:
・Web login
・App login
・Send command
・Set working mode
・Edit by web
・Edit by app
0-disable, 1-enable, 6 digital represents 6 kinds of permissions enable/disable perssion. for example, 111000

response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned parameters

Correct return example:

{
  "code": 0,
  "message": "Vehicle information modification successful",
  "result": null
}

Wrong return example:

{"code":xxx,"message":"The account does not exist"}

Remove sub-account

Description

Remove a sub-account of a specified account.

Request URL

See the unique request URL.
Method: tts.user.child.del

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters
Parameter Type Required Remark Description
access_token string Yes - Access token for security access TTS Server.
super_account string No - The specified parent account. If not provided, use API account instead.
account_id string Yes Account id, length of 3~30 characters. Support special characters like “_@.” as well as a-Z, 0-9.

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned parameters

Correct return example:

{
  "code": 0,
  "message": "Vehicle information modification successful",
  "result": null
}

Wrong return example:

{"code":xxx,"message":"no permissions"}

Move account

Description

Move account from one sub-account to another sub-account.

Request URL

See the unique request URL.
Method: tts.user.child.move

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters
Parameter Type Required Remark Description
access_token string Yes - Access token for security access TTS Server.
account string Yes - The account will be moved.
target_account string Yes The target account to move in.

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned parameters

Correct return example:

{
  "code": 0,
  "message": "Vehicle information modification successful",
  "result": null
}

Wrong return example:

{"code":xxx,"message":"no permissions"}

List all devices of sub-account

Description

Query all devices of a specified account.

Request URL

See the unique request URL.
Method: tts.user.device.list

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes Access token for security access TTS Server.
target string Yes - The specified account for inquired.

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data

Result:

Key Type Description
imei string Device IMEI
deviceName string Device name
mcType string Device model
mcTypeUseScope string Automobile, electromobile, personal, pet, plane, others
sim string Sim card number
expiration string Platform expiration date
activationTime string Activation time
reMark string Remarks
vehicleName string Vehicle name
vehicleIcon string Vehicle icon
vehicleNumber string License plate number
vehicleModels string Brand
carFrame string VIN
driverName string Driver name
driverPhone string Driver phone number
enabledFlag int Available or not (1:Available,0:not available)
engineNumber string Engine number
deviceGroupId string Device group ID
deviceGroup string Device group name

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": [
    {
      "imei": "868120145233604",
      "deviceName": "868120145233604",
      "mcType": "GT300L",
      "mcTypeUseScope": "personal",
      "sim": "415451",
      "expiration": "2037-04-01 23:59:59",
      "activationTime": "2017-04-01 11:02:20",
      "reMark": "test",
      "vehicleName": null,
      "vehicleIcon": "bus",
      "vehicleNumber": "粤B3604",
      "vehicleModels": null,
      "carFrame": "2235",
      "driverName": "driver",
      "driverPhone": "13825036579",
      "enabledFlag": 1,
      "engineNumber": "8565674",
      "deviceGroupId": "b54ab3c430864e31a64e54de44c79a1d",
      "deviceGroup": "default group"
    }
  ]
}

Return error example:

{"code":xxx,"message":"Account queried doesn’t exist"}

Get device detail information

Description

Get device detail information for specific IMEI.

Request URL

See the unique request URL.
Method: tts.track.device.detail

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes Access token for security access TTS Server.
imei string Yes - The specified IMEI for inquired.

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data

Result:

Key Type Description
imei string Device IMEI
deviceName string Device name
account string The account the device belongs to
customerName string The customer name of the account that the device belongs to
mcType string Device model
mcTypeUseScope string Automobile, electromobile, personal, pet, plane, others
sim string Sim card number
expiration string Platform expiration date
user_expiration string User expiration date, format as: account1,2019-01-01|account2,2019-02-02
activationTime string Activation time
reMark string Remarks
vehicleName string Vehicle name
vehicleIcon string Vehicle icon
vehicleNumber string License plate number
vehicleModels string Vehicle Model
carFrame string VIN
driverName string Driver name
driverPhone string Driver phone number
enabledFlag int Available or not (1:Available,0:not available)
engineNumber string Engine number
iccid string
importTime string
imsi string
licensePlatNo string
vin string Vehicle frame number
vehicleBrand string
fuel_100km string Fuel consumption for per 100km.
status string 0-disable 1-enable
currentMileage string The current mileage of the device (km)
deviceGroupId string Device group ID
deviceGroup string Device group name

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": {
    "imei": "868120145233604",
    "deviceName": "868120145233604",
    "mcType": "GT300L",
    "mcTypeUseScope": "personal",
    "sim": "415451",
    "expiration": "2037-04-01 23:59:59",
    "activationTime": "2017-04-01 11:02:20",
    "reMark": "test",
    "vehicleName": null,
    "vehicleIcon": "bus",
    "vehicleNumber": "粤B3604",
    "vehicleModels": null,
    "carFrame": "2235",
    "driverName": "driver",
    "driverPhone": "13825036579",
    "enabledFlag": 1,
    "engineNumber": "8565674",
    "iccid": "xxxxxxx",
    "imsi": "xxxx",
    "importTime": "2017-04-01 11:02:20",
    "licensePlatNo": "8565674",
    "VIN": "xxxxxxx",
    "vehicleBrand": "xxxx",
    "fuel_100km": "9",
    "status": "8565674",
    "currentMileage": "102.5",
    "deviceGroupId": "b54ab3c430864e31a64e54de44c79a1d",
    "deviceGroup": "default group"
  }
}

Return error example:

{"code":xxx,"message":"Account queried doesn’t exist"}

Get location of devices by account

Description

Get the latest location for all devices under an account.

Request URL

See the unique request URL.
Method: tts.user.device.location.list

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters
Parameter Type Required Remark Description
access_token string Yes Access token for security access TTS Server.
target string Yes - Specify the account for inquired.
map_type string No - map_type=GOOGLE, calibrated by google calibration.
map_type=null, return origin latitude and longitude

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data

Result data:

Key Type Description
imei string Device IMEI
deviceName string Device name
icon string Vehicle icon
status string Device status 0 - offline; 1 - online
lat double Longitude (if the device is expired, the value is 0)
lng double Latitude (if the device is expired, the value is 0)
expireFlag string Expired or not: 1- not expired; 0 - expired
activationFlag string Activate or not :1 - Activate; 0 - Not active
posType string GPS, LBS, WIFI,BEACON
locDesc string Location information while the device is positioned by Bluetooth
gpsTime string GPS positioning time
hbTime string Heartbeat time
speed string Speed (unit: km / h)
accStatus string ACC 0-OFF; 1-ON
electQuantity string The power will be calculated based on the model configuration and voltage.
powerValue string External voltage(0-100), some models are not supported
distance string Distance from device.
temperature string Temperature (unit:℃)
trackerOil string Oil quantity of the car(Original voltage value)
gpsSignal string GSM signal strength level
0 - No signal
1 - Extremely weak
2 - Weak
3 - Strong
4 - Extremely strong
gpsNum string Number of satellites
direction string Moving azimuth angle, 0-360, -1 represents unknown, for example: 100.12
currentMileage string Current mileage
batteryPowerVal String Internal voltage

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": [
    {
      "imei": "868120145233604",
      "deviceName": "868120145233604",
      "icon": "bus",
      "status": "0",
      "posType": "GPS",
      "lat": 22.577282,
      "lng": 113.916604,
      "hbTime": "2017-04-26 09:14:50",
      "accStatus": "0",
      "speed": "0",
      "gpsTime": "2017-04-26 09:17:46",
      "activationFlag": "1",
      "expireFlag": "1",
      "electQuantity": "60",
      "locDesc": null,
      "powerValue": null,
      "temperature": "86.5",
      "trackerOil": null
    }
  ]
}

Wrong return example:

{"code":xxx,"message":"The account does not exist"}

Get the location of device(s)

Description

Get the latest location for one or multiple devices.

Request URL

See the unique request URL.
Method: tts.device.location.get

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters
Parameter Type Required Remark Description
access_token string Yes access token: used to security access TTS server.
imeis string Yes _ Device IMEI. Separate imei by comma; POST is recommended if too many devices (maximum 100 IMEI)
map_type string No _ map_type=GOOGLE, calibrated by google calibration.
map_type=null, return origin latitude and longitude

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data

Result list:

Key Type Description
imei string Device IMEI
deviceName string Device name
account string The account the device belongs to
customerName string The customer name of the account that the device belongs to
icon string Vehicle icon
status string Device status 0, offline; 1, online
lat double Longitude (if the device expires, the value is 0)
lng double Latitude (if the device expires, the value is 0)
expireFlag string 1- not expired; 0 - expired
activationFlag string 1 - Activate; 0 - Not active
posType string GPS, LBS, WIFI, BEACON
locDesc string Location information
gpsTime string GPS positioning time
hbTime string Heartbeat time
speed string Speed (unit: km / h)
accStatus string ACC 0- off ;1- on
batteryPowerVal string battery(0-100), Some device models are not supported
powerValue string External voltage(0-100), Some device models are not supported
distance string distance from device.
temperature string temperature (unit:℃)
trackerOil string Vehicle remaining fuel
currentMileage string The current mileage of the device (km)
gpsNum string Number of satellites
gpsSignal string GSM signal strength level:
0 - No signal
1 - Extremely weak
2 - Weak
3 - Strong
4 - Extremely strong
direction string Moving azimuth angle, 0-360, -1 represents unknown, for example: 100.12
electQuantity string The power will be calculated based on the model configuration and voltage.

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": [
    {
      "imei": "868120145233604",
      "deviceName": "868120145233604",
      "icon": "bus",
      "status": "0",
      "posType": "GPS",
      "lat": 22.577282,
      "lng": 113.916604,
      "hbTime": "2017-04-26 09:14:50",
      "accStatus": "0",
      "speed": "0",
      "gpsNum": "11",
      "gpsTime": "2017-04-26 09:17:46",
      "activationFlag": "1",
      "expireFlag": "1",
      "electQuantity": "60",
      "locDesc": null,
      "powerValue": null,
      "temperature": "86.5",
      "trackerOil": null,
      "currentMileage": "86.5"
    }
  ]
}

Wrong return example:

{"code":xxx,"message":"Illegal device"}

Get sharing location URL

Description

Get the URL of device location showing on the Map.

Request URL

See the unique request URL.
Method: tts.device.location.URL.share

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters
Parameter Type Required Remark Description
access_token string Yes access token: used to security access TTS server.
imei string Yes _ Device IMEI

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data contains URL information.

result Object:

Key Type Description
URL string Device location sharing link

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": {
    "URL": "data.16180track.com/api/share?ver=2&method=trackDevice_abr&deviceinfo=7ae7c62385f2067f164002db315854a969a40e3888021cb01dc8f2183ca08dbbd8581f6bb86df4c2e3e1b887cb67c21039b4c0ced18fdf8dd08e0460c5edd13ad87e16dca9702ce6"
  }
}

Wrong return example:

{"code":xxx,"message":"Illegal device"}

Update user expiration date

Description

Update user expiration date of devices.

Request URL

See the unique request URL.
Method: tts.user.device.expiration.update

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters
Parameter Type Required Remark Description
access_token string Yes access token: used to security access TTS server.
imei_list string Yes - One or multiple devices IMEI.
new_expiration string Yes New user expiration date for devices.

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data

result list:

Key Type Description
imei string IMEI of device
update_result string 0-success, 1-failure
update_msg string Result information, success and failure reasons

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": [
    {
      "imei": "868120145233604",
      "update_result": "0",
      "update_msg": "update success"
    },
    {
      "imei": "868120145233605",
      "update_result": "1",
      "update_msg": "update failed, reason:xxxxxx"
    }
  ]
}

Wrong return example:

{"code":xxx,"message":"Illegal device"}

Get the mileage data of devices

Description

Get device(s) trips data of specified time range.

Request URL

See the unique request URL.
Method: tts.device.track.mileage

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes - Access token: used to identify legal client.
imeis string Yes - Device imeis, separate by comma.
begin_time number Yes - Start time
Format: yyyy-MM-dd HH:mm:ss
end_time number Yes - End time
Format: yyyy-MM-dd HH:mm:ss
end_time should be earlier than current time
start_row number No - Row number of result set.
page_size number No Records in one page.

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data
data string Summary information:
IMEI :IMEI of device
totalMileage:The sum of the total mileage of all trips made by the device within the specified time period

result list:

Key Type Description
imei string IMEI of device
startTime string Start time
endTime string End time
startLat string Latitude of start position.
startLng string Longitude of start position.
endLat string Latitude of end position.
endLng string Longitude of end position.
runTimeSecond int Second of elapsed between start and end position.
distance double Distance(meter) between start and end position.
avgSpeed double Average speed

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": [
    {
      "imei": "3505831983422342",
      "startTime": "2017-04-26 00:00:58",
      "endTime": "2017-04-26 00:03:58",
      "startLat": 22.577144898887813,
      "startLng": 113.91674845964586,
      "endLat": 22.677144898887813,
      "endLng": 113.92674845964586,
      "elapsed": 2130,
      "distance": 25000,
      "avgSpeed": 90
    },
    {
      "imei": "3505831983422342",
      "startTime": "2017-04-26 00:00:58",
      "endTime": "2017-04-26 00:03:58",
      "startLat": 22.577144898887813,
      "startLng": 113.91674845964586,
      "endLat": 22.677144898887813,
      "endLng": 113.92674845964586,
      "elapsed": 2130,
      "distance": 25000,
      "avgSpeed": 90
    }
  ],
  "data": [
    {
      "imei": "3505831983422342",
      "totalMileage": 60000
    },
    {
      "imei": "3505831983422342",
      "totalMileage": 60000
    }
  ]
}

Get the track data of device

Description

Get device track data of not more than 7 days, within 3 months.

Request URL

See the unique request URL.
Method: tts.device.track.list

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes - Access token: used to identify legal client.
imei string Yes - Device imei( only 1 each time)
begin_time number Yes - Start time
Format: yyyy-MM-dd HH:mm:ss
end_time number Yes - End time
Format: yyyy-MM-dd HH:mm:ss
end_time should be earlier than current time
map_type string No - map_type=GOOGLE, calibrated by google calibration.
map_type=null, return origin latitude and longitude

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result object The returned data
data object The returned data

result list:

Key Type Description
lng double longitude
lat double latitude
gpsTime string GPS positioning time. Format yyyy-MM-dd HH: mm: ss
direction string Direction, polar coordinates started from due north
gpsSpeed string GPS speed
posType string 1-GPS, 2-LBS, 3-WIFI
satellite string GPS antenna signal strength
ignition string Ignition status;ON-ACC ON, OFF-ACC OFF
accStatus string Acc status

data list:

Key Type Description
mileage string The mileage of the track within the query time

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": [
    {
      "lat": 22.577144898887813,
      "lng": 113.91674845964586,
      "gpsTime": "2017-04-26 00:00:58",
      "direction": 0,
      "gpsSpeed": -1,
      "posType": 3,
      "satellite": 0,
      "ignition": "ON",
      "accStatus": "ON"
    },
    {
      "lat": 22.57708,
      "lng": 113.916631,
      "gpsTime": "2017-04-26 00:01:30",
      "direction": 184,
      "gpsSpeed": 0,
      "posType": 1,
      "satellite": 0,
      "ignition": "ON",
      "accStatus": "ON"
    }
  ],
  "data": {
    "mileage": 0
  }
}

Return error example:

{"code":xxx,"message":"IMEI does not exist{353419031939627}"}
{"code":xxx,"message":"The device has expired{353419031939627}"}

Update vehicle information by IMEI

Description

Update vehicle information by IMEI

Request URL

See the unique request URL.
Method: tts.open.device.update

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes Access token: used to identify legal client.
imei string Yes - Device IMEI
device_name string No - Device name
vehicle_name string No - Vehicle name
vehicle_icon string No - Vehicle icon
vehicle_number string No - Vehicle plate number
vehicle_models string No - Vehicle brand
driver_name string No - Driver name
driver_phone string No - Driver phone
device_status string No 0 - disable/1-enable. Enable/Disable devices.
sim string No SIM card number
remarks string No Remarks
oilWear string No Fuel consumption per 100 kilometers
deviceGroupId string No Device group id

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data

Correct return example:

{
  "code": 0,
  "message": "Vehicle information modification successful",
  "result": null
}

Wrong return example:

{"code":xxx,"message":"imei doesn’t exists"}

Vehicle Icon

Icon key Description
automobile Car
bus Bus
per People
mtc Motorcycle
truck
taxi
plane
schoolBus
excavator
ship
tricycle
policeMtc Police Motorcycle
tractor
policeCar
cow
other

Get Device Photo or Video URL

Description

Get device photo or video URL which capture by camera.

REMARK: ONLY GET THE VIDEO OR PHOTO WHICH CREATED BY REMOTE COMMAND.
TO GET ALL TYPE PHOTO OR VIDEO, PLEASE USE 7.38 API

Request URL

See the unique request URL.
Method: tts.device.media.URL

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes Access token: used to identify legal client.
imei string Yes - Device IMEI
camera string Yes 1-front 2-inward 3 both
media_type string Yes 1-photo 2-video 3-both
start_time date No Start time of photo or video created.
end_time date No End time of photo or video created.
token string No Token used to validate whether can access photo or video or not.
page_no int No Zero indexed, 0 by default.
page_size int No 10 rows by default.

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data,could be multiple rows.

result list:

Key Type Description
thumb_URL string URL of video or photo thumbnail.
file_URL string URL of video or photo.
mime_type string Mime type of video or photo
create_time date Create time of video or photo.
alarm_time date Time when the alarm occurred
media_type string 1-photo 2-video
camera string 0-front camera 1-inward camera
file_size int File size of photo or video.

Correct return example:

{
  "code": 0,
  "message": "Operation successful",
  "result": [
    {
      "thumb_URL": "Q9GLAFFqfCrYF6YfQAcON4w4Ezs=/lhWse7ie3wtFrjuQZ22dLAk5CSaR",
      "file_URL": "357730090345670_3949477_2019_04_29_12_32_38_01",
      "mime_type": "video/mp4",
      "create_time": "2019-04-29 10:32:43",
      "media_type": 2,
      "camera": 1,
      "file_size": 9949087
    },
    {
      "thumb_URL": "Q9GLAFFqfCrYF6YfQAcON4w4Ezs=/FhCrZEIy3518sR_ylOlqDg7w3Ju-",
      "file_URL": "351609080120911_3949476_2019_04_29_18_32_12",
      "mime_type": "video/3gpp",
      "create_time": "2019-04-29 10:32:42",
      "media_type": 2,
      "camera": 1,
      "file_size": 2411318
    }
  ]
}

Wrong return example:

{"code":xxx,"message":"imei doesn’t exists"}

Get Device Live Steaming Page URL

Description

Get device live streaming page URL & last position information.

Request URL

See the unique request URL.
Method: tts.device.live.page.url

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes Access token: used to identify legal client.
imei string Yes - Device IMEI
type string No Default type=1 Type=1 real-time video
Type=2 Historical video
voice string No Default 1 0 is disable; 1 is enable

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result String The returned data

result object:

Key Type Description
lng double longitude
lat double latitude
gpsTime string GPS positioning time. Format yyyy-MM-dd HH: mm: ss
direction string Direction, polar coordinates started from due north
gpsSpeed string GPS speed
posType string 1-GPS, 2-LBS, 3-WIFI
satellite string GPS antenna signal strength
VIN string VIN
plateNo string License Plate Number
UrlCamera string Live streaming page URL

Correct return example:

{
  "code": 0,
  "message": "Vehicle information modification successful",
  "result": {
    "lat": 22.577144898887813,
    "lng": 113.91674845964586,
    "gpsTime": "2017-04-26 00:00:58",
    "direction": 0,
    "gpsSpeed": -1,
    "posType": 3,
    "satellite": 11,
    "VIN": "V12345",
    "plateNo": "ABC-12345",
    "UrlCamera": "https://www.domain.com/device/video/35408343202342345"
  }
}

Wrong return example:

{"code":xxx,"message":"imei doesn’t exists"}

Wi-Fi, Base Station locating analysis

Description

Allocate by total devices under the account (10 times/day/device. All sub-accounts included)

Request URL

See the unique request URL.
Method: tts.lbs.address.get

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes access token: used to identify legal client.
imei number Yes - Device Imei
lbs number No - (wifi/LBS: at least one)
LBS information group (mcc,mnc,lac,cell,rssi), max 7.
Each group has five, which should not be null and sorted in order.
MCC, China: 460
MNC
LAC information, 2312 23222
CELL code: 23222
RSSI Semaphore-70
wifi string No - (wifi/LBS: at least one)
mac1,rssi1| mac2,rssi2
Mac address, no colon in between.
Rssi signal strength

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data

Result list:

Key Type Description
lng string longitude
lat string latitude
accuracy string Accuracy, the greater the value the better

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": {
    "lat": 40.65615416521587,
    "lng": 109.89894039833524,
    "accuracy": 0
  }
}

Wrong return example:

{"code":xxx,"message":"illegal device"}

Create Geo-fence for IMEI

Description

Create Geo-fence for IMEI

Request URL

See the unique request URL.
Method: tts.open.device.fence.create

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes accesstoken: used for identifying legal third party
imei string Yes - Device Imei
fence_name string Yes - Geo-fence name
alarm_type string Yes - Alarm type (in / out / in, out)
report_mode string Yes - Alarm reporting mode, 0: GPRS,1: SMS+GPRS
alarm_switch string Yes - Fence alarm switch(ON/OFF)
lng string Yes - Longitude
lat string Yes - latitude
radius string Yes - Fence radius(1~9999;unit: 100 meters)
zoom_level string Yes - Zoom level (3-19)
map_type string Yes - Map (GOOGLE)

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data. Fence serial number returned if succeed.

Correct return example:

{
  "code": 0,
  "message": "Successfully create geo-fence.",
  "result": "5"
}

Wrong return example:

{
  "code": 41003,
  "message": "Device is not online, geo-fence creation failed ",
  "result": null
}

Delete Geo-fence for device

Description

Delete Geo-fence for device.

Request URL

See the unique request URL.
Method: tts.open.device.fence.delete

HTTP request method

POST

Request parameters

(1)Common parameters

(2)Private parameters

Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
imei string Yes - Device imei
instruct_no string Yes - Geo-fence command serial number

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data

correct return example:

{
  "code": 0,
  "message": "delete the geo-fence successfully",
  "result": null
}

return error example:

{
  "code": 41003,
  "message": "The device is not online and geo-fence can’t be deleted",
  "result": null
}

Get command list supported by device

Description

Get command list supported by device

Request URL

See the unique request URL.
Method: tts.open.instruction.list

HTTP request method

POST

Request parameters

(1)Common parameters

(2)Private parameters

Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
imei string Yes - Device imei

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned parameters

Result list

Key Type Description
id string Command code
orderName string Command name
orderContent string Command template
orderExplain string Command explanation
orderMsg string prompt
isOffLine string if support offline command 0-no; 1-yes

correct return example:

{
  "code": 0,
  "message": "success",
  "result": [
    {
      "id": 81,
      "orderName": "SOS setting",
      "orderContent": "SOS,A,{0},{1},{2}#",
      "orderExplain": "SOS is used for receive alerts and SOS alerts. SOS number should have 3-20 numbers.",
      "orderMsg": "",
      "isOffLine": "1"
    }
  ]
}

return error example:

{
  "code":xxx,
  "message":"Illegal device"
}

Send command to device

Description

Send command to device.

Request URL

See the unique request URL.
Method: tts.open.instruction.send

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters
Parameter Type Required Remark Description
access_token string Yes accesstoken: used for identifying legal third party
imei string Yes - Device imei
inst_param_json string Yes - Command message json character string

inst_param_json description

Parameter Type Required Remark Description
inst_id string Yes Command code
inst_template string Yes - Command template
params Array<string> Yes - Command params string Array
is_cover Boolean No false true-cover / false-not cover

Example:

{"inst_id": "113","inst_template":"RELAY,1#","params":[],"is_cover":"true"}
{"inst_id": "114","inst_template":"RELAY,0#","params":[],"is_cover":"true"}

Example:

{"inst_id": "96","inst_template":"{0}","params":["STATUS#"],"is_cover":"true"}

Response

Key Type Description
code int 0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned parameters

Correct return example:

{
  "code": 0,
  "message": "command is successfully sent.",
  "result": null
}

Return error example:

{
  "code": 12005,
  "message": "Fail to send command. Result code:226",
  "result": null
}

Get results of command execution

Description

Get results of sending command.

Request URL

See the unique request URL.
Method: tts.open.instruction.result

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes accesstoken: used for identifying legal third party
imei string Yes - Device imei

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data

Result list:

Key Type Description
codeId string Command code
code string Command sent
content string Content replied by device
isExecute string command status 0: execution failed, 1: successful execution, 3: to be sent, 4: canceled
sendTime string Time, format:yyyy-MM-dd HH:mm:ss
sender string sender
receiveDevice string Received imei
isOffLine string 0: online / 1: offline
idsource string Command description

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": [
    {
      "codeId": "99",
      "code": "status#",
      "content": "Parameter error",
      "isExecute": "4",
      "sendTime": "2017-06-19 11:46:00",
      "sender": "ttstest",
      "receiveDevice": "868120111111117",
      "isOffLine": "1",
      "idsource": "User-defined command"
    }
  ]
}

Return error example:

{"code":xxx,"message":"Illegal device"}

Send raw command data to device

Description

Send raw command to device.

Request URL

See the unique request URL.
Method: tts.open.instruction.raw.send

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters
Parameter Type Required Remark Description
access_token string Yes accesstoken: used for identifying legal third party
imei String Yes - Device imei
raw_cmd string Yes - Raw command data(hex string)

Raw Command Example:

0B02C3A405060708

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned parameters

Correct return example:

{
  "code": 0,
  "message": "command is successfully sent.",
  "result": null
}

Return error example:

{
  "code": 12005,
  "message": "Fail to send command. Result code:226",
  "result": null
}

Push Received Raw Data

Description

Third-party platform should provide an URL (same as messages push URL) to receive the raw data (please contact us and provide the URL manually), TTS server will push the raw data by sending a HTTP request using this URL.

Message service List

Message Type Description
tts.open.instruction.raw.receive Raw data receive message type, different from alarm message.

Request content

Key Type Description
msgType string Message type, corresponding to the message service list
data string The content of the message, corresponding to msgType

Message content ( tts.open.instruction.raw.receive )

Alarms pushed are as follows:

Key Type Description
imei string Device imei
deviceName string Device name
raw_data string raw data from device (hex string)

Example:

Parameter1:
Key = msgType
Value = tts.open.instruction.raw.receive

Parameter2:
Key = data
Value = {
  "imei": "868120145233604",
  "deviceName": "868120145233604",
  "raw_data": "0A0C0F01182E0101"
}

Send media instruction

Description

Send video or photo command to device.

Request URL

See the unique request URL.
Method: tts.device.meida.cmd.send

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters
Parameter Type Required Remark Description
access_token string Yes - Access token: used to identify legal client.
imei string Yes - Device IMEI
camera string Yes mediaType=1 Only limited 1 or 2 1-front camera, 2-inward camera, 3-front + inward camera
mediaType string Yes - 1 - photo, 2 - video
shootTime string No 0 or 3-10 mediaType=2 Recording duration 3-10

Response

Key Type Description
code int Return code:
0: Success
Other: failure. Refer to the error code description
Result JSON {"code":"100","data":"1.3.3","msg":"Communication successful response","cmdSeqNo":"1"}
Return code:
225: time out
226: Parameter error
227: The command is not executed correctly
228: The device is not online
229: Network error, connection error, etc.
238: Device interrupted
240: Data format error
message string Description of sending command result.

Success example:

{
  "code": 0,
  "message": "Operation successful",
  "result": {"code":"255","data":"1.3.3","msg":"通信成功响应","cmdSeqNo":"1"}
}

Exception example:

{
  "code": -1,
  "message": "Operation successful",
  "result": {"code":"228","data":"1.3.3","msg":"设备不在线","cmdSeqNo":"1"}
}

Receive Notification

Description

Third-party platform should provide an URL address to receive the notification (please contact us and provide the URL manually), TTS server will push the notification by sending a HTTP request using this URL.

Message service List

Message Type Description
tts.push.device.alarm Alarm data

Request content

Key Type Description
msgType string Message type, corresponding to the message service list
data string The content of the message, corresponding to msgType

Message content (tts.push.device.alarm)

Alarms pushed are as follows:

Key Type Description
imei string Device imei
deviceName string Device name
alarmType string Alarm type
alarmName string Alarm name
lat string Latitude
lng string Longitude
alarmTime string Alarm time, format (yyyy-MM-dd HH: mm: ss)

E.g:

Parameter1:
    Key = msgType
    Value = tts.push.device.alarm

Parameter2:
    Key = data
    Value = {
        "imei": "868120145233604",
        "deviceName": "868120145233604",
        "alarmType": "2",
        "alarmName": "Power off alarm",
        "lat": 40.65615416521587,
        "lng": 109.89894039833524,
        "alarmTime": "2017-05-08 12:00:00"
    }

Get device alarm list

Description

Get device alarm list.
Time range of searching criteria should be within 1 month.
Return maximum 1000 rows.

Request URL

See the unique request URL.
Method: tts.device.meida.cmd.send

HTTP request method

POST

Request parameters

  • Common parameters
  • Private parameters
Parameter Type Required Remark Description
access_token string Yes accesstoken: used for identifying legal third party
imei string Yes - Device imei. This field can be used when querying a single device.
alertTypeId string No If not specify alertTypeId, all alert type will return.
begin_time date No If not provide begin_time & end_time, returns latest 50 alerts of last 1 month.
end_time date No
imeis string Yes Device imei(s), separate by comma. Query single or multiple devices No more than 100 each time. Select one of the IMEI and IMEIS fields to fill in.
page_no int Yes >=1
default: 1
Page number
page_size int Yes 1-100
default: 50
Records in one page

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data

Result list:

Key Type Description
deviceName string Device Name
imei string IMEI
model string Device Model
account string Account
alertTypeId string Alert type ID
alertTypeName string Alert type name
alertTime string Alert time
positioningTime string Time of alert positioning
lng double longitude
lat double latitude
speed string speed
geoid string Fence ID

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": [
    {
      "deviceName": "ABC-34352",
      "imei": "343503422910345",
      "model": "GT06N",
      "account": "test1234",
      "alertTypeId": "1002",
      "alarmTypeName": "ACC On",
      "alertTime": "2019-03-14 14:02:03",
      "positioningTime": "2019-03-14 14:02:03",
      "lat": 22.577144898887813,
      "lng": 113.91674845964586,
      "speed": "10",
      "geoid": "se8yg081p0qh5vnniqrakr1nr0tdh6a0"
    }
  ]
}

Wrong return example:

{"code":xxx,"message":"Illegal device"}

(Deprecated)Send command (for scooter device)

(Deprecated)Get detail information of scooter

Get history video list

Description

Send Historical video file list upload command to device or query file list.
This API interface is only applicable to the old firmware of the JC200 and JC400 models of the platform.
Other models of devices can use API : 7.21 Get Device Live Steaming Page URL

Request URL

See the unique request URL.
Method: tts.device.meida.cmd.send

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes Access token: used to identify legal client.
imei string Yes Device IMEI
type string Yes 1-upload 2- query

Response

Key Type Description
code int Return code:
0: Success
outher:failure. Refer to the error code description
result JSON type=1
{"code":"100","data":"1.3.3","msg":"Successful response","cmdSeqNo":"1"}
Return code:
225: time out
226: Parameter error
227: The command is not executed correctly
228: The device is not online
229: Network error, connection error, etc.
238: Device interrupted
240: Data format error
type=2
{" 2018_03_29_16_51_45.mp4,2018_03_29_16_52_46.mp4,"}
message string Description of sending command result

type=1
Success example

{
  "code": 0,
  "message": "Operation successful",
  "result": {"code":"255","data":"1.3.3","msg":"Successful response","cmdSeqNo":"1"}
}

Exception example

{
  "code": -1,
  "message": "Operation successful",
  "result": {"code":"228","data":"1.3.3","msg":"Device is offline","cmdSeqNo":"1"}
}

type=2

{
  "code": 0,
  "message": "Operation successful",
  "result": "2018_03_29_16_51_45.mp4,2018_03_29_16_52_46.mp4,"
}

Send history video instruction

Description

Send upload history video file command to device.

Request URL

See the unique request URL.
Method: tts.device.history.cmd.send

HTTP request method

POST

Request parameters

  • Common parameters
  • Private parameters
Parameter Type Required Remark Description
access_token string Yes Access token: used to identify legal client.
access_token string Yes - Device IMEI
access_token string Yes 1-Full fragment 2-Event fragment
access_token string Yes 1-out 2-in
access_token string No type=1 is not null Historical video file name
access_token string No type=2 is not null Event time point, time format yyyy-MM-dd HH:mm:ss

Response

Key Type Description
code int Return code:
0: Success
outher:failure. Refer to the error code description
Result JSON
{"code":"100","data":"1.3.3","msg":"Successful response","cmdSeqNo":"1"}
Return code:
225: time out
226: Parameter error
227: The command is not executed correctly
228: The device is not online
229: Network error, connection error, etc.
238: Device interrupted
240: Data format error
message string Description of sending command result.

Success example:

{
  "code": 0,
  "message": "Operation successful",
  "result": {"code":"255","data":"1.3.3","msg":"Successful response","cmdSeqNo":"1"}
}

Exception example:

{
"code": -1,
"message": "Operation successful",
"result": {"code":"228","data":"1.3.3","msg":"Device is offline","cmdSeqNo":"1"}
}

Get video rtmp url

Description

Get video rtmp url

Request URL

See the unique request URL.
Method: tts.open.video.rtmp.url

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes Access token: used to identify legal client.
imei string Yes Device IMEI

Response

Key Type Description
code int Return code:
0: Success
outher:failure. Refer to the error code description
result JSON
{ "code": 0,"message": "success","result": “rtmp://36.133.0.208:1935/0/353376110035950?uId=openapi8b7914c3e4c188def67edd6b4a743146&vhost=8&user=172&expire_stamp=1595923486798&ext=&channel=0&token=25b422283ff824461b33d8c5059d”}
Return code:
0: Success
225: time out
226: Parameter error
227: The command is not executed correctly
228: The device is not online
229: Network error, connection error, etc.
238: Device interrupted
240: Data format error
message string Description of sending command result.

Success example:

{
  "code": 0,
  "message": "Operation successful",
  "result": “rtmp://36.133.0.208:1935/0/353376110035950?uId=openapi8b7914c3e4c188def67edd6b4a743146&vhost=8&user=172&expire_stamp=1595923486798&ext=&channel=0&token=25b422283ff824461b33d8c5059d”
}

Exception example:

{
  "code": 228,
  "message": "The device is not online",
  "result": “null”
}

Get Device TTS Photo or Video URL

Description

Get device photo or video URL which capture by camera.

Request URL

See the unique request URL.
Method: tts.device.tts.media.URL

HTTP request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes Access token: used to identify legal client.
imei string Yes - Device IMEI
camera string Yes 1-front camera, 2-inward camera, 3-both
media_type string Yes 1-photo, 2-video, 3-both
start_time date No Start time of photo or video created.
end_time date No End time of photo or video created.
token string No Token used to validate whether can access photo or video or not.
page_no int No Zero indexed, 0 by default.
page_size int No 10 rows by default.

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data,could be multiple rows.

result list:

Key Type Description
thumb_URL string URL of video or photo thumbnail.
file_URL string URL of video or photo.
mime_type string Mime type of video or photo
create_time long Create time of video or photo.Unix timestamp format
alarm_time long The time at which the alarm was triggered, Unix timestamp format
media_type string 1-photo 2-video
camera string 0-front camera 1-inward camera
file_size int File size of photo or video
Remark: Unix timestamp; Example: 1611105520 = 2021-01-20 09:18:40

Correct return example:

{
  "code": 0,
  "message": "Operation successful",
  "result": 
[
        {
            "thumb_URL": "http://8.210.205.58:8081/normal/get?fileKey=2021_01_20_09_17_49_I_28.jpg",
            "file_URL": "http://8.210.205.58:8081/normal/get?fileKey=357730090564767_29057540_2021_01_20_09_17_49_I_28_128.mp4",
            "create_time": 1611105520,
            "mime_type": "video/mp4",
            "media_type": 2,
            "alarm_time": 1611105469,
            "camera": 0,
            "file_size": "12108649"
        },
        {
            "thumb_URL": "http://8.210.205.58:8081/normal/get?fileKey=2021_01_20_08_06_13_I_56.jpg",
            "file_URL": "http://8.210.205.58:8081/normal/get?fileKey=357730090564767_00000000_2021_01_20_08_06_13_I_56_146.mp4",
            "create_time": 1611101264,
            "mime_type": "video/mp4",
            "media_type": 2,
            "alarm_time": 1611101173,
            "camera": 0,
            "file_size": "48452069"
        }
]
}

Wrong return example:

{"code":xxx,"message":"imei doesn’t exists"}

Edit user information

Description

Edit the user information of the platform, only edit the user's nickname, mobile phone number, email address, contact person, company name and permissions.

Request URL

See the unique request URL.
Method: tts.user.child.update

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters
Parameter Type Required Remark Description
access_token string Yes - Access token for security access TTS Server.
edit_account String Yes Account name, length of 3~30 characters. Support special characters like “_@.” as well as a-Z, 0-9.
nick_name String Yes Nick name or customer name
telephone String No
Email String Yes User could retrieve password if forgot it.
contact_person String No contact
company_name String No Company name
permissions String Yes Web Login App Login Send Command Set Working Mode Edit by Web Edit by App (6 digital represents enable/disable permission)

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned data, could be multiple rows

Correct return example:

{
"code": 0,
"message": "Account update success!",
"result": null,
"data": null
}

Get parking/idling data of devices

Description

Get device(s) parking/idling data of specified time range.

Request URL

See the unique request URL.
Method: tts.open.platform.report.parking

HTTP Request method

POST

Request parameters

Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account to which the new fence belongs
imeis string Yes - Example values: 869247060001770,869247060001259,869247060001804
start_time string Yes - Start time, Format: yyyy-MM-dd HH:mm:ss
end_time string Yes - End time
Format: yyyy-MM-dd HH:mm:ss
end_time should be earlier than current time
start_row string Yes - Row number of result set
page_size string Yes - Records in one page
acc_type string Yes - on: get the ldling data;
off: get the parking data;

Response

Key Type Description
code int Return code:
0: return correctly
1100:Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string null
data object The returned data.

data list

Key Type Description
totalTime string Request processing time
dataTotalRows string Total rows
rows array[object] Data details

rows object

Key Type Description
imei string Imei of device
startTime string Start time
endTime string End time
durSecond string Parking time
lng number Longitude
lat number Latitude
addr string Address
deviceName string Device name
mcType string Device model
acc string Acc status
stopSecond string Length of parking

Success example

{ 
"code": 0, 
"message": "success", 
"result": null , 
"data": {
"totalTime":"185641",
"dataTotalRows":"2",
"rows":[
   {
"imei":"869247060001739",
"startTime":"2022-12-10T01:05:33.000Z",
"endTime":"2022-12-10T04:17:48.000Z",
"durSecond":"11535",
"lng":113.943093,
"lat":22.576748,
"addr":"Shigu Road, 松坪村, Xili Sub-district, Nanshan distri...",
"deviceName":"JC450Pro-01739",
"mcType":"JC450Pro",
"acc":"on",
"stopSecond":"11535"
},
   {
"imei":"869247060001739",
"startTime":"2022-12-09T22:13:16.000Z",
"endTime":"2022-12-10T01:04:25.000Z",
"durSecond":"10269",
"lng":113.943002,
"lat":22.57649,
"addr":"Shigu Road, 松坪村, Xili Sub-district, Nanshan distri...",
"deviceName":"JC450Pro-01739",
"mcType":"JC450Pro",
"acc":"on",
"stopSecond":"10269"
      }
   ]
  }
}

Wrong return example:

{ 
"code": 1100, 
"message": "Business exception ", 
"result": null ,
"data": null ,
}

Create platform Geo-fence

Description

Create a platform geofence, the newly created platform geofence belongs to the default group.

Request URL

See the unique request URL.
Method: tts.open.platform.fence.create

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account to which the new fence belongs
fence_name string Yes - The name of the new fence
fence_type string Yes circle or polygon Fence type (circle/polygon)
fence_color string No default: #3B7AFF Fence color, standard RGB16 color column such as red #FF0000
geom string Yes - Collection of coordinate points
Polygon: Latitude and longitude are separated by commas, and multiple locations are separated by '#',
such as: 22.581714259546697,113.89460067944759#22.57323797629247,113.92 341832019817 (Need to transcode to Mars coordinate system)
Round: 22.57540001979625, 113.88814802356858
Note: latitude comes before longitude
radius string No 200-5000, default: 200 Fence radius, in m, range 200m~5000m,When it is a circle, it needs to be passed in, otherwise it will become a polygon
description string No - fence description

Response

Key Type Description
code int Return code:
0: return correctly
1114: Fence name already exists
-1: The system is busy
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string null
data string The returned data. fence_id returned if succeed.

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": null,
  "data": "c33b80d46d2b41d588a5afbd6f8b6285"
}

Wrong return example:

{
  "code": 1114,
  "message": "That name already exists",
  "result": null,
  "data": null
}

Edit platform Geo-fence

Description

Edit platform geofence informatio.

Request URL

See the unique request URL.
Method: tts.open.platform.fence.create

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account to which the fence belongs
fence_id string Yes - Fence id that needs to be edited
fence_name string Yes - The name of the new fence
fence_type string Yes circle or polygon Fence type (circle/polygon)
fence_color string No default: #3B7AFF Fence color, standard RGB16 color column such as red #FF0000
geom string Yes - Collection of coordinate points
Polygon: Latitude and longitude are separated by commas, and multiple locations are separated by '#', such as: 22.581714259546697,113.89460067944759#22.57323797629247,113.92 341832019817 (Need to transcode to Mars coordinate system)
Round: 22.57540001979625, 113.88814802356858
Note: latitude comes before longitude
radius string No 200-5000, default: 200 Fence radius, in m, range 200m~5000m,When it is a circle, it needs to be passed in, otherwise it will become a polygon
description string No - fence description

Response

Key Type Description
code int Return code:
0: return correctly
-1: The system is busy
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string null
data string The returned data. fence_id returned if succeed.

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": null,
  "data": "c33b80d46d2b41d588a5afbd6f8b6285"
}

Wrong return example:

{
  "code": -1,
  "message": "The system is busy",
  "result": null,
  "data": null
}

Delete platform Geo-fence

Description

Delete platform geofence.

Request URL

See the unique request URL.
Method: tts.open.platform.fence.delete

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account to which the new fence belongs
fence_id string Yes - Fence id that needs to be deleted

Response

Key Type Description
code int Return code:
0: return correctly
-1: The system is busy
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string null
data string null

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": null,
  "data": null
}

Wrong return example:

{
  "code": -1,
  "message": " The system is busy ",
  "result": null,
  "data": null
}

Geo-fence related device

Description

Geofence related device.

Request URL

See the unique request URL.
Method: tts.open.platform.fence.bind

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
fence_id string Yes -
imeis string No - Example: 869247060001770,869247060001259,869247060001804
alert_type string No - Alarm types, if multiple alarms are configured at the same time, separate them with commas ","
  1. in: into the fence;
  2. out: out of the fence;
  3. stayTimeIn: If you do not enter the fence for more than N days, the alarm will be triggered;
  4. stayTimeOut: If you do not leave the fence for more than N days, the alarm will be triggered;
stay_time_in int No - Do not enter the fence for more than N days to trigger an alarm.
When there is a value here, you need to pass in stayTimeIn in the alert_type.
stay_time_out int No - Do not leave the fence for more than N days to trigger an alarm.
When there is a value here, you need to pass in stayTimeOut in alert_type.

Response

Key Type Description
code int Return code:
0: return correctly
1100: Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string null
data string The returned data. the number of related devices returned if succeed.

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": null,
  "data": "3"
}

Wrong return example:

{
  "code": 1100,
  "message": "Business exception",
  "result": null,
  "data": null
}

List platform geofences of an account

Description

Query platform geofences of a specified account.

Request URL

See the unique request URL.
Method: tts.open.platform.fence.list

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account to which the geofences belong
page_no number No ≥1, default:1 Page number
page_size number No 1‑50, default:10 Records in one page

Response

Key Type Description
code int Return code:
0: return correctly
1100: Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result object Number of fences belonging to the account and details of each fence

result:

Key Type Description
total string Number of fences belonging to the account
rows Array[Object] The returned data

Rows list:

Parameter Type Description
fence_id string Fence_id
fence_name string The name of the geofence
fence_type string Fence type (circle/polygon)
fence_color string default: #3B7AFF
coordinates string Collection of coordinate points
Polygon: Latitude and longitude are separated by commas, and multiple locations are separated by ';', such as: 22.581714259546697,113.89460067944759;22.57323797629247,113.92 341832019817 (Need to transcode to Mars coordinate system)
Round: 22.57540001979625, 113.88814802356858
Note: latitude comes before longitude
radius string Fence radius, in m, range 200m~5000m,When it is a circle, it needs to be passed in, otherwise it will become a polygon
description string fence description
imeis string Example values:
869247060001770,869247060001259,869247060001804
alert_type string Alarm types, separated by commas
in: into the fence;
out: out of the fence;
stayTimeIn: If you do not enter the fence for more than N days, the alarm will be triggered;
stayTimeOut: If you do not leave the fence for more than N days, the alarm will be triggered;
stay_time_in int Do not enter the fence for more than N days to trigger an alarm.
When there is a value here, you need to pass in stayTimeIn in the alert_type.
stay_time_out int Do not leave the fence for more than N days to trigger an alarm.
When there is a value here, you need to pass in stayTimeOut in alert_type.
account string account

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": {
    "total": 294,
    "rows": [
      {
        "fence_id": "dfab43ea3e7a40e987056c857cccae7b",
        "fence_name": "test fence",
        "fence_type": "circle",
        "fence_color": "#3b7aff",
        "coordinates": "22.544382,114.004037",
        "radius": "4153",
        "description": "",
        "imeis": "231011234567990,869247060001655,868598060001827,869247060001259",
        "alert_type": "in",
        "stay_time_out": null,
        "stay_time_in": null,
        "account": "hao001"
      }
    ]
  }
}

Wrong return example:

{
  "code": -1,
  "message": "The system is busy",
  "result": null,
  "data": null
}

Move devices

Description

Move devices from one sub-account to another sub-account.

Request URL

See the unique request URL.
Method: tts.open.device.move

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
src_account string Yes - Transfer device from account
dest_account string Yes - Transfer device to account
imeis string Yes - Device imei
cleanBindFlag string No - 1: clear data, 0: Do not clear data

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result string The returned parameters

Correct return example:

{
  "code": 1112,
  "message": "device already exists",
  "result": [
    "202205454545454"
  ],
  "data": null
}

Or:

{
  "code": 0,
  "message": "Transfer/Sell Equipment Successfully",
  "result": null,
  "data": null
}

Wrong return example:

{
  "code": xxx, "message": "no permissions"
}

Get RFID reporting information

Description

Query the RFID information reported within a certain period of time.

Request URL

See the unique request URL.
Method: tts.open.device.rfid.list

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account to which the device belongs. If the device to be queried belongs to multiple different users, please enter the common superior account of these users here.
imeis string No - Device imei(s), separate by comma.
No more than 100 each time
If neither imei nor card id is entered, all RFID reporting records within the query time period will be queried.
card_ids string No - RFID(s),separate by comma.
No more than 100 each time
If neither imei nor card id is entered, all RFID reporting records within the query time period will be queried.
begin_time number Yes - Start time Format: yyyy-MM-dd HH:mm:ss
end_time number Yes - End time Format: yyyy-MM-dd HH:mm:ss end_time should be earlier than current time
Query up to 1 month of data at a time
page_no int No >=1
default:1
Page number
page_size int No 1-100
default:10
Records in one page

Response

Key Type Description
code int Return code:
0: return correctly
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
data object The returned parameters

data object:

Key Type Description
currentPage number Current page code
pageSize number Records in one page
totalRecord number Total amount of data that meets the conditions
result Array[Object] The returned data

result list:

Key Type Description
cardId string The corresponding RFID in the reporting record
imei string RFID record reporting corresponding imei
photo string Photo taken by the device during RFID reporting
operationTime string RFID record reporting time

Correct return example:

{
  "code": 0,
  "message": "success",
  "data": {
    "currentPage": 1,
    "pageSize": 10,
    "startRow": 1,
    "endRow": 10,
    "totalRecord": 34,
    "totalPage": 4,
    "result": [
      {
        "imei": "890768902346789",
        "cardId": "278907",
        "operationTime": "2024-04-22 09:12:23",
        "photo": ""
      }
    ]
  }
}

Wrong return example:

{"code":xxx,"message":"no permissions"}

Query single fence information

Description

Query single fence information based on fence id

Request URL

See the unique request URL.
Method: tts.open.platform.fence.detail

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
fence_id string Yes - Unique id of fence

Response

key Type Description
code int Return code:
0: return correctly
1100:Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result object Detailed information of fence

result:

Parameter Type Description
fence_id string Fence_id
fence_name string The name of the geofence
fence_type string Fence type (circle/polygon)
fence_color string default: #3B7AFF
coordinates string Collection of coordinate points
Polygon: Latitude and longitude are separated by commas, and multiple locations are separated by ';', such as: 22.581714259546697,113.89460067944759;22.57323797629247,113.92 341832019817 (Need to transcode to Mars coordinate system)
Round: 22.57540001979625, 113.88814802356858
Note: latitude comes before longitude
radius string Fence radius, in m, range 200m~5000m,When it is a circle, it needs to be passed in, otherwise it will become a polygon
description string fence description
imeis string Example values:
869247060001770,869247060001259,869247060001804
alert_type string Alarm types, separated by commas
in: into the fence;
out: out of the fence;
stayTimeIn: If you do not enter the fence for more than N days, the alarm will be triggered;
stayTimeOut: If you do not leave the fence for more than N days, the alarm will be triggered;
stay_time_in int Do not enter the fence for more than N days to trigger an alarm.
When there is a value here, you need to pass in stayTimeIn in the alert_type.
stay_time_out int Do not leave the fence for more than N days to trigger an alarm.
When there is a value here, you need to pass in stayTimeOut in alert_type.
account string account

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": {
    "fence_id": "dfab43ea3e7a40e987056c857cccae7b",
    "fence_name": "test fence",
    "fence_type": "circle",
    "fence_color": "#3b7aff",
    "coordinates": "22.544382,114.004037",
    "radius": "4153",
    "description": "",
    "imeis": "231011234567990,869247060001655,868598060001827,869247060001259",
    "alert_type": "in",
    "stay_time_out": null,
    "stay_time_in": null,
    "account": "hao001"
  }
}

Wrong return example:

{
  "code": -1,
  "message": "The system is busy",
  "result": null,
  "data": null
}

Bind app user

Description

Bind the device to the app user.

Request URL

See the unique request URL.
Method: tts.open.device.bind

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
imei string Yes - The account to which the geofences belong
user_id string Yes - The app user account to be bound

Response

key Type Description
code int Return code:
0: return correctly
10:The device has been bound to a user
1001: Illegal parameters
1002: User or device is incorrect, see message for specific errors
1100: Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message

Correct return example:

{
  "code": 0,
  "message": "success"
}

Wrong return example:

{
  "code": 1100,
  "message": "The system is busy",
  "result": null,
  "data": null
}

Unbind app user

Description

Unbind the device from the app user.

Request URL

See the unique request URL.
Method: tts.open.device.unbind

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
imei string Yes - The account to which the geofences belong
user_id string Yes - The app user account you want to unbind

Response

key Type Description
code int Return code:
0: return correctly
10: The device is not bound to this user, so the unbinding failed.
1001: Illegal parameters
1002: User or device is incorrect, see message for specific errors
1100:Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message

Correct return example:

{
  "code": 0,
  "message": "success"
}

Wrong return example:

{
  "code": 1100,
  "message": "The system is busy",
  "result": null,
  "data": null
}

Get the trips report data of devices

Description

Query the trips report data of devices.

Request URL

See the unique request URL.
Method: tts.open.platform.report.trips

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account to which the new fence belongs
imeis string Yes - Example values:
869247060001770,869247060001259,869247060001804
type string Yes - day/list
When type is day, the device itinerary data is assembled by day.
When it is list, the detailed data of the device itinerary is summarized and returned.
start_time string Yes - Start time
Format: yyyy-MM-dd HH:mm:ss
end_time string Yes - End time
Format: yyyy-MM-dd HH:mm:ss
end_time should be earlier than current time
start_row string Yes - Row number of result set.
page_size string Yes - Recordsin one page.

Response

key Type Description
code int Return code:
0: return correctly
1100:Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
data object The returned data.

data list:

key Type Description
dayList array[object] When type = list, the array is returned
datDatas array[object] When type = day, the array is returned

datDatas list:

key Type Description
deviceName string Device Name
deviceImei string Device imei
data object

datDatas.data:

key Type Description
date string Date
totalTrips string Total number of trips on the day
averageSpeed string Average speed
fuel string Fuel consumption
maxSpeed string Maximum speed
oilWear string Fuel consumption per 100 kilometers
totalMileage string Total mileage
travelTime string Total trip time

dayList list:

key Type Description
imei string Imei of device
deviceName string Device name
tripsData Array[object] Trip information, see the table below for details
inTotal object Trip information summary:
allTrips: total number of trips
totalDis: total mileage
travelTime: total running time
totalTime: formatted total running time
totalAvgSpeed: average speed
allTotalMaxSpeed: maximum average speed
totalFuel: total fuel consumption
oilWear: fuel consumption per 100 kilometers

dayList.tripsData:

key Type Description
Searchdate string date
tripNum number Number of trips on the day
inTotal object Data summary for the day
  • totalDis: total mileage
  • travelTime: total running time
  • totalTime: formatted total running time
  • totalAvgSpeed: average speed
  • allTotalMaxSpeed: maximum average speed
  • totalFuel: total fuel consumption
  • oilWear: fuel consumption per 100 kilometers
dayData Array[object] For each itinerary information, please see the table below for detailed information

dayList.tripsData.dayData:

Key Type Description
imei string Device imei
startTime string Start time of the trip
endTime string End time of the trip
startLat string Start latitude of the trip
startLng string Start longitude of the trip
endLat string End latitude of the trip
endLng string End longitude of the trip
totalMileage string Mileage of the trip
travelTime string Time
averageSpeed string Average speed
maxSpeed string Maximum speed
oilWear string Fuel consumption per 100 kilometers
fuel string Fuel consumption
startMileage string Start mileage
endMileage string End mileage

Correct return example:

暂缺

Wrong return example:

{
  "code": 1100,
  "message": "Business exception",
  "result": null,
  "data": null
}

Get entry and exit fence data of devices

Description

Query the report data of the device's entry and exit fence.

Request URL

See the unique request URL.
Method: tts.open.platform.fence.duration

HTTP Request method

POST

Request parameters

  • (1) Common parameters
  • (2) Private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account to which the new fence belongs
imeis string Yes - Example values: 869247060001770,869247060001259,869247060001804
start_time string Yes - Start time
Format: yyyy-MM-dd HH:mm:ss
end_time string Yes - End time
Format: yyyy-MM-dd HH:mm:ss
end_time should be earlier than current time
start_row string Yes - Row number of result set.
page_size string Yes - Recordsin one page.

Response

Key Type Description
code int Return code:
0: return correctly
1100:Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
data object The returned data.

data list:

Key Type Description
totalTime string Request processing time
dataTotalRows string Total rows
rows array[object] Data details

Rows list

Key Type Description
imei string Imei of device
deviceName string Device name
fenceName string Fence name
enterTime string Enter fence time
exitTime number Leave fence time
duration number Duration

Correct return example:

{
  "code": 0,
  "message": "success",
  "result": null,
  "data": {
    "totalTime": "0",
    "dataTotalRows": "2",
    "rows": [
      {
        "imei": "869247060001739",
        "deviceName": "JC450Pro-01739",
        "fenceName": "geofence1",
        "enterTime": "2022-12-10T01:05:33.000Z",
        "exitTime": "2022-12-10T04:17:48.000Z",
        "duration": "11535"
      },
      {
        "imei": "869247060001739",
        "deviceName": "JC450Pro-01739",
        "fenceName": "geofence1",
        "enterTime": "2022-12-10T01:05:33.000Z"
      }
    ]
  }
}

Wrong return example:

{
  "code": 1100,
  "message": "Business exception",
  "result": null,
  "data": null
}

Get the OBD data of devices

Description

Query CAN bus diagnosis data reported by OBD device.

Request URL

See the unique request URL.
Method: tts.device.obd.list

HTTP Request method

POST

Request parameters

  • (1) Common parameters
  • (2) Private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account to which the new fence belongs
imeis string Yes - Device imei(s), separate by comma. No more than 100 each time.
Supports querying the data of the account and its sub-account devices.
Example values:
869247060001770,869247060001259,869247060001804
start_time string Yes - Start time
Format: yyyy-MM-dd HH:mm:ss
end_time string Yes - End time
Format: yyyy-MM-dd HH:mm:ss
End_time should be earlier than current time.
Query up to 31 days of data at a time.
page_no int Yes >=1
default:1
Page number
page_size int Yes 1-100
default:10
Records in one page.

Response

Key Type Description
code int Return code:
0: return correctly
1100: Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
data object The returned data.

data list:

Key Type Description
currentPage int The current page, same as page_no.
pageSize int Records in one page, same as page_size.
totalRecord int Total rows
result array[object] Data details

rows list:

Key Type Description
imei string Imei of device
dataReportTime string The time the data was reported
odometerReading string Vehicle meter mileage (Unit: KM)
deviceAccumulatedMileage string Mileage counted by the device
remainingFuel string Oil volume
remainingFuelPercentage string Oil percentage
The data reported by different vehicles and devices are different. The Oil volume or Oil percentage is displayed based on the data actually reported by the device.
coolantTemperature string Coolant temperature (Unit: ℃)
vehicleBatterVoltage string External input voltage
currentRPM string Instantaneous engine speed
currentSpeed string Current driving speed
vin string Vehicle Identification Number

Correct return example:

{
    "code": 0,
    "message": "success",
    "data": {
        "currentPage": 1,
        "pageSize": 2,
        "startRow": 0,
        "endRow": 0,
        "totalRecord": 2684,
        "totalPage": 0,
        "result": [
            {
                "imei": "158511020000028",
                "dataReportTime": "2024-05-09 10:25:00",
                "odometerReading": "2049.6",
                "deviceAccumulatedMileage": "142.9",
                "remainingFuel": null,
                "remainingFuelPercentage": "58",
                "coolantTemperature": "77",
                "vehicleBatterVoltage": "118",
                "currentRPM": "5016",
                "currentSpeed": "88.5",
                "vin": "LC0CG4CF1H0029191"
            },
            {
                "imei": "158511020000028",
                "dataReportTime": "2024-05-09 1:27:23",
                "odometerReading": "2048.6",
                "deviceAccumulatedMileage": "143.9",
                "remainingFuel": null,
                "remainingFuelPercentage": "56",
                "coolantTemperature": "78",
                "vehicleBatterVoltage": "118",
                "currentRPM": "5016",
                "currentSpeed": "95.5",
                "vin": "LC0CG4CF1H0029191"
            }
        ]
    }
}

Wrong return example:

{
    "code": 1100,
    "message": "Business exception ",
    "result": null,
    "data": null
}

Get the OBD fault data of devices

Description

Query CAN bus fault code information reported by OBD device.

Request URL

See the unique request URL.
Method: tts.device.obd.fault

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)Private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account to which the new fence belongs
imeis string Yes - Device imei(s), separate by comma. No more than 100 each time.
Supports querying the data of the account and its sub-account devices.
Example values:
869247060001770,869247060001259,869247060001804
start_time string Yes - Start time
Format: yyyy-MM-dd HH:mm:ss
end_time string Yes - End time
Format: yyyy-MM-dd HH:mm:ss
End_time should be earlier than current time.
Query up to 31 days of data at a time.
page_no int Yes >=1
default:1
Page number
page_size int Yes 1-100
default:10
Records in one page

Response

Key Type Description
code int Return code:
0: return correctly
1100: Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
data object The returned data.

data list:

Key Type Description
currentPage int The current page, same as page_no.
pageSize int Records in one page, same as page_size.
totalRecord int Total rows
result array[object] Data details

rows list:

Key Type Description
imei string Imei of device
deviceName string Device name
faultCode string The fault code of the fault
faultDetail string Fault detailed description
eventTime string Time when the fault was reported

Correct return example:

{
    "code": 0,
    "message": "success",
    "result": null,
    "data": {
        "currentPage": 1,
        "pageSize": 4,
        "startRow": 0,
        "endRow": 0,
        "totalRecord": 6,
        "totalPage": 0,
        "result": [
            {
                "imei": "202509999999994",
                "deviceName": "VL502_E-99994",
                "faultCode": "P1502",
                "faultDetail": "High speed state of the vehicle - the front axle is faster than the rear axle",
                "eventTime": "2024-07-03 08:16:49"
            },
            {
                "imei": "202509999999994",
                "deviceName": "VL502_E-99994",
                "faultCode": "B0074",
                "faultDetail": "2nd row center seat belt pretensioner - start control (sub-error)",
                "eventTime": "2024-07-03 08:26:49"
            },
            {
                "imei": "202509999999994",
                "deviceName": "VL502_E-99994",
                "faultCode": "P2407",
                "faultDetail": "Fuel evaporative emission system leak detection pump sensing circuit is intermittent/unstable",
                "eventTime": "2024-07-03 08:36:49"
            },
            {
                "imei": "202509999999994",
                "deviceName": "VL502_E-99994",
                "faultCode": "U0464",
                "faultDetail": "Invalid data received from the navigation control module",
                "eventTime": "2024-07-03 08:46:49"
            }
        ]
    }
}

Wrong return example:

{
    "code": 1100, 
    "message": "Business exception ", 
    "result": null ,
    "data": null ,
}

Get the location of TAG device

Description

Query the latest location of TAG.

Request URL

See the unique request URL.
Method: tts.device.location.getTagMsg

HTTP Request method

POST

Request parameters

  • (1) Common parameters
  • (2) Private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
imeis string Yes - Imei of TAG device

Response

key Type Description
code int Return code:
0: return correctly
1100: Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
data object The returned data.

result list:

key Type Description
lng double Longitude
lat double Latitude
gpsTime Long GPS positioning time
directions String Number of satellites
gpsSpeed int Speed
positionType String GPS, LBS, WIFI, BEACON
gpsNum int Number of satellites

Correct return example:

{
    "code": 0,
    "message": "success",
    "result": [
        {
            "lng": 113.943054,
            "lat": 22.576609,
            "gpsTime": 1734593340,
            "directions": "0",
            "gpsSpeed": -1.0,
            "positionType": "5",
            "gpsNum": 3
        }
    ]
}

Wrong return example:

{
    "code": 1100,
    "message": "Business exception ",
    "result": null,
    "data": null
}

Create device group

Description

Add device groups.
Users can divide devices into different groups for easier management.

Request URL

See the unique request URL.
Method: tts.device.group.create

HTTP Request method

POST

Request parameters

  • (1) Common parameters
  • (2) Private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account that the created device group belongs to
group_name string Yes group name

Response

key Type Description
code int Return code:
0: return correctly
1100: Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result object The returned data.

result

Key Type Description
group_id string ID of the new device group
group_name string Name of the new device group

Correct return example:

{
    "code": 0,
    "message": "success",
    "result": {
        "group_id": "534d23f1b28c44319f4f8ba0cda5b7e6",
        "group_name": "device group 1"
    }
}

Edit device group

Description

Edit device groups.

Request URL

See the unique request URL.
Method: tts.device.group.update

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
group_id string Yes - ID of the device group being edited
group_name string Yes - Name of the device group being edited

Response

key Type Description
code int Return code:
0: return correctly
1100: Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message

Correct return example:

{
    "code": 0,
    "message": "success"
}

Delete device group

Description

Delete device groups.

Request URL

See the unique request URL.
Method: tts.device.group.delete

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
group_id string Yes - ID of the device group being deleted

Response

key Type Description
code int Return code:
0: return correctly
1100: Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message

Correct return example:

{
    "code": 0,
    "message": "success"
}

Get device group list of an account

Description

Query the device groups of an account.

Request URL

See the unique request URL.
Method: tts.device.group.list

HTTP Request method

POST

Request parameters

  • (1)Common parameters
  • (2)private parameters as follow:
Parameter Type Required Remark Description
access_token string Yes - accesstoken: used for identifying legal third party
account string Yes - The account that the device groups belong to

Response

key Type Description
code int Return code:
0: return correctly
1100: Business exception
Other: failure. Refer to the error code description
message string If code is not 0, there will be a corresponding error message
result array[object] The returned data

rows list:

Key Type Description
group_id string ID of the new device group
group_name string Name of the new device group

Correct return example:

{
    "code": 0,
    "message": "success",
    "result": [
        {
            "group_id": "b2ac10536171474eb0c151c7bb606f3d",
            "group_name": "Default group"
        },
        {
            "group_id": "298b949bacbb4badae597ba1fdb629be",
            "group_name": "22221"
        },
        {
            "group_id": "05cbdd380ca14c2e89b2ab59904f51b7",
            "group_name": "CVCVXCV"
        }
    ]
}

Appendix

Device alarm type(alarm type Id)

The alarm type ID of the alarm type actively reported by the device is a number.
The alarm type ID of the alarm generated after platform logic judgment is English text.

alertTypeId alertType
1 SOS alert
10 Enter GPS blind zone alert
100 Cancel Notification for Temperature Alert
101 Cancel Notification for Collision Alert
11 Exit GPS blind zone alert
113 Increase in oil level
114 Install alert
115 Oil Sence Timeout
119 High voltage at ADC1
12 Booting notification
120 Low voltage at ADC1
126 High humidity
127 Low humidity
128 DVR vibration alert
13 GPS first fix notification
135 Overspeed alert(DVR)
136 Power off alert(DVR)
138 Immobilization ON
139 Immobilization OFF
14 Low external power alert
140 Close eyes Alert
141 Switch Land Transport Mode Alarm
142 Environmental Anomaly Alarm
143 Distraction Alert
144 Sudden Acceleration Alert(DVR)
145 Sudden Deceleration Alert(DVR)
146 Sharp Turn Alert(DVR)
147 Collision Alert(DVR)
148 No Face Alert
149 Switch Ocean Transport Mode Alarm
15 Low power protection alert
150 Switch Static Transport Mode Alarm
151 Phone Calling Alert
154 Smoking Alert
16 Sim card change alert
160 Yawn Alert
163 Head lowered
165 RFID reporting event
168 Engine failure
169 Undervoltage
17 Power off alert
170 Drinking
171 Light detected alert
172 Bluetooth MAC searched
173 Bluetooth MAC lost
18 Airplane mode after low power protection
19 Disassembly alert
191 Device Plug-out Alert
197 Engine ON
198 Engine OFF
199 Overtime driving alert
2 Power cut off alert
20 Door detection alert
202 overspeed warning
203 Overtime parking warning
204 Forward collision warning
205 Lane departure warning
206 Vehicle too close warning
207 pedestrian collision warning
208 DMS fatigue warning
21 Battery low power shutdown
22 Voice alarm
224 Device Plug-in Alert
227 Overheating
230 INPUT1 was activated
231 INPUT1 was deactivated
232 INPUT2 was activated
233 INPUT2 was deactivated
24 Cover Move Alert
25 Internal low battery alert
254 Ignition on
256 Fence entry alarm (Bluetooth)
257 Exit fence alarm (Bluetooth)
258 Fence entry alarm (WIFI)
259 Exit fence alarm (WIFI)
260 long periods of stillness
261 Start exercise reminder
262 Stop exercise reminder
263 LTE Jamming Detected
266 LTE Jamming Ended
267 GPS Jamming Detected
268 GPS Jamming Ended
28 Door open alert
29 Door close alert
3 Vibration alert
35 Fall Alert
36 Plug in charger
39 Unauthorized Open Alert
4 Enter geo-fence(terminal)
40 Initiative Offline(Power Off) Alert
41 Sudden Acceleration Alert
42 Sharp Turn Left Alert
43 Sharp Turn Right Alert
44 Collision Alert
45 Vehicle Turn Over Alarm
48 Sudden Deceleration Alert
5 Exit geo-fence(terminal)
50 Device Pull Out Alarm
55 Collision Alert
58 Cancel Notification for Unauthorized Open Alert
6 Overspeed alert(terminal)
71 Fatigue driving alert
76 Sharp turn alarm
77 Abrupt lane switching alarm
78 Vehicle stability
79 Vehicle angle abnormality
80 Door close alert
81 Door open alert
82 Temperature Alert
83 Stealing oil alarm
86 Start charging
87 Stop charging/remove charger
89 full of reminders
9 Displacement alert(terminal)
90 Low battery alert
91 High Temperature Alert(terminal)
92 Low Temperature Alert(terminal)
ACC_OFF ACC OFF
ACC_ON ACC ON
burglarStatus_0 Disarm
burglarStatus_1 Arm
burglarStatus_2 Alert
carFault Vehicle fault alert
displacementAlarm Night Driving Alert
DMSAlert DMS Alert
drivingBehaviorAlert Driving Behavior Alert
drivingBehaviorAlertDVR Driving Behavior Alert(DVR)
fenceOverspeed Fence Overspeed alert
geozone Geo-fence alert
high_temp_alarm High Temperature Alert(platform)
in Enter geo-fence
laneshift Route Deviation Alert
low_temp_alarm Low Temperature Alert(platform)
mileageAlarm Maintenance alert
obd OBD alert
offline Offline alert
other Other alerts
out Exit geo-fence
overSpeed Overspeed alert(platform)
sensitiveAreasFence Sensitive areas fence
statusLeftFrontDoors_0 Left front door close
statusLeftFrontDoors_1 Left front door open
statusLeftFrontWindows_0 Left front window close
statusLeftFrontWindows_1 Left front window open
statusLeftRearWindows_0 Left rear door close
statusLeftRearWindows_1 Left rear door open
statusRightFrontDoors_0 Right front door close
statusRightFrontDoors_1 Right front door open
statusRightFrontWindows_0 Right front window close
statusRightFrontWindows_1 Right front window open
statusRightRearDoors_0 Right rear door close
statusRightRearDoors_1 Right rear door open
statusRightRearWindows_0 Right rear window close
statusRightRearWindows_1 Right rear window open
statusTrunk_0 Trunk close
statusTrunk_1 Trunk open
stayAlert Parking alert
stayAlertOn Idling alert
stayTimeIn Long time not enter the Geo-fence
stayTimeOut Long time not exit the Geo-fence
ubiAcce Harsh acceleration
ubiColl Collision
ubiDece Harsh braking
ubiLane Sudden lane change
ubiRoll Rollover
ubiSatt Roll and pitch
ubiStab Skidding
ubiTurn Harsh cornering