Sunmi Remote API

Interfaces for Basic Remote Assistance Capabilities

Request Header and Signature

Field Name Default Value Required Description
Sunmi-Timestamp   Yes 10-digit time stamp
Sunmi-Sign   Yes Signature encrypted
Sunmi-Nonce   Yes 6-digit random number
Sunmi-Appid   Yes The appid assigned
Source openapi Yes Fixed value openapi
  • Signature Algorithm: hmac256
  • Signing method: Sunmi-Sign = hmac256( json-body + appid + timestamp+ nonce , appkey)

Status Codes

  • 1: operation succeeded
  • 10000~19999: custom errors of business modules
  • 20000 : parameter missed for gateway verification
  • 20001 : request timeout
  • 30000 : developer identification failed
  • 30001 : insufficient developer permissions (to be implemented)
  • 40000 :signature verification failed
  • 50000 : server error
  • 50001 : gateway error

Host address:

Command related interfaces

————————————————————————————————

Request for Remote Control

Basic Info

Path: /v2/mdm/open/open/device/applyControl

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
msn string Yes   Device SN  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message  
data object Yes   Return data  
├─ uri string Yes   Address of the remote control page  

Get Device Online/Offline Status

Basic Info

Path /v2/mdm/open/open/device/onlineStatus

Method POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
msn_list string [] Yes   Device SN list Item type: string
├─   No   Device SN code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ list object [] Yes     item type: object
├─ msn string Yes   Device SN  
├─ status integer Yes   Status: 0-offline, 1-online  
├─ time integer Yes   When did the device goes online/offline: status=0, goes offline; status=1, goes online.  

Get Device Real-time Status

Basic Information

Path /v2/mdm/open/open/device/realTimeInfo

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
msn string Yes   Device SN  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message  
data object Yes   Return data  
├─ msn string Yes   Device SN  
├─ base object Yes      
├─ imei string Yes   Device IMEI  
├─ location string Yes   The location of the device  
├─ model string Yes   Device model  
├─ msn string Yes   Device SN  
├─ rom_version_code string Yes   Firmware version  
├─ romversion string Yes   ROM version  
├─ sysversion string Yes   System version  
├─ device object Yes      
├─ prtlength string Yes   Print length  
├─ prtsize string Yes   Printer size  
├─ resolution string Yes   Resolution  
├─ net object Yes      
├─ ethernet boolean Yes   Support Ethernet or not  
├─ ip string Yes   Current IP address of the device  
├─ intensity string Yes   3G signal strength  
├─ is3g boolean Yes   Support 3G or not  
├─ mac string Yes   MAC address  
├─ network_type integer Yes   Card 1 network type: 0-unknown, 1-GPRS, 2-EDGE, 3-UMTS, 4-CDMA, 5-EVDO_0, 6-EVDO_A, 7-1xRTT, 8-HSDPA, 9-HSUPA, 10-HSPA, 11-IDEN, 12-EVDO_B, 13-LTE, 14-EHRPD, 15-HSPAP, 16-GSM, 17-TD_SCDMA, 18-IWLAN, 19-LTE_CA, 20-NR  
├─ network_type1 integer Yes   Card 2 network type: 0-unkown, 1-GPRS, 2-EDGE, 3-UMTS, 4-CDMA, 5-EVDO_0, 6-EVDO_A, 7-1xRTT, 8-HSDPA, 9-HSUPA, 10-HSPA, 11-IDEN, 12-EVDO_B, 13-LTE, 14-EHRPD, 15-HSPAP, 16-GSM, 17-TD_SCDMA, 18-IWLAN, 19-LTE_CA, 20-NR  
├─ operator string Yes   Operator  
├─ sim string Yes   SIM card number  
├─ wifi boolean Yes   Support Wi-Fi or not  
├─ wifi_name string Yes   Wi-Fi name  
├─ wifi_rssi integer Yes   Wi-Fi signal strength  
├─ printer object Yes      
├─ model string Yes   Printer model  
├─ prt_anti_white integer Yes   Reversed type font  
├─ prt_bbm_distance string Yes   The distance the printer automatically moves in the black mark printing mode.  
├─ prt_bold integer Yes   Bold font: 0-no, 1-yes  
├─ prt_double_height integer Yes   Double height font: 0 – not enabled  
├─ prt_double_width integer Yes   Double width font: 0 – not enabled  
├─ prt_font_name string Yes   Font type: 0 – SUNMI font 1.0, 1 – SUNMI font 2.0  
├─ prt_mode string Yes   Print mode: 0 – normal, 1 – black mark printing  
├─ prt_paper string Yes   Print paper type: 0 – 80mm, 1 – 58mm  
├─ prt_row_height string Yes   Line height: -1 – not enabled; 0~255: the pixels that indicate the line height  
├─ prt_under_line integer Yes   Underline font: 0 – yes, 1 – no  
├─ prtlength string Yes   Print length  
├─ prtsize string Yes   Printer size  
├─ sn string Yes   Printer SN  
├─ version string Yes   Printer version No.  
├─ running object Yes      
├─ bpercent string Yes   Battery usage (%)  
├─ cpu string Yes   CPU frequency  
├─ charging boolean Yes   Charging or not  
├─ cpercent string Yes   CPU usage (%)  
├─ health integer Yes   Device test score  
├─ memory string Yes   Memory  
├─ mpercent string Yes   Memory usage (%)  
├─ temper string Yes   Temperature  
├─ voltage integer Yes   Voltage  
├─ storage object Yes      
├─ mem_total string Yes   Total memory  
├─ mem_used string Yes   Memory used  
├─ sd_total string Yes   Total SD card capacity  
├─ sd_used string Yes   SD card capacity used  

