# Segway API-T60

Welcome to the Segway API of Gateway. This API reference provides information on available endpoints and how to interact with them. Using the Segway API of Gateway, you can integrate vehicle data and control into your applications.
The API uses JSON formatted requests and responses.

Note1: please request the relevant domian according to the first letter of your platformcode

platformCode region domain
A***** apac https://apac-api.segwaydiscovery.com
E***** europe https://eu-api.segwaydiscovery.com
U***** americas https://us-api.segwaydiscovery.com
C***** china https://cn-api.segwaydiscovery.com

# Auth

# request token

This API is used to get a token for other APIs.

POST

/oauth/token

curl -X POST \
https://api_domain:port/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=A20081' \
--data-urlencode 'client_secret=e2651be5-12d3-48f3-ba6c-bc2b04a447b6' \
--data-urlencode 'grant_type=client_credentials'

Header

field type description
Content-Type String allowed: "application/x-www-form-urlencoded"

Parameter

field type description
client_id String get from business system
client_secret String get from business system
grant_type String allowed: "client_credentials"

Success

field type description
access_token String token
token_type String allowed values: "bearer"
expires_in Int expiration duration seconds.
scope String scope.
HTTP/1.1 200 OK
{
    "access_token": "83efe135-8203-404c-b489-b5fbf8050d3d",
    "token_type": "bearer",
    "expires_in": 43199,
    "scope": "read write trust"
}

False

1.0 HTTP/1.1 401 Unauthorized
{ 
    "error": "invalid_client",
    "error_description": "Bad client credentials"
}

# Control

# unlock

This API is used to unlock the vehicle.

POST

/api/v2/vehicle/control/t60/unlock

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/t60/unlock \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116"
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer token"

Parameter

field type description
iotCode String IoT IMEI

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593331167570,
    "opId": "d5aa020d-77ae-439c-892c-a781c71eb836"

}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15611 device unlock command failed
11 15612 device unlock failed: network error
12 15704 the device is in dormancy
13 15990 API call is restricted, please contact Segway related personnel
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# lock

This API is used to lock the vehicle.

POST

/api/v2/vehicle/control/t60/lock

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/t60/lock \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116"
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer token"

Parameter

field type description
iotCode String IoT IMEI

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15600 lock failed: vehicle is riding
11 15601 device lock command failed
12 15602 device lock failed: network error
13 15704 the device is in dormancy
14 15990 API call is restricted, please contact Segway related personnel
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# Teleoperation mode

This API is used to switch the scooter into or out of teleoperation mode.

POST

/api/v2/vehicle/control/teleoperation

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/teleoperation \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116",
    "mode" : 1,
    "state" : 1
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String IoT IMEI
mode Boolean 0→ turn off. 1→ turn on
state Number 0 idle. 1 control. 2 smartControl
Allowed values: 0,1,2
Default: idle

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15701 the device is unlocked
11 15704 the device is in dormancy
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# rangelight

This API is used to turn the vehicle's rangelight on or off. ONLY available in teleoperation mode.

POST

/api/v2/vehicle/control/t60/rangelight

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/t60/rangelight \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116",
    "controlType" : 0
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String IoT IMEI
controlType String 0→ turn off. 1→ turn on

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15702 the device is not in teleoperation mode
11 15704 the device is in dormancy
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# headlight

This API is used to turn the vehicle's headlight on or off. ONLY available in unlock state.

POST

/api/v2/vehicle/control/t60/headlight

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/t60/headlight \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116",
    "controlType" : 0
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String IoT IMEI
controlType String 0→ turn off. 1→ turn on

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15709 the device is not in unlock state
11 15704 the device is in dormancy
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# speedlimit

This API is used to set speed limit for the device.

POST

/api/v2/vehicle/control/robot-speed-limit

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/robot-speed-limit \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116",
    "speed" : 200
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String IoT IMEI
speed Number speed limit range: [100,700] (cm/s)

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15709 the device is not in unlock state
11 15704 the device is in dormancy
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# throttle response

