Update screen ads
1、Update data once every 1 minute after the device is turned on
2、Update data every 20 minutes in the cabinet
3、Send MQTT command to update data immediately
Image format
Support: .jpg .png .jpeg
Video format
- Only support: .mp4 (AVC encoding)
- Video resolution cannot be larger than the screen size: For example: video resolution->1080x1920, cannot be played normally under screen resolution->720x1280, will freeze or black screen)
- You can use HandBrake tool to convert format and resolution: https://github.com/HandBrake/HandBrake/releases/tag/1.9.2
Send command ▼
Subscribe to topic: /powerbank/{uuid}/user/get
Data format: JSON string
| Name | Identification code | Data type | Remarks |
|---|---|---|---|
| Command name | cmd | string | load_ad |
Update screen ads
text
{"cmd":"load_ad"}Command Reply △
None, But Trigger API request
API request
Request URL
GET
https://{host}/api/advert/rentbox/distribute/list?uuid=%s&position=%s&sign=%s
text
/api/advert/rentbox/distribute/listRequest parameters
| Name | Identification code | Required or not | Remarks |
|---|---|---|---|
| Server domain name | host | YES | Provided by the customer, for example: s.abc.com |
| Cabinet SN | uuid | YES | 4G communication module, IMEI number |
| Signal value | position | YES | Fixed value: screen |
| Interface signature | sign | YES | MD5 encryption |
Interface signature
text
sign=MD5("position={position}|uuid={uuid}")Response result
text
{
"code": 200,
"type": 0,
"data": [
{
"id": 10000704,
"title": "",
"fileType": 0,
"url1": "",
"url2": "http://sharingweb.oss-cn-shenzhen.aliyuncs.com/images/325555ec3dcfbe4f640cc910a003a6af.mp4", // 视频地址
"playTime": 5,
"weight": 0,
"screenBrightness": 255
},
{
"id": 10000702,
"title": "",
"fileType": 0,
"url1": "",
"url2": "http://sharingweb.oss-cn-shenzhen.aliyuncs.com/images/baebc5a5ce6e7a19ed8b4d0613b0a989.jpg", // 图片地址
"playTime": 5,
"weight": 0,
"screenBrightness": 255
},
{
"id": 10000701,
"title": "",
"fileType": 0,
"url1": "",
"url2": "http://sharingweb.oss-cn-shenzhen.aliyuncs.com/images/190bb74bd230b0c6f37f706a70629757.jpg", // 图片地址
"playTime": 5,
"weight": 0,
"screenBrightness": 255
}
],
"msg": "OK",
"time": 1716948821872
}| Name | Identification code | Type | Remarks |
|---|---|---|---|
| Status code | code | int | Default: 200 |
| Status type | type | int | Default: 0 |
| Custom data | data | json_array | Default: [] |
| Exception message | msg | string | Default: OK |
| Timestamp | time | long | Current millisecond timestamp |
| Name | Identification code | Type | Remarks |
|---|---|---|---|
| Number | id | int | Guaranteed unique |
| Ad title | title | string | Default: "" |
| File type | fileType | int | 1 picture 2 video |
| Horizontal screen ad address | url1 | string | Default: "" |
| Vertical screen ad address | url2 | string | Default: "" |
| Play time | playTime | int | Only valid for pictures, set the screen stay time |
| Media volume | weight | int | The larger the value, the higher the sorting |
| Screen brightness | screenBrightness | int | Range: 0-255 |


