WanWay GPS OPEN API
Revision record
Owner Date Version Approve Description
WanWay 2017/7/24 1.0 First Version
WanWay 2017/7/28 1.0.1 Modify the device status
interface to support multiple
types of queries
WanWay 2017/8/31 1.0.2 Add batch creation or
modification of device
information
WanWay 2017/10/12 1.0.3 Get device information
interface modification
WanWay 2017/11/13 1.0.4 Modify the query device
status interface and add fields
WanWay 2017/12/6 1.0.5 Modify the query device
status interface and add fields
WanWay 2018/01/15 1.0.6 Modify the query device
status interface, add position
Type field
WanWay 2018/01/15 1.0.7 Defining Get Single Device
History Tracing Interface
WanWay 2018/03/20 1.0.8 Increase the user tree query
interface, create or modify
device interfaces in batches,
add device name
modifications, and transfer
some user support devices
WanWay 2018/03/26 1.0.9 Add new vehicle interfaces
(new vehicles can also be
connected to equipment)
WanWay 2018/03/29 1.1.0 Add real-time location query
of equipment, increase
message push interface,
increase equipment batch
unbundling vehicle interface
Purpose
WanWay open API is provided to the customer to facilitate the customer to inquire about the
equipment related status and send instructions.
Access Process
1. The client applies for opening API permissions. Get the corresponding login key (different
from the customer's login password).
2. Use access Token to call other API interfaces.
Encoding format
All encodings use UTF-8 encoding.
Request and return parameter types
Unless otherwise specified in this document, all request and return parameter types are in JSON
format.
All time parameters and returned timestamps are in seconds.
All geographic coordinates use the wgs84ll coordinate system.
All interfaces will not explicitly return fields with empty values.
Content-Type / application/json
Sample user
User name: testdemo, secret key: rHW3agj3$uc#8vPB7qPkl8K#exdaf&bY
Interface List
Authentication
Brief description:
Use the account name and login secret key for authentication to obtain an Access Token
for authentication.
Note:
The key is not a signature, the key must be encrypted twice to generate the signature.
Request URL:
${service_url}/auth
Request method:
POST
Parameter:
Parameter name Required Type Description
appid yes string login name
time yes Long Current Unix format timestamp in
seconds
signature yes string Signature generation method is
md5(md5(login key)+time),
md5 uses 32-bit lowercase string
algorithm
Request example:
POST ${service_url}/auth
{
"appid":"demo",
"time":1499768051,
"signature":"07495a3ef25563510f7bedbc5738cadc"
}
Correct return example:
{
"code":0, //result, 0 means success
"expiresIn":7200000, //The validity period in milliseconds, the default is 2 hours
"accessToken":"6fcf02fe018b4b1e907e329b55fc081f" //Access Token, all subsequent
access is required
Add this parameter in url
}
Error return example:
{
"code":416002, //Return code, see appendix for specific definition
"result":"appid cannot be null" //reason of error
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
result string Error message
User
Get user tree
Brief description:
This interface returns all user level information under the specified user
Request URL:
${service_url}/account/tree?accessToken={your_access_token}&id={accountId}
Request method:
GET
Parameter:
Parameter name Required Type Description
accessToken yes string Identity Token
id no string The login user ID is taken by default.
The ID can only be the login person
or a sub-user of the login person.
Return example:
{
"code": 0,
"accountId": 3762809,
"account": "demo",
"userName": "testdemo",
"parentAccountId": 10000140,
"childAccounts": [{
"accountId": 10000136,
"account": "yuanqiangceshi",
"userName": "customer 1",
"parentAccountId": 3762809,
"childAccounts": [{
"accountId": 10002095,
"account": "customer 4",
"userName": "customer 4",
"parentAccountId": 10000136
}, {
"accountId": 10002147,
"account": "customer 5",
"userName": "customer 5",
"parentAccountId": 10000136
}]
}, {
"accountId": 10000138,
"account": "yuanqiangceshi2",
"userName": "customer 2",
"parentAccountId": 3762809
}]
}
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
accountId Long User ID
account String User unique identification
code
userName String The displayed name can be
repeated
parentAccountId Long Parent node user ID
parentAccountId List List of child accounts
Create user tree node
Brief description:
This interface is used to create user tree nodes, and at the same time create a default login account,
which defaults to user permissions.
Request URL:
${service_url}/account/tree?accessToken={your_access_token}
Request method:
POST
Parameter:
Parameter name Required Type Description
accessToken yes string Identity Token
account yes string User unique identification code,
cannot be repeated
parentAccountId yes Long ID of the upper node of the user tree
password yes string Default account password,
format: 6 to 16 letters or numbers
contactTel no string contact number
contactUser no string Contact person
address no string contact address
Request example:
{
"userName": "wanway test",
"account": "wanway test",
"parentAccountId": 3,
"password": "123456",
"contactTel": "13611112222",
"contactUser": "Contact person",
"address": "Contact address"
}
Correct return example:
{
"code": 0,
"accountId": 10019771,
"account": "wanway test",
"userName": "wanway test"
}
Error return example:
{
"code": 29100,
"result": "Parent Id cannot be null"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
result string Error message
Create a login account
Brief description:
This interface is used to create a login account under a certain user node.
Request URL:
${service_url}/user?accessToken={your_access_token}
Request method:
POST
Parameter:
Parameter name Required Type Description
accessToken yes string Identity Token
name yes string Login account display name
account yes string Login name, unique
organizationId yes Long AccountId in the user tree interface
password yes string Login account password,
format: 6 to 16 letters or numbers
contactTel no string contact number
contactUser no string Contact person
Request example:
POST ${service_url}/user?accessToken=6dc15642d36311e893efea0ac10a880e
{
"name": "Test User 2",
"account": "Test User 2",
"organizationId": 3,
"password": "123456",
"contactTel": "13611113333",
"contactUser": "Contact person"
}
Correct return example:
{
"code": 0
}
Error return example:
{
"code": 29101,
"result": "The login name already exists"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
result string Error message
Get device list by user
Brief description:
This interface returns a paged list of all devices under the specified user
Request URL:
${service_url}/device?accessToken={your_access_token}&id={account_id}¤tPage={currentPage}&page
Size={pageSize}&needCount={needCount}
Request method:
GET
Parameter:
Parameter name Required Type Description
accessToken yes string Identity Token
id no string The login user ID is taken by default,
which can only be the login person
or a sub-user of the login person.
needCount yes Boolean Whether to paging parameter, pass
true.
currentPage yes Int Current page number, starting from
1 by default
pageSize yes Int The number of records per page, the
maximum is 100, the system default
is 20, if it exceeds 100, the value is
100
Successful return example:
{
"code": 0,
"data": [
{
"imei": "668613160068309",
"mobile": "18699999998",
"deviceName": "testsjc41918B",
"isWireless": 1,
"platformEndTime": 1536221412
}
],
"page": {
"pageSize": 5,
"currentPage": 3,
"count": 180
}
}
Error return example:
{
"code": 28000,
"result": "There is no permission to access this user"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
data list Return data list
page Object Return the pagination object
Return the pagination object:
Parameter name Type Description
pageSize Int Number of records per page
currentPage Int Current page number
count Int Total
Return data list:
Parameter name Type Description
imei String Device No.
deviceName String Device Name
mobile String SIM card number
isWireless Int Whether it is a wireless device,
1:True, 0:False
platformEndTime Long Platform expiration time (UNIX
timestamp, unit: second)
Vehicles
Add vehicles and bind equipment
Brief description:
This interface is used to add a new vehicle and bind equipment.
Request URL:
${service_url}/vehicle?accessToken={your_access_token}
Request method:
POST
Parameter:
Parameter name Required Type Description
accessToken yes string Identity Token
vin yes string Frame number,
check whether it is an international
standard frame number
licenseNumber yes string License plate number,
check whether it is a standard
license plate number
carOwner yes string Owner's name
contactUser no string Contact person
contactTel no string Contact number
contractNumber no string Contract No
data yes list Binding device list parameters
Binding device list parameters:
Parameter name Required Type Description
imei yes string Device No.
name yes string Device name
cardNo yes string SIM card number
note no string Remarks information
Request example:
POST ${service_url}/vehicle?accessToken=6dc15642d36311e893efea0ac10a880e
{
"data": [
{
"name": "Test Demo 1",
"cardNo": "18699999998",
"imei": "868120167179600",
"note": "Note Information 1"
}
],
"vin": "U9CWJ5X05KDTUT1X1",
"carOwner": "Test car owner 1",
"contactUser": "Contact 1",
"licenseNumber": "Y Z34567",
"contractNumber": "PW1101AG103",
"contactTel": "18988888889"
}
Correct return example:
{
"code": 0
}
Error return example:
{
"code": 26013,
"result": "Enter less one license plate number and frame number"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
result string Error message
Unbind vehicles in batches
Brief description:
This interface is used to unbind devices from vehicles in batches.
Note: The number of devices cannot exceed 500 in a single call to this interface.
Request URL:
${service_url}/device/unbind/vehicle?accessToken={your_access_token}
Request method:
PUT
Parameter:
Parameter name Required Type Description
accessToken yes string Identity Token
imeis yes Array An array of device numbers, the
imcome device number will be
checked for permission, whether the
device belongs to the currently
logged-in user node
Request example:
PUT ${service_url}/device/unbind/vehicle?accessToken=6dc15642d36311e893efea0ac10a880e
{
"imeis": [
"868120162158866",
"668613120010105"
]
}
Correct return example:
{
"code": 0
}
Error return example:
{
"code": 26014,
"result": "The number of devices cannot exceed 500"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
result string Error message
Query devices status by car
Brief description:
This interface returns the real-time status of the vehicle bound device.
Request URL:
${service_url}/vehicle/status?accessToken={your_access_token}&content={content}
Request method:
GET
Parameter:
Parameter name Required Type Description
accessToken yes string Identity Token
content yes string Complete frame number or license
plate number (only for cars without
frame number and license plate
number)
Successful return example:
{
"code": 0,
"data": [
{
"imei": "864296100067197",
"status": "Drive",
"lng": "113.659790",
"lat": "23.210436",
"speed": 34,
"course": 357,
"accStatus": false,
"positionType": "GPS",
"licenseNumber": "蒙 D92566",
"vin": "UU6JA69691D713831",
"statusTimeDesc": "1 hour 20 minutes 15 seconds",
"signalTime": 1507345418,
"activateTime": 1497345418,
"simEndTime": 1541995200,
"platformEndTime": 1920686400,
"endTime": 1920686400,
"chargePercentage": 50,
"gpsTime": 1920686400,
"isWireless": 0,
"address": "139 meters southeast of Qingyuan District, Pujie Nenghua, Wuyuan Road, Pucheng
County, Weinan City, Shaanxi Province",
"extVoltage": 750,
"sim": "15216609313",
"carOwner":"hcx",
"contractNumber":"4444",
"contactUser":"123",
"contactTel":"13262677908"
}
]
}
Error return example:
{
"code": 21012,
"result": "Please enter the correct license plate number or frame number"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
data List Return data list.
Return data list:
Parameter name Type Description
imei String Device No.
status String State description: static,
moving, sleep, inactive,
offline.
lng String longitude
lat String latitude
speed Int speed
course Int Heading, turn from 0 to 360
degrees, 0 means north,
clockwise.
accStatus Boolean ACC status, true means open,
false means closed.
positionType String Positioning type,
GPS/LBS/WiFi
licenseNumber String License number
vin String Frame number
statusTimeDesc String State duration
signalTime Long Last signal time
activateTime Long Activation time
simEndTime Long Device card expiration time
platformEndTime Long Platform expiration time
endTime Long User expiration time, the
devices expiration time
marked by the user.
chargePercentage Int Wireless device power 0~100
gpsTime Long Positioning time
isWireless Int Whether it is a wireless
device, 1: wireless, 0: wired
address String 139 meters southeast of
Pujie Nenghua Qingyuan
Community, Wuyuan Road,
Pucheng County, Weinan
City, Shaanxi Province.
extVoltage Int External power supply
voltage, in units of 0.1V. Only
specific models have this
data.
sim String Sim card number
carOwner String Car owner
contractNumber String Contract No
contactUser String Contact person
contactTel String Contact number
Real-time location information of the device
Brief description:
This interface returns the real-time location information of the device.
Request URL:
${service_url}/device/location?accessToken={your_access_token}&imei={imei}
Request method:
GET
Devices
Create vehicles in bulk or modify vehicle information
Brief description:
This interface is used to create vehicles and modify vehicle information in batches.
Request URL:
${service_url}/device?accessToken={your_access_token}
Request method:
POST
Parameter:
Parameter name Required Type Description
accessToken yes string Identity Token
data yes list Device array
Device array:
Parameter name Required Type Description
imei yes string Device No.
deviceName yes string Device name, up to 20 characters in
length.
mobile yes string Device SIM card number
type no string Device SIM card number
vin Required when string Frame number
creating
licenseNumber no string Number plate
carOwner no string Owner's name
account no string Login account name
Request example:
POST ${service_url}/device?accessToken=6dc15642d36311e893efea0ac10a880e
{
"data": [
{
"imei": "868120162158920",
"type": "GM06",
"vin": "Frame Number",
"account": "demo",
"licenseNumber": "沪 A12345",
"mobile": "1061611112222",
"deviceName": "Device Name",
"carOwner": "Car Owner's Name"
}
]
}
Correct return example:
{
"code": 0,
"failImeis": [
{
"imei": "868120162158920",
"code": 26003,
"message": "Wrong device type: G001"
}
]
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
others: failure.
failImeis list List of device numbers that
failed to create or modify.
Query device status:
Brief description:
This interface returns the real-time status of the specified device or the real-time status of the device
under the specified account.
Request URL:
${service_url}/device/status?accessToken={your_access_token}&imei={your_imei}&account={account}
Request method:
GET
Parameter:
Parameter name Required Type Description
accessToken yes string Identity Token
imei Choose one string Means to query by device number,
from account. multiple device numbers separated
by English commas, support up to 50
units.
account Choose one string Sub-account login name, optional,
from imei. default query all devices under the
logged-in user (excluding sub-user’s)
Successful return example:
{
"code": 0,
"data": [
{
"imei": "864296100067197",
"status": "Drive",
"lng": "121.158516",
"lat": "31.304024",
"speed": 34,
"course": 357,
"accStatus": false,
"positionType": "GPS",
"licenseNumber": "蒙 D92566",
"vin": "UU6JA69691D713831",
"statusTimeDesc": "1 hour 20 minutes 15 seconds",
"signalTime": 1507345418,
"activateTime": 1497345418,
"simEndTime": 1541995200,
"platformEndTime": 1920686400,
"endTime": 1920686400,
"chargePercentage": 50,
"gpsTime": 1920686400,
"extVoltage": 750,
"sim": "15216609313",
"workMode": {
"type": 2,
"interval": 86400,
"workTime": "13:38",
"alarmTimes": [
"00:10",
"12:10",
"23:10"
],
"totalTime": 3600,
"week": "1234"
}
"accountId": 10018245,
"accountName": "15216609313",
"userName": "15216609313"
}
]
}
Error return example:
{
"code": 21002,
"result": "The device number does not exist"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
others: failure.
data list Return data list
Return data list:
Parameter name Type Description
imei String Device No.
status String State description: static,
moving, sleep, inactive,
offline.
lng String longitude
lat String latitude
speed Int speed
course Int Heading, turn from 0 to 360
degrees, 0 means north,
clockwise.
accStatus Boolean ACC status, true means open,
false means closed.
positionType String Positioning type,
GPS/LBS/WiFi
licenseNumber String License number
vin String Frame number
statusTimeDesc String State duration
signalTime Long Last signal time
activateTime Long Activation time
simEndTime Long Device card expiration time
platformEndTime Long Platform expiration time
endTime Long User expiration time, the
devices expiration time
marked by the user.
chargePercentage Int Wireless device power 0~100
gpsTime Long Positioning time
isWireless Int Whether it is a wireless
device, 1: wireless, 0: wired
extVoltage Int External power supply
voltage, in units of 0.1V. Only
specific models have this
data.
sim String Sim card number
workMode.type Int Modes:
1: chase mode,
2: normal mode,
3: week mode,
4: alarm mode
workMode.interval Int Upload interval seconds
workMode.workTime String Operating hours
workMode.alarmTimes Array Alarm clock working time
workMode.totalTime Int Duration in chase mode
workMode.week Long The week setting of the week
mode, "1234" means
Monday to Thursday.
accountName String User ID
userName String Displayed name (repeatable)
Real-time location information of the device
Brief description:
This interface returns the real-time location information of the device.
Request URL:
${service_url}/device/location?accessToken={your_access_token}&imei={imei}
Request method:
GET
Request parameter description:
Parameter name Required Type Description
accessToken yes string Identity token
imei yes string Device No.
Successful return example:
{
"code": 0,
"lng": "121.422861",
"lat": "31.382911",
"address": "29 meters near the Shenqiu Lianchi Hotel, 1960 Wenchuan Road, Baoshan District,
Shanghai"
}
Error return example:
{
"code": 21003,
"result": "No permission to access the device"
}
Return parameter description:
Parameter name Type Description
code Int Error code, 0: success,
others: failure
lng String Longitude wgs84ll coordinate
system.
lat String Latitude wgs84ll coordinate
system.
address String Address
History playback of a single device
Brief description:
This interface returns the historical track of a single device.
Request URL:
${service_url}/device/track/history?accessToken={your_access_token}&imei={your_imei}&startTime={
unix_time}&endTime={unix_time}&coordType={coordType}&onlyGps={onlyGps}
Request method:
GET
Request parameter description:
Parameter name Required Type Description
accessToken yes string Identity token
imei yes string Device No.
startTime yes String Query start time
endTime no String The query end time, do not fill in the
current time, the span cannot
exceed 1 month, only data within 9
months can be obtained.
coordType no String Coordinate system type, wgs84 may
not be transmitted as the geodetic
coordinate system, bd09ll is the
Baidu coordinate system (Baidu
map), and gcj02 is the Mars
coordinate system (Gold, QQ,
Google Map).
onlyGps no Int Only return GPS positioning type
trajectory, 1 means return only GPS
positioning type trajectory, 0 or not
to return all positioning type
trajectories.
Successful return example:
{
"code": 0,
"data": [
{
"imei": "866305000090031",
"lng": "121.435176",
"lat": "31.386734",
"speed": 0,
"course": 357,
"accStatus": false,
"positionType": "GPS",
"gpsTime": 1515324596
}
]
}
Error return example:
{
"code": 21008,
"result": "The time span cannot exceed 1 month"
}
Return parameter description:
Parameter name Type Description
code Int Error code, 0: success,
others: failure
imei String Devices No.
lng String Longitude
lat Int Latitude
speed Int Speed
course Boolean Heading, turn from 0 to 360
degrees, 0 means north,
clockwise.
accStatus String ACC status, true means open,
false means closed.
positionType String Positioning type,
GPS/LBS/WiFi
gpsTime Long Positioning time
Single device alarm record
Brief description:
This interface returns the alarm record of a single device.
Request URL:
${service_url}/device/alarm?imei={your_imei}&startTime={unix_time}&endTime={unix_time}&accessT
oken={your_access_token}
Request method:
GET
Request parameter description:
Parameter name Required Type Description
accessToken yes string Identity token
imei yes string Device No.
startTime yes String Query start time
endTime no String The query end time, do not fill in the
current time, the span cannot
exceed 1 month, only data within 9
months can be obtained.
Successful return example:
{
"code": 0,
"details": [
{
"imei": "866305000090031",
"lng": "121.435176",
"lat": "31.386734",
"speed": 0,
"course": 357,
"accStatus": false,
"positionType": "GPS",
"time": 1515324596,
"alarmCode": "REMOVE",
"alarmTime": 1519786512,
"deviceType": 1,
"alarmType": 1
}
]
}
Error return example:
{
"code": 21008,
"result": "The time span cannot exceed 1 month"
}
Return parameter description:
Parameter name Type Description
code Int Error code, 0: success,
others: failure
imei String Devices No.
lng String Longitude
lat Int Latitude
speed Int Speed
course Boolean Heading, turn from 0 to 360
degrees, 0 means north,
clockwise.
accStatus String ACC status, true means open,
false means closed.
positionType String Positioning type,
GPS/LBS/WiFi
time Long Positioning time
deviceType Long Device type :
1-wired device
2-wireless device
alarmType Long Alarm type
Alarm code description:
Alarm code Corresponding type
REMOVE Disassemble, light sensor, power off
LOWVOT Low power
ERYA Two bet
FENCEIN Into the fence
FENCEOUT Out of the fence
SEP Separation
SOS SOS alarm
OVERSPEED Overspeed alarm
HOME Abnormal permanent residence (home)
COMPANY Abnormal permanent residence (company)
ACCOFF Parking
ACCON Start
Count the number of equipment status
Brief description:
This interface returns the number of devices counted by status under a certain user node.
Request URL:
${service_url}/device/status/statistic?accessToken={your_access_token}&account={account}
Request method:
GET
Request parameter description:
Parameter name Required Type Description
accessToken yes string Identity token
account yes string Sub-account (login name) is
optional, the current login account is
queried by default.
Successful return example:
{
"code": 0,
"staticNum": 6,
"moveNum": 1,
"offlineNum": 7,
"unusedNum": 13
}
Error return example:
{
"code": 25001,
"result": "Wrong sub-account: {wrong parameter}"
}
Return parameter description:
Parameter name Type Description
code Int Error code, 0: success,
others: failure
staticNum Int Static quantity
moveNum Int Number of moves
offlineNum Int Number of offline
unusedNum Int Unused quantity
Mileage statistics
Brief description:
This interface returns the mileage and operating time of a single device over a period of time.
Request URL:
${service_url}/device/miles?accessToken={your_access_token}&startTime={startTime}&endTime={end
Time}&imei={imei}
Request method:
GET
Request parameter description:
Parameter name Required Type Description
accessToken yes string Identity token
imei yes string Device No.
startTime yes String Query start time
endTime no String The query end time, do not fill in the
current time, the span cannot
exceed 1 month, only data within 9
months can be obtained.
Successful return example:
{
"code": 0,
"runTime": 1800,
"miles": 35.072
}
Error return example:
{
"code": 21003,
"result": "No permission to access the device"
}
Return parameter description:
Parameter name Type Description
code Int Error code, 0: success,
others: failure
runTime Int Running time, in seconds
miles Double In kilometer
Check device location information by user
Brief description:
This interface returns the real-time location information of the device.
Request URL:
`${service_url}/device/locations/search-by-
organization?accessToken={your_access_token}&accountId={accountId}&isTakeSub={isTaskSub}
Request method:
GET
Request parameter description:
Parameter name Required Type Description
accessToken yes String Identity token
accountId no Long User Id (default to log in user Id)
isTakeSub no Int Whether to include subordinates (1
includes, does not pass does not
include)
Successful return example:
{
"code": 0,
"data": [{
"imei": "866551034000471",
"lng": "115.561935",
"lat": "37.550705"
}]
}
Error return example:
{
"code": 28000,
"result": "There is no permission to access this user"
}
Return parameter description:
Parameter name Type Description
code Int Error code, 0: success,
others: failure
lng String Longitude wgs84ll coordinate
system
lat String Latitude wgs84ll coordinate
system
Resolve address into latitude and longitude to set home address
and work address
Brief description:
Resolve address into latitude and longitude to set home address and work address
Request URL:
${service_url}/address/to/geo
Request method:
POST
Parameter :
Parameter name Required Type Description
accessToken yes String Identity token
imei yes String Device No.
homeAddress no String Family address
companyAddress no String Working address
Request example:
POST ${service_url}/address/to/geo?accessToken=6dc15642d36311e893efea0ac10a880e
{
"imei": "864298010048762",
"homeAddress": "Baoshan District, Shanghai",
"companyAddress": "Shanghai Railway Station"
}
Correct return example:
{
"resultBean": {
"code": 0
}
}
Error return example:
{
"resultBean": {
"code": 52001,
"result": "The device number cannot be empty"
}
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
result string Error message
Add fence to equipment
Brief description:
The user of this interface gets the fence of adding a certain device or certain devices
Request URL:
${service_url}/fence/add?accessToken={your_access_token}
Request method:
POST
Parameter :
Parameter name Required Type Description
accessToken yes String Identity token
imei yes String Device No.
fenceName no String Fence name
triggerType yes Integer 1 alarm for entering the fence, 2
alarm for the fence, 3 alarms for
both entering and leaving the fence.
oneTime yes Integer Whether it only used once,
1: yes, once
0: no, multiple times
createByAddress no Integer Whether to create according to the
address (currently only supports
circular fences)
1: Yes,
others: No
type Required when String Fence type
createByAddress != 1: area fence,
1 2: round fence
mapType no Integer Coordinate type:
1: Baidu coordinate
0: Mars coordinate Not fill in or
other WGS84
setting Required when string "101.857706 22.575529 368"
createByAddress != Circular fence: "Latitude and
1 longitude radius (m)",
regional fence: "cityId"
cityId Required when Integer National standard area ID
createByAddress =
1
address Required when String Detailed address (street, house
createByAddress = number)
1
radius Required when Integer Radius of circular fence (m)
createByAddress =
1
Example of creating a circular fence based on latitude and longitude:
POST ${service_url}/fence/add?accessToken=your_access_token
{
"triggerType":1,
"imei":"868120162158934",
"mapType":1,
"oneTime":1,
"setting":"101.857706 22.575529 368",
"type":2,
"fenceName":"8934's fence"
}
Example of request to create an area fence:
POST ${service_url}/fence/add?accessToken=your_access_token
{
"triggerType":1,
"imei":"868120162158934",
"type": 1,
"oneTime":1,
"fenceName":"8934's fence",
"setting": "310000"
}
Successful return example:
{
"code": 0,
}
Error return example:
{
"code": 45159,
"result": "Unsupported fence type"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
result string Error message
Query equipment fence
Brief description:
The user of this interface gets the fence of adding a certain device or certain devices
Request URL:
${service_url}/fence/query?accessToken={your_access_token}&imei={imei}&mapType={mapType}
Request method:
GET
Parameter :
Parameter name Required Type Description
accessToken yes String Identity token
mapType yes Integer Coordinate type 1 Baidu coordinate
0 Mars coordinate Not fill in or other
WGS84.
imei Yes String Devices No.
Request example:
`GET ${service_url}/fence/query?
imei=868120162158934&mapType=1&accessToken=8a9a474087ad11ea921100ff460cff6c
Successful return example:
{
"fenceBeanList": [
{
"fenceId": 1141370044,
"fenceName": "cesjksdfj",
"type": 2,
"triggerType": 1,
"setting": "101.857709 22.575532 368",
"isValid": 1,
"oneTime": 1,
"createTime": 1587901917000,
"creatorName": "Experience account"
}
],
"resultBean": {
"code": 0,
"result":
}
}
Return parameter description:
Parameter name Type Description
fenceId Int Fence ID
fenceName Int Fence name
type Int Fence type
triggerType Int Trigger fence type
setting String Fence settings
code Int Error code, 0: success,
Other: failed
result String Error message
Device fence deletion
Brief description:
The user of this interface gets the fence of adding a certain device or certain devices
Request URL:
${service_url}/fence/del/{fenceId}?imei={imei}&accessToken={your_access_token}
Request method:
DELETE
Parameter :
Parameter name Required Type Description
accessToken yes String Identity token
fenceId yes Integer Fence ID
imei yes String Device No.
Request example:
DELETE ${service_url}/fence/del/1141370043?accessToken=8a9a474087ad11ea921100ff460cff6c
Successful return example:
{
"resultBean": {
"code": 0
"message":
}
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
result string Error message
Command
Send cut off Petrol/Electricity commands for wired devices
Brief description:
This interface is used to send wired fuel and electricity off instructions.
Request URL:
${service_url}/instruction/relay?accessToken={your_access_token}
Request method:
POST
Parameter :
Parameter name Required Type Description
accessToken yes String Identity token
parameter yes String "1": turn on the oil and electricity,
"2": turn off the oil and electricity,
"3": query the status of the oil and
electricity
imeis yes List Device number array
Request example:
POST ${service_url}/instruction/relay?accessToken=6dc15642d36311e893efea0ac10a880e
{
"parameter": "1",
"imeis": [
"668613160058309",
"864297400021414"
]
}
Correct return example:
{
"code": 0,
"details": [
{
"code": 23007,
"imei": "864297400021414",
"result": "The device number does not support command sending"
},
{
"code": 0,
"uuid": "263",
"imei": "668613160058309"
}
]
}
Error return example:
{
"code": 23001,
"result": "parameter cannot be empty"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
details List Command response result list
Command response result list
Parameter name Type Description
code Int Error code, 0: success,
Other: failed
imei String Command response result list
result String Reason for failure
uuid Int You can query the execution
result of the command based
on this return value.
Wireless device positioning frequency setting
Brief description:
This interface is used for wireless device positioning frequency setting.
Request URL:
${service_url}/instruction/rate?accessToken={your_access_token}
Request method:
POST
Parameter :
Parameter name Required Type Description
accessToken yes String Identity token
timePoint yes String Daily online time range: [00:00,
23:59]
rate yes Int Online frequency range [1, 60]
minutes, timePoint and rate are two
options.
imeis yes List Device number array
Request example:
POST ${service_url}/instruction/rate?accessToken=6dc15642d36311e893efea0ac10a880e
{
"imeis": [
"668613120027791",
"868120162003542",
"868120262258968"
],
"timePoint": "hh:mm",
"rate": 15
}
Correct return example:
{
"code": 0,
"details": [
{
"code": 23007,
"imei": "868120262258968",
"result": "The device does not support command sending"
},
{
"code": 0,
"uuid": "1238",
"imei": "668613120027791"
},
{
"code": 0,
"uuid": "1239",
"imei": "868120162003542"
}
]
}
Error return example:
{
"code": 23005,
"result": "No access rights, IMEI: 668613120027791"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
details List Command response result list
Command response result list
Parameter name Type Description
code Int Error code, 0: success,
Other: failed
imei String Command response result list
result String Reason for failure
uuid Int You can query the execution
result of the command based
on this return value.
View instruction execution results
Brief description:
This interface returns the response information of the specific command execution number.
Request URL:
${service_url}/instruction/relay?accessToken={your_access_token}&uuid=19,20
Request method:
GET
Request parameter description:
Parameter name Required Type Description
accessToken yes String Identity token
uuid yes String Command execution number,
multiple can be separated by
commas
Successful return example:
{
"code": 0,
"details": [
{
"code": 0,
"uuid": "19",
"status": 0#1 has been executed, 0 means no response
},
{
"code": 0,
"uuid": "20",
"response": "Cut off the fuel supply: Success! Speed:0 km/h",
"status": 1
}
]
}
Error return example:
{
"code": 24001,
"result": "uuid cannot be empty"
}
Return parameter description:
Parameter name Type Description
code int Error code, 0: success,
Other: failed
details List Return data listt
Return data list:
Parameter name Type Description
code String Return code
uuid String Instruction execution number
response String Response message
status String Has been executed, 0 means
no response.
Data Dictionary
Error code description:
Error code Error code description
10001 App ID cannot be null
10002 time cannot be null
10003 signature incorrect
10004 user name and password incorrect
21001 IMEI cannot be null
21002 IMEI doesn’t exist
21003 No access to this device
21006 Begin time cannot be null
21007 Begin time cannot be later than end time
21008 Time duration cannot be over 1month
21009 data within 9months can be acquired
23001 Parameter cannot be null
23002 Parameter don’t support: {wrong parameter}
23004 IMEI format error, IMEI: {wrong parameter}
23005 No access permit, IMEI: {wrong parameter}
23007 commands not supported for this device
24001 Uuid cannot be null
24002 Wrong uuid: {wrong parameter}
24003 No access permit to check uuid: {wrong parameter}
25001 Wrong sub account: {wrong parameter}
25002 Not access permit to sub account: {wrong parameter}
26001 Please input device info
26002 Device created repeatedly
26003 Wrong device type: {wrong parameter}
26004 Wrong use info
26005 No access permit to operate user: {wrong parameter}
26006 Wrong IMEI format: {wrong parameter}
26007 Wrong plate number format: {wrong parameter}
26008 Device type required when create
26009 VIN number required when create
26010 Wrong VIN format: {wrong parameter}
26011 Maximum 20 characters supported for device name
26013 Return wrong status code when create vehicle
26014 Error reminder when device unbundle
27001 IMEI doesn’t exist: {wrong parameter}
27002 No operation access permit, IMEI: {wrong parameter}
28000 No permit to access this user
29000 Operation failed, please try again later
29001 Create an insurance policy and return an error status
29002 code
Please enter policy information
29003 Please enter the correct frame number or mobile phone
29100 number
Errors related to creating user tree nodes
29101 Errors related to creating a login account
Alarm code table:
Alarm code Corresponding type
REMOVE Disassemble, light sensor, power off, plug
LOWVOT Low power
ERYA Two bet
FENCEIN Into the fence
FENCEOUT Out of the fence
SEP Separate
SOS SOS alarm
OVERSPEED Speeding alarm
HOME Abnormal permanent residence (home)
COMPANY Abnormal permanent residence (company)
CRASH Collision alarm
ACCOFF Parking
ACCON Start up
SHAKE Shock
ACCELERATION Rapid acceleration
DECELERATION Slow down
TURN Sharp turn