This API is used to turn the vehicle's throttle response on/off.

POST

/api/v2/vehicle/control/t60/throttle-response

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/t60/throttle-response \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116",
    "controlType" : 1
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String IoT IMEI
controlType String 0→ turn off. 1→ turn on

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15704 the device is in dormancy
11 15705 throttle control failed
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# alarm on/off

This API is used to turn the vehicle's alarm trigger on/off.

POST

/api/v2/vehicle/control/robot-alarm

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/robot-alarm \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116",
    "controlType" : 1
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String IoT IMEI
controlType String 0→ turn off. 1→ turn on

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15704 the device is in dormancy
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# battery component

This API is used to open the battery compartment.

POST

/api/v2/vehicle/control/t60/battery-cover

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/t60/battery-cover  \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116"
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String iot imei

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15704 the device is in dormancy
11 15706 battery cover control failed
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# move

This API is used to move the scooter in teleoperation mode. ONLY available in control&smartcontrol state.

POST

/api/v2/vehicle/control/move

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/move  \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116",
    "state" : 0,
    "direction" : 0
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String iot imei
state Number 0 control; 1 smartcontrol
Allowed values: 0,1
Need to be the same as the state now on the scooter.
direction Number 0 forward; 1 forward right; 2 right; 3 backward right; 4 backward; 5 backward left; 6 left; 7 forward left; 8 stop; 9 reset
Allowed values: 0, 1,2,3,4,5,6,7,8,9(control state)
0,1,2,3,4,5,6,7,8(smartcontrol state)

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15702 the device is not in teleoperation mode
11 15703 wrong state
12 15704 the device is in dormancy
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# select video type

This API is used to select the video flow type in teleoperation mode.

POST

/api/v2/vehicle/control/video-type

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/video-type  \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116",
    "controlType" : 0
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String iot imei
controlType Number 0 normal; 1 processed
Allowed values: 0,1

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15702 the device is not in teleoperation mode
11 15704 the device is in dormancy
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# reboot

This API is used to reboot the scooter.

POST

/api/v2/vehicle/control/reboot

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/reboot \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116"
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String IoT IMEI

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15704 the device is in dormancy
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# shutdown

This API is used to make the scooter power off. ONLY available in lock state.

POST

/api/v2/vehicle/control/shutdown

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/shutdown \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116"
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String IoT IMEI

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15704 the device is in dormancy
12 15708 the device is not in lock state
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# quit emergency stop

This API is used to quit emergency mode(caused by squeezing the brake). ONLY available in teleopration mode

POST

/api/v2/vehicle/control/emergency-stop

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/emergency-stop \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116"
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String IoT IMEI

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15702 the device is not in teleoperation mode
11 15704 the device is in dormancy
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# magnifier

This API is used to turn the magnifier in the video on/off.

POST

/api/v2/vehicle/control/magnifier

curl -X POST \
https://api_domain:port/api/v2/vehicle/control/magnifier \
--header 'Authorization: bearer f3bbd782-04c7-42e5-bed9-524cde3eb415' \
--header 'Content-Type: application/json' \
--data '{
    "iotCode" : "861477038719116",
    "controlType" : 1,
    "positionX" : 0.5,
    "positionY" : 0.5
}'

Header

field type description
Content-Type String allowed: "application/json"
Authorization String allowed: "bearer access_token"

Parameter

field type description
iotCode String IoT IMEI
controlType String 0→ turn off. 1→ turn on
positionX Double A coordinate depends on the video.
allowed values: [0,1]
positionY Double A coordinate depends on the video.
allowed values: [0,1]

Success

field type description
code Number status code
msg String messages
data Object response data
t Number timestamp
opId String operation Id
HTTP/1.1 200 OK
{
    "code": 0,
    "msg": "Success",
    "data": null,
    "t": 1593333983900,
    "opId": "bf84e6aa-8787-4b2d-8461-e91aba35b07e"
}

