Config(New)
1、Device authentication: After connecting to MQTT, this initialization configuration interface will be called and the data will be updated locally.
2、If the interface call fails, local data will be used instead.
Command send ▼
Subscribe to topic: /powerbank/{uuid}/user/get
Data format: JSON string
| Name | Identification code | Data type | Remarks |
|---|---|---|---|
| Command name | cmd | string | init |
MQTT:Update initialization configuration
text
{"cmd":"init"}Command Reply △
None, But Trigger API request
API Request
Request URL
POST
https://{host}/api/rentbox/client/init?uuid={uuid}&sign={sign}
text
Request URL: /api/rentbox/client/init
Content-Type: text/plain
sign=MD5("uuid={uuid}")body
json
{
"version": "20240904-RBMG-3.0.0.0",
"manufacturer": "Welink",
"model": "3568A",
"radioVersion": "EC20CEHCLGR06A05M1G"
}Request Parameters
| Name | Identification code | Data type | Remarks |
|---|---|---|---|
| Server domain name | host | YES | Provided by the customer, for example: s.abc.com |
| uuid | uuid | YES | 4G communication module, IMEI number |
| Interface signature | sign | YES | MD5 encryption |
Body
| Name | Identification code | Data type | Remarks |
|---|---|---|---|
| Version | version | string | Program version number |
| Manufacturer | manufacturer | string | welink, BST |
| Model | model | string | - |
| Radio version | radioVersion | string | - |
Request Example
POST
https://s.abc.com/api/rentbox/client/int?uuid=860602069165357&sign=dfd1c44ce6c5a85d74627d8ffa6bff40
text
Request URL: /api/rentbox/client/init
Content-Type: text/plain
sign = MD5("uuid=860602069165357") = dfd1c44ce6c5a85d74627d8ffa6bff40body
json
{
"version": "20240904-RBMG-3.0.0.0",
"manufacturer": "Welink",
"model": "3568A",
"radioVersion": "EC20CEHCLGR06A05M1G"
}API Response
| Name | Identification code | Data type | Remarks |
|---|---|---|---|
| Status code | code | int | Default: 200 |
| Status type | type | int | Default: 0 |
| Custom data | data | json | Initialization parameters |
| Error message | msg | string | Default: "OK" |
| Timestamp | time | long | Current timestamp in milliseconds |
Initialization parameters
| Name | Identification code | Data type | Remarks |
|---|---|---|---|
| Area Code | areaConfig | string | Different customer power banks are not allowed to be returned; For example: 0x00 (general), 0xAB (customer A), 0xCC (customer B) |
| Anti-theft Detection | antitheft | int | 0: Off 1: On Scenario: Power bank returned, side hole blocked; 0: Return successful 1: Return failed |
| Return Lock | returnLocked | int | 0: Off 1: On Scenario: Return failed; 0: Power bank ejected 1: Not ejected |
| Maximum Charging Slots | maxChargeSlots | int | 0: Off Range: 1~4; Note: This function is related to the device's power supply and only supports some models. Machines with 16 or more slots do not support this setting. |
| Adjust Volume | volume | int | 0~100 |
| Adjust Backlight | backlight | int | 0~100 |
| Invert Backlight | invertBacklight | int | 0: Off 1: On Scenario: Some manufacturers, 0 for maximum brightness, 100 for minimum brightness |
| Banner Image | banner | string[] | Example 1:["bottom", "https://abc.com/baaner.png"] Display the banner image at the bottom, with a size of 1080*480 pixels. Example 2: An empty array [], no banner will be displayed. |
| Qrcode | qrcode | string[] | Example 1:["100", "10107853", "20", "30", "https://s.weirink.com/sw/app/r/scan.html?id=10107853"]100-pixel size, cabinet SN: 10107853, relative to banner coordinates (20, 30) Example 2: Empty array [], does not display QR code |
Banner Image
| - | Name | Identification code | Data type | Remarks |
|---|---|---|---|---|
| string[0] | position | position | string | left | right | bottom | top |
| string[1] | url | url | string | For example:https://abc.com/baaner.png |
Qrcode
| - | Name | Identification code | Data type | Remarks |
|---|---|---|---|---|
| string[0] | size | size | string | 100 |
| string[1] | SN | sn | string | For example:10107853 |
| string[2] | Relative to the X coordinate of the banner | x | string | 0 |
| string[3] | Relative to the Y coordinate of the banner | y | string | 0 |
| string[4] | content | content | string | https://s.weirink.com/sw/app/r/scan.html?id=10107853 |
json
{
"code": 200,
"type": 0,
"data": {
"areaConfig": "0x00",
"antitheft": 0,
"returnLocked": 0,
"maxChargeSlots": 0,
"volume": 80,
"backlight": 80,
"invertBacklight": 0,
"banner": ["bottom", "https://abc.com/baaner.png"],
"qrcode": ["100", "10107853", "20", "30", "https://s.weirink.com/sw/app/r/scan.html?id=10107853"]
},
"msg": "OK",
"time": 1705661910697
}