Get Device Real-time Traffic Usage

Issue Lock Device Command

Basic Information

Path /v2/mdm/open/open/cmd/lockDevice

Method POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
passwd string Yes   Lock device password  
screen_tip string Yes   Lock device prompt  
expire_date integer Yes   How long the device can be locked; currently only 7 and 30 are available.  
msn_list string [] Yes   MSN device list item type: string
├─   No   Device SN  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ cmd_job_key string Yes   Command job key  

Issue Power Off Command

Basic Information

Path: /v2/mdm/open/open/cmd/shutdown

Method: POST

Interface description:

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
msn_list string [] Yes   MSN device list item type: string
├─   No   Device SN code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ cmd_job_key string Yes   Command job key  

Issue Reboot Command

Basic Information

Path: /v2/mdm/open/open/cmd/reboot

Method: POST

Interface description:

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
msn_list string [] Yes   MSN device list item type: string
├─   No   Device SN code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ cmd_job_key string Yes   Command job key  

Send Notifications

Basic Information

Path: /v2/mdm/open/open/cmd/sendMessage

Method: POST

Interface description:

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
title string Yes   Title  
content string Yes   Content  
alert_type integer Yes   0 – no pop-up window,1 – pop-up window  
msn_list string [] Yes   MSN device list item type: string
├─   No   Device SN  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ cmd_job_key string Yes   Command job key  

Issue Clear Lock Screen Password Command

Basic Information

Path: /v2/mdm/open/open/cmd/clearScreenPwd

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
msn_list string [] Yes   MSN device list Item type: string
├─   No   Device SN  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ cmd_job_key string Yes   Command job key  

Create On/Off Timer Strategy

Basic Information

Path: /v2/mdm/open/open/strategy/timer/create

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
name string Yes   On/off timer name  
detail object Yes   On/off timer details  
├─ boot_time string Yes   When to turn on the device. Format: 06:00  
├─ shutdown_time string Yes   When to turn off the device. Format: 18:30  
├─ week_day integer [] Yes   Which day to execute the timer. 1 – Monday, 2 – Tuesday, 3 – Wednesday,etc. The number should be within 7. Item type: integer
├─   No   Which day in a week to execute the strategy  
├─ content string Yes   Remark  
msn_list string [] Yes   Device SN list Item type: string
├─   No   Device SN code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ strategy_code string Yes   Strategy code  

Update On/Off Timer Strategy

Basic Information

Path: /v2/mdm/open/open/strategy/timer/update

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
strategy_code string Yes   Strategy code  
name string Yes   On/off timer name  
detail object Yes   On/off timer details  
├─ boot_time string Yes   When to turn on the device. Format: 06:00  
├─ shutdown_time string Yes   When to turn off the device. Format: 18:30  
├─ week_day integer [] Yes   Which day to execute the timer. 1 – Monday, 2 – Tuesday, 3 – Wednesday,etc. The number should be within 7. Item type: integer
├─   No   Which day in a week to execute the strategy  
├─ content string Yes   Remark field  
msn_list string [] Yes   Device SN list Item type: string
├─   No   Device SN code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ strategy_code string Yes   Strategy code  

On/Off Timer Details

Basic Information

Path: /v2/mdm/open/open/strategy/timer/detail

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
strategy_code string Yes   Strategy code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message  
data object Yes   Return data  
├─ name string Yes   Strategy name  
├─ switch_status integer Yes   Status: 0 – off; 1 – on.  
├─ detail object Yes   Strategy details  
├─ boot_time string Yes   When to turn on the device. Format: 06:00  
├─ shutdown_time string Yes   When to turn off the device. Format: 18:30  
├─ week_day integer [] Yes   Which day to execute the timer. 1 – Monday, 2 – Tuesday, 3 – Wednesday,etc. The number should be within 7. Item type:integer
├─   No      
├─ content string Yes   Remark field  
├─ msn_list string [] Yes   Device SN list Item type: string
├─   No   Device SN code  

Create APN Strategy

Basic Information