False

sn code error
1 15101 token verification failed
2 15004 parameter error
3 15001 server error
4 15102 device not found
5 15300 inactive device
6 15301 offline device
7 15302 device response timeout
8 15303 command send failed
9 15500 device upgrading: command can not be executed
10 15702 the device is not in teleoperation mode
11 15704 the device is in dormancy
HTTP/1.1 200 OK
{
    "code": 15302,
    "msg": "device response timeout",
    "data": null,
    "t": 1593333694412,
    "opId": "3de041d2-7f1e-4cb2-a7be-483378727c56"
}

# Push

If your server has received any one of the following types of pushes and successfully processes it, please return an HTTP response code of 200. Otherwise, our server will retry in 5 seconds, this retry will only be done once.

signature generation algorithm
Note: All received parameters except signature are involved in the verification process.
Step 1: If the received data is a String, use “&” and “=” to split the String into several key-value pairs. If the received data is an array, dict, or similar data type, continue as usual and order the received key-value pairs sequentially by ASCII.
Step 2: Convert the sorted dict back into a String in “key1=value1&key2=value2” form.
Step 3: Append “&client_secret=” to the String created during step 2.
Step 4: Use MD5 to calculate the hash value (finally converted into 32-bit hexadecimal characters) of the String created during step 3. The newly calculated value is your digital signature.
Next, compare this value with your signature. If they are the same, the signature verification was successful. • When performing signature verification, do not enumerate the signature fields according to the port documentation list.
All received parameters except signature are involved in the verification process. When performing signature verification, do not enumerate the signature fields according to the port documentation list. This will cause use many problems if new fields are created.

# vehicle location

This API should be exposed by your application system to receive the vehicle's location. When the scooter is unlocked, its location will be pushed once every 10 seconds. When the scooter is locked, its location will be pushed every 900 seconds.

POST

/v2/vehicle/t60/location

curl -X POST \
https://business:port/v2/vehicle/t60/location \
-header 'Content-Type: application/x-www-form-urlencoded' \
-data 'iotCode={iotCode}&platformCode={platformCode}&signature={signature}&locationStatus={locationStatus} \
&latitude={latitude}&longitude={longitude}&gpsSignal={gpsSignal}&gpsUtcTime={gpsUtcTime}'

Header

field type description
Content-Type String allowed: "application/x-www-form-urlencoded"

Parameter

field type description
iotCode String IoT IMEI
platformCode String -
locationStatus String allowed: 'invalid' and 'valid'
latitude Double latitude (WGS84).
longitude Double longitude (WGS84).
gpsSignal Double 0 unknown; 1 strong; 2 normal; 3 weak
Allowed values: 0, 1, 2,3
gpsUtcTime Long timestamp
signature String more info

response

field type description
message(optional) Boolean -
code Number allowed: 0
HTTP/1.1 200 OK
{        
        “message”:success,
        “code”: 0
}

# vehicle status

This API should be exposed by your application system to receive the changes of the scooter's status.

POST

/v2/vehicle/t60/status

curl -X POST \
https://business:port/v2/vehicle/t60/status \
-header 'Content-Type: application/x-www-form-urlencoded' \
-data 'iotCode={iotCode}&platformCode={platformCode}&signature={signature}&online={online}&locked={locked} \
&networkSignal={networkSignal}&charging={charging}&powerPercent={powerPercent} \
&speed={speed}&odometer={odometer}&odometer={odometer}&statusUtcTime={statusUtcTime}'

Header

field type description
Content-Type String allowed: "application/x-www-form-urlencoded"

Parameter

