Skip to content

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

  1. Only support: .mp4 (AVC encoding)
  2. 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)
  3. 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

NameIdentification codeData typeRemarks
Command namecmdstringload_ad

Update screen ads

{ "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/list

Request parameters

NameIdentification codeRequired or notRemarks
Server domain namehostYESProvided by the customer, for example: s.abc.com
Cabinet SNuuidYES4G communication module, IMEI number
Signal valuepositionYESFixed value: screen
Interface signaturesignYESMD5 encryption

Interface signature

text
sign=MD5("position={position}|uuid={uuid}")

Response result

json
{
    "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
}
NameIdentification codeTypeRemarks
Status codecodeintDefault: 200
Status typetypeintDefault: 0
Custom datadatajson_arrayDefault: []
Exception messagemsgstringDefault: OK
TimestamptimelongCurrent millisecond timestamp
NameIdentification codeTypeRemarks
NumberidintGuaranteed unique
Ad titletitlestringDefault: ""
File typefileTypeint1 picture 2 video
Horizontal screen ad addressurl1stringDefault: ""
Vertical screen ad addressurl2stringDefault: ""
Play timeplayTimeintOnly valid for pictures, set the screen stay time
SortingweightintThe larger the value, the higher the sorting
Screen brightnessscreenBrightnessintRange: 0-255