Path: /v2/mdm/open/open/strategy/apn/create

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
name string Yes   APN strategy name  
detail object Yes   APN strategy details  
├─ apn string Yes   APN  
├─ type string Yes   APN type  
├─ proxy string No   APN proxy address  
├─ port string No   Port  
├─ uname string No   User name  
├─ passwd string No   Password  
├─ server string No   Server address  
├─ mmsc string No   mmsc  
├─ mms_proxy string No   mms proxy address  
├─ mms_port string No   Port  
├─ mcc string No   MCC  
├─ mnc string No   MNC  
├─ auth_type string No   Authentication type  
├─ apn_protocol string No   APN protocol  
├─ apn_roaming_protocol string No   APN roaming protocol  
├─ mvno_type string No   MVNO type  
├─ mvno_value string No   MVNO value  
msn_list string [] Yes   Device SN list Item type: string
├─   No   Device SN code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ strategy_code string Yes   Strategy code  

Update APN Strategy

Basic Information

Path: /v2/mdm/open/open/strategy/apn/update

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
strategy_code string Yes   Strategy code  
name string Yes   APN strategy name  
detail object Yes   APN strategy details  
├─ apn string Yes   APN  
├─ type string Yes   APN type  
├─ proxy string No   APN proxy address  
├─ port string No   Port  
├─ uname string No   User name  
├─ passwd string No   Password  
├─ server string No   Server address  
├─ mmsc string No   mmsc  
├─ mms_proxy string No   mms proxy address  
├─ mms_port string No   Port  
├─ mcc string No   MCC  
├─ mnc string No   MNC  
├─ auth_type string No   Authentication type  
├─ apn_protocol string No   APN protocol  
├─ apn_roaming_protocol string No   APN roaming protocol  
├─ mvno_type string No   MVNO type  
├─ mvno_value string No   MVNO value  
msn_list string [] Yes   Device SN list item type: string
├─   No   Device SN code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  

APN Strategy Details

Basic Information

Path: /v2/mdm/open/open/strategy/apn/detail

Method: POST

Interface description:

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
strategy_code string Yes   Strategy code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ name string Yes   APN strategy name  
├─ detail object Yes   APN strategy details  
├─ apn string Yes   APN  
├─ type string Yes   APN type  
├─ proxy string No   APN proxy address  
├─ port string No   Port  
├─ uname string No   User name  
├─ passwd string No   Password  
├─ server string No   Server address  
├─ mmsc string No   mmsc  
├─ mms_proxy string No   mms proxy address  
├─ mms_port string No   Port  
├─ mcc string No   MCC  
├─ mnc string No   MNC  
├─ auth_type string No   Authentication type  
├─ apn_protocol string No   APN protocol  
├─ apn_roaming_protocol string No   APN roaming protocol  
├─ mvno_type string No   MVNO type  
├─ mvno_value string No   MVNO value  
├─ msn_list string [] Yes   Device SN list Item type: string
├─   No   Device SN code  

Strategy Permission API

Strategy Permission API

Create Permission Strategy

Basic Information

Path: /v2/mdm/open/open/strategy/permission/create

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
name string Yes   Permission strategy name  
detail object [] Yes   Permission strategy details Item type: object
├─ app_package_list string [] Yes   APP package list Item type: string
├─   No   App package name  
├─ permission_list object [] Yes   Permission list Item type: object
├─ name string Yes   Permission name  
├─ status integer Yes    Status:0 – disabled,1 – enabled  
msn_list string [] Yes   Device SN list Item type: string
├─   No   Device SN code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  
├─ strategy_code string Yes   Strategy code  

Update Permission Strategy

Basic Information

Path: /v2/mdm/open/open/strategy/permission/update

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
strategy_code string Yes   Strategy code  
name string Yes   Permission strategy name  
detail object [] Yes   Permission strategy details Item type: object
├─ app_package_list string [] Yes   APP package list Item type: string
├─   No   App package name  
├─ permission_list object [] Yes   Permission list Item type: object
├─ name string Yes   Permission name  
├─ status integer Yes   Status:0 – disabled,1 – enabled  
msn_list string [] Yes   Device SN list Item type: string
├─   No   Device SN code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message mock: SUCCESS
data object No   Return data  

Permission Strategy Details

Basic Information

Path: /v2/mdm/open/open/strategy/permission/detail

Method: POST

Interface description

Request Parameter

Headers

Parameter Parameter Value Required Sample Note
Content-Type application/json Yes    

Body

Item Type Required Default Value Note Other Info
strategy_code string Yes   Strategy code  

Return Data

Item Type Required Default Value Note Other Info
code integer Yes   Return code  
msg string Yes   Return message  
data object No   Return data  
├─ name string Yes   Permission strategy name  
├─ detail object Yes   Permission strategy details  
├─ app_package_list string [] Yes   APP package list Item type: string
├─   No   App package name  
├─ permission_list object [] Yes   Permission list Item type: object
├─ name string Yes   Permission name  
├─ status integer Yes   Status:0 – disabled,1 – enabled  
├─ msn_list string [] Yes   Device SN list Item type: string
├─   No   Device SN code