field type description
iotCode String IoT IMEI
platformCode String -
online Boolean true→ connected to SEGWAY Cloud. false→ disconnected
lock Integer 1→ lock. 0→unlock
networkSignal Integer network signal. range: 2-32. 2 shows the signal is weakest, 32 shows the signal is strongest.
charging Boolean true→charging. false→ no charging
powerPercent Integer battery percentage, 80->80%.
speed Integer scooter current speed.
odometer Double total odometer (unit is 1m, so 1230 means 1.23km
statusUtcTime Long get scooter status info's UTC time.
signature String more info

response

field type description
message(optional) Boolean -
code Number allowed: 0
HTTP/1.1 200 OK
{        
        “message”:success,
        “code”: 0
}

# extra vehicle status

This API should be exposed by your application system to receive the changes of the scooter's extra status.

POST

/v2/vehicle/extra/status

curl -X POST \
https://business:port/v2/vehicle/extra/status \
-header 'Content-Type: application/x-www-form-urlencoded' \
-data 'iotCode={iotCode}&platformCode={platformCode}&signature={signature}&teleoperation={teleoperation}&dormancy={dormancy} \
&emergencyStop={emergencyStop}&headlight={headlight}&navigationMileage={navigationMileage}&direction={direction}&angle={angle} \
&videoOn={videoOn}&videoType={videoType}&statusUtcTime={statusUtcTime}'

Header

field type description
Content-Type String allowed: "application/x-www-form-urlencoded"

Parameter

field type description
iotCode String IoT IMEI
platformCode String -
teleoperation Boolean true→ on. false→ off
dormancy Boolean true→ in. false->out
emergencyStop Boolean true→ on. false→ off
headlight Boolean true→ on. false→ off
navigationMileage Integer the mileage in navigation mode(m). '-1' means it's in parking mode.
direction Integer the direction of the scooter(degree) e.g. -10 means 10°west, 10 means 10°east.
angle String the angle of the handlebar(degree) e.g. -10 means 10°west, 10 means 10°east.
videoOn Boolean true→ on. false→ off
videoType String Road:路况视频;Normal:正常视频
statusUtcTime Long get scooter status info's UTC time.
signature String more info

response

field type description
message(optional) Boolean -
code Number allowed: 0
HTTP/1.1 200 OK
{        
        “message”:success,
        “code”: 0
}

# video info

This API should be exposed by your application system to receive the video infomation.

POST

/v2/vehicle/video-info

curl -X POST \
https://business:port/v2/vehicle/video-info \
-header 'Content-Type: application/x-www-form-urlencoded' \
-data 'iotCode={iotCode}&platformCode={platformCode}&signature={signature}&roomId={roomId}&token={token} \
&userId={userId}&appId={appId}&server={server}&statusUtcTime={statusUtcTime}

Header

field type description
Content-Type String allowed: "application/x-www-form-urlencoded"

Parameter

field type description
iotCode String IoT IMEI
platformCode String -
roomId String The zoom ID to get the video streaming.
token String the token used to login at video provider.
userId String the uer ID used to login at video provider.
appId String the app ID with video receiver for verification.
server String the address to get the video streaming.
statusUtcTime Long video info's UTC time.
signature String more info

response

field type description
message(optional) Boolean -
code Number allowed: 0
HTTP/1.1 200 OK
{        
        “message”:success,
        “code”: 0
}

# Appendix 1. Status code description

sn code error
1 15101 token verification failed
2 15100 incorrect platform info
3 15004 parameter error
4 15001 server error
5 15102 device not found
6 15300 inactive device
7 15301 offline device
8 15302 device response timeout
9 15303 command send failed
10 15400 latest location not found via device
11 15500 device upgrading: command can not be executed
12 15600 lock failed: vehicle is riding
13 15601 device lock command failed
14 15602 device lock failed: network error
15 15611 device unlock command failed
16 15612 device unlock failed: network error
17 15701 the device is unlocked
18 15702 the device is not in teleoperation mode
19 15703 wrong state
20 15704 the device is in dormancy
21 15705 throttle control failed
22 15706 battery cover control failed
23 15707 tts failed