Smartware
Overview
Smartware refer to assets equipped with smart components that interact with our system, enabling customers to monitor the status of assets and identify SKU information within them at any time. Simultaneously, these smart components can receive corresponding commands from the cloud to control the devices.
Notes:
- The
project_coderequired in the following interfaces can be obtained from our Customer Success Manager (CSM).
Query Smartware
Description
Get Smartware information
Request Config
| Config | Definition |
|---|---|
| URL | /smartware?asset_code=CB408AGD21060111&hub_code=CBSTEST30607e18f2&smart_id=sdt33455 |
| Method | GET |
Params
| Name | Type | Description | Required |
|---|---|---|---|
| smart_id | string | Smartware id, smart_id/hub_code/asset_code at least one | No |
| hub_code | string | Hub code, smart_id/hub_code/asset_code at least one | No |
| asset_code | string | Asset code, smart_id/hub_code/asset_code at least one | No |
Response:
Schema of data
| Name | Type | Description |
|---|---|---|
| smartware | object | Smartware information |
| + smart_id | string | Smartware id |
| + hub_code | string | Hub code |
| + asset_code | string | Asset code |
| store | object | Store information |
| + code | string | Store code |
| project | object | Project information |
| + code | string | Project code |
Response Body Sample
{
"code": 0,
"message": "",
"data": {
"smartware": {
"smart_id": "d1c79add-a725-432c-81a3-6d5ae2d0ce25",
"hub_code": "CBSTEST30607e18f2",
"asset_code": "CB408AGD21060111"
},
"store": {
"code": "TEST001"
},
"project": {
"code": "P0"
}
}
}Binding Project
Description
Binding Project
Request Config
| Config | Definition |
|---|---|
| URL | /smartware/project |
| Method | POST |
| Content-Type | application/json |
Request Body Schema
| Name | Type | Description | Required |
|---|---|---|---|
| smartware | object | Smartware information | Yes |
| + smart_id | string | Smartware id, smart_id/hub_code/asset_code at least one | No |
| + hub_code | string | Hub code, smart_id/hub_code/asset_code at least one | No |
| + asset_code | string | Asset code, smart_id/hub_code/asset_code at least one | No |
| project | object | Project information | Yes |
| + code | string | Project code | Yes |
Request Body Sample
{
"smartware": {
"smart_id": "d1c79add-a725-432c-81a3-6d5ae2d0ce25",
"hub_code": "CBSTEST30607e18f2",
"asset_code": "CB408AGD21060111"
},
"project": {
"code": "P0"
}
}Response
Schema of data
| Name | Type | Description |
|---|---|---|
| smartware | object | Smartware information |
| + smart_id | string | Smartware id |
| + hub_code | string | Hub code |
| + asset_code | string | Asset code |
Response Body Sample
{
"code": 0,
"message": "",
"data": {
"smartware": {
"smart_id": "d1c79add-a725-432c-81a3-6d5ae2d0ce25",
"hub_code": "CBSTEST30607e18f2",
"asset_code": "CB408AGD21060111"
}
}
}Binding Store
Description
Binding store
Request Config
| Config | Definition |
|---|---|
| URL | /smartware/store |
| Method | POST |
| Content-Type | application/json |
Request Body Schema
| Name | Type | Description | Required |
|---|---|---|---|
| smartware | object | Smartware information | Yes |
| + smart_id | string | Smartware id, smart_id/hub_code/asset_code at least one | No |
| + hub_code | string | Hub code smart_id/hub_code/asset_code at least one | No |
| + asset_code | string | Asset code smart_id/hub_code/asset_code at least one | No |
| store | object | Store information | Yes |
| + code | string | Store code | Yes |
Request Body Sample
{
"smartware": {
"smart_id": "d1c79add-a725-432c-81a3-6d5ae2d0ce25",
"hub_code": "CBSTEST30607e18f2",
"asset_code": "CB408AGD21060111"
},
"store": {
"code": "TEST001"
}
}Response
Response Body Sample
{
"code": 0,
"message": ""
}Unbinding Store
Description
Unbinding Store
Request Config
| Config | Definition |
|---|---|
| URL | /smartware/store |
| Method | DELETE |
| Content-Type | application/json |
Request Body Schema
| Name | Type | Description | Required |
|---|---|---|---|
| smartware | object | Smartware information | Yes |
| + smart_id | string | Smartware id smart_id or hub_code is required | No |
| + hub_code | string | Hub code id or hub_code is required | No |
Request Body Sample
{
"smartware": {
"smart_id": "d1c79add-a725-432c-81a3-6d5ae2d0ce25",
"hub_code": "CBSTEST30607e18f2"
}
}Response
Response Body Sample
{
"code": 0,
"message": ""
}Get Device List
Description
Get Device List By Partner Information
Request Config
| Config | Definition |
|---|---|
| URL | /smartware/list?page_index=1&page_size=100 |
| Method | GET |
Params
| Name | Type | Description | Required |
|---|---|---|---|
| page_index | int | Page index,default 1 | No |
| page_size | int | Page size, default 10,Max 100 | No |
Response
Schema of data
| Name | Type | Description |
|---|---|---|
| total | long | Device total count |
| page | object | Page info |
| + index | int | Page index |
| + size | int | Page size |
| results | []object | Results |
| + smart_id | string | Device id |
| + hub_code | string | Device hub code |
| + asset_code | string | Asset code |
| + fridge_temp | int | Target temperature,℃ |
| + fridge_min_temp | int | Minimum temperature of control,℃ |
| + fridge_max_temp | int | Maximum temperature of control,℃ |
| + fridge_temp_alarm_delay | int | Temperature alarm delay time,minutes |
| + create_time | long | Create time,millisecond timestamp |
| + status | int | Device status,0-unactivated; 1-running; 2-faulty; 3-broken; 4-recycled |
Response Body Sample
{
"code": 0,
"message": "",
"data": {
"total": 1000,
"page": {
"index": 1,
"size": 10
},
"results": [
{
"smart_id": "008d01a1-8e33-451f-86f4-ba3a7b2daa89",
"hub_code": "P31SZ11205M21030001-11E7",
"asset_code": "CB408AGD21060201",
"fridge_temp": 24,
"fridge_min_temp": 1,
"fridge_max_temp": 33,
"fridge_temp_alarm_delay": 10,
"create_time": 1622174400000,
"status": 1
}
]
}
}Update Device Config Params
Description
Update Device Configuration Parameters by Device Information
Request Config
| Config | Definition |
|---|---|
| URL | /smartware/config |
| Method | PUT |
| Content-Type | application/json |
Request Body Schema
| Name | Type | Description | Required |
|---|---|---|---|
| smart_id | string | Smartware id smart_id/hub_code/asset_code at least one | No |
| hub_code | string | Hub code smart_id/hub_code/asset_code at least one | No |
| asset_code | string | Asset code smart_id/hub_code/asset_code at lease one | No |
| fridge_temp | string | Target temperature,integer,℃ ,minimum 0,maximum 8 | No |
| fridge_min_temp | string | Minimum temperature of control,integer,℃ ,minimum -50,maximum 99,must set with fridge_max_temp | No |
| fridge_max_temp | string | Maximum temperature of control,integer,℃ ,minimum -50,maximum 99,must set with fridge_min_temp | No |
| fridge_temp_alarm_delay | string | Temperature alarm delay time,integer,minutes | No |
Request Body Sample
{
"smart_id": "008d01a1-8e33-451f-86f4-ba3a7b2daa89",
"hub_code": "P31SZ11205M21030001-11E7",
"asset_code": "CB408AGD21060201",
"fridge_temp": "24",
"fridge_min_temp": "1",
"fridge_max_temp": "33",
"fridge_temp_alarm_delay": "10"
}Response
Response Body Sample
{
"code": 0,
"message": ""
}Query Device Config Params
Description
Query Device Configuration Parameters by Device Information
Request Config
| Config | Definition |
|---|---|
| URL | /smartware/config?smart_id=008d01a1-8e33-451f-86f4-ba3a7b2daa89&hub_code=P31SZ11205M21030001-11E7&asset_code=CB408AGD21060201 |
| Method | GET |
Params
| Name | Type | Description | Required |
|---|---|---|---|
| smart_id | string | Smartware id, smart_id/hub_code/asset_code at least one | No |
| hub_code | string | Hub code, smart_id/hub_code/asset_code at least one | No |
| asset_code | string | Asset code, smart_id/hub_code/asset_code at least one | No |
Response
Schema of data
| Name | Type | Description |
|---|---|---|
| fridge_temp | int | Target temperature,℃ |
| fridge_min_temp | int | Minimum temperature of control,℃ |
| fridge_max_temp | int | Maximum temperature of control,℃ |
| fridge_temp_alarm_delay | int | Temperature alarm delay time,minutes |
Response Body Sample
{
"code": 0,
"message": "",
"data": {
"fridge_temp": 24,
"fridge_min_temp": 1,
"fridge_max_temp": 33,
"fridge_temp_alarm_delay": 10
}
}Issue Device Config Commands
Description
Issue Control Commands to Specified Devices
Request Config
| Config | Definition |
|---|---|
| URL | /smartware/control |
| Method | PUT |
| Content-Type | application/json |
Request Body Schema
| Name | Type | Description | Required |
|---|---|---|---|
| smart_id | string | Smartware id smart_id/hub_code/asset_code at least one | No |
| hub_code | string | Hub code smart_id/hub_code/asset_code at least one | No |
| asset_code | string | Asset code smart_id/hub_code/asset_code at least one | No |
| fridge_compressor | int | Control compressor;0-Not control;1-on;2-off;3-Smart mode | No |
| fridge_light | int | Control light bar;0-Not control;1-on;2-off;3-Smart mode | No |
Request Body Sample
{
"smart_id": "008d01a1-8e33-451f-86f4-ba3a7b2daa89",
"hub_code": "P31SZ11205M21030001-11E7",
"asset_code": "CB408AGD21060201",
"fridge_compressor": 1,
"fridge_light": 1
}Response
Response Body Sample
{
"code": 0,
"message": ""
}Query Device Status
Description
Query device status by device information
Request Config
| Config | Definition |
|---|---|
| URL | /smartware/state?asset_code=CB408AGD21060201&hub_code=P31SZ11205M21030001-11E7&smart_id=008d01a1-8e33-451f-86f4-ba3a7b2daa89 |
| Method | GET |
Param:
| Name | Type | Description | Required |
|---|---|---|---|
| smart_id | string | Smartware id smart_id/hub_code/asset_code at least one | No |
| hub_code | string | Hub code smart_id/hub_code/asset_code at least one | No |
| asset_code | string | Asset code smart_id/hub_code/asset_code at least one | No |
Response
Schema of data
| Name | Type | Description |
|---|---|---|
| fridge_temp | float64 | Current fridge temperature,℃ |
| fridge_latest_temp_time | long | Temperature last reported time,millisecond timestamp |
| fridge_compressor | int | Control compressor;0-Not control;1-on;2-off;3-Smart mode |
| fridge_light | int | Control light bar;0-Not control;1-on;2-off;3-Smart mode |
| longitude | float64 | Location longitude |
| latitude | float64 | Location latitude |
| latest_gps_time | long | Location last reported time,millisecond timestamp |
| alarms | []object | Valid alarm list |
| + type | string | Alarm type,temp=temperature,gps=location |
| + data | object | Alarm data |
| + + degree | string | Temperature value,appear when type=temp |
| + + time | long | Alarm time,millisecond timestamp |
| + + diff | string | Offset value,meters,appear when type=gps |
| latest_heartbeat_time | int | Heartbeat last reported time, millisecond timestamp |
| is_power_supply | bool | Is power supply,true = External power supply,false = buttery powered |
Response Body Sample
{
"code": 0,
"message": "",
"data": {
"fridge_temp": 12.22,
"fridge_latest_temp_time": 1622174400000,
"fridge_compressor": 1,
"fridge_light": 1,
"longitude": 126.63333,
"latitude": 38.75000,
"latest_gps_time": 1622174400000,
"alarms":[
{
"type": "temp",
"data":{
"degree": "66.11",
"time": 1622174400000
}
},
{
"type": "gps",
"data":{
"diff": "2.22",
"time": 1622174400000
}
}
],
"latest_heartbeat_time": 1622174400000,
"is_power_supply": true
}
}Query Device IR Info
Description
Query Device IR Information
Request Config
| Config | Definition |
|---|---|
| URL | /smartware/ir/result?capture_end_time=1646618412000&capture_start_time=1646618411000&image_filter=latest&store_code=5177er67378273888287321&smart_id=sdt33455 |
| Method | GET |
Params
| Name | Type | Description | Required |
|---|---|---|---|
| store_code | string | Store id or smart id or asset code or hub_code is required | No |
| smart_id | string | Smartware Id, required with store id or asset code or hub_code | No |
| asset_code | string | Asset code , required with store id or smart_id or hub_code | No |
| hub_code | string | Hub code, required with store id or asset_code or smart_id | No |
| capture_start_time | long | Capture start time(millisecond) | No |
| capture_end_time | long | Capture end time(millisecond) | No |
| image_filter | string | Image filters, default last | No |
Response
Schema of data
| Name | Type | Description |
|---|---|---|
| store | string | Store information |
| + code | string | Store code |
| photos | []object | Image information ,each smartId has one |
| + smartware | string | Smartware |
| + + smart_id | string | Smartware id |
| + + hub_code | string | Hub code |
| + capture_time | long | Capture time,millisecond timestamp |
| + image_url | string | Image url |
| + data | object | IR data |
| + + sku_list | []object | Sku list |
| + + + sku_id | string | Sku id |
| + + + sku_name | string | Sku name |
| + + + sku_count | int64 | Sku count |
| + + + category | string | Sku category |
| + + + manufacturer | string | Sku manufacturer |
| + + + flavor | string | Sku flavor |
| + + + brand | string | Sku brand |
| + + + sub_brand | string | Sku sub brand |
| + + + pack_type | string | Sku pack type |
| + + + pack_size | string | Sku pack size |
| + + + sub_category | string | Sku sub category |
| + + + unit | string | Sku unit |
| + + locations | []object | Sku location |
| + + + box_id | string | Box id |
| + + + box_type | int32 | Box type,0=unknown 1=model box 2= embedding box 10=price tag box 11= POSM box |
| + + + sku_id | string | Sku Id |
| + + + linked_box_id | int64 | Linked box Id |
| + + + position | object | Sku location |
| + + + + index | int32 | index |
| + + + + row | int32 | row index,see at row and column diagram |
| + + + + col | int32 | column index,see at row and column diagram |
| + + + + stacking | string | stacking info,0=no stacking,if exists,value in 1~n |
| + + + bounding_box | object | Bounding box |
| + + + + x_min | float64 | Top-left x coordinate, shown in the box diagram |
| + + + + y_min | float64 | Top-left y coordinate, shown in the box diagram |
| + + + + x_max | float64 | Bottom-right x coordinate, shown in the box diagram |
| + + + + y_max | float64 | Bottom-right y coordinate, shown in the box diagram |
| + + qualities | []object | Image quality,see for details IR Indicators Description |
| + + + id | string | Quality id |
| + + + name | string | Quality name |
| + + metrics | []object | Metric item, see for details IR Indicators Description |
| + + + id | string | Metric id |
| + + + name | string | Metric name |
| + + + value | string | Metric value |
| + + sales | []object | Sales info |
| + + + sku_id | string | Sku id |
| + + + sku_name | string | Sku name |
| + + + count | int64 | Sku sales count in this image |
Response Body Sample
{
"code": 0,
"message": "",
"data": {
"store": {
"code": "TEST001"
},
"photos": [
{
"smartware": {
"smart_id": "d1c79add-a725-432c-81a3-6d5ae2d0ce25",
"hub_code": "CBSTEST30607e18f2"
},
"capture_time": 1646618412000,
"image_url": "https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef843.jpg",
"data": {
"sku_list": [
{
"sku_id": "1047441",
"sku_name": "Coke Original Sparkling Can 180 ml",
"sku_count": 7,
"brand": "Coke",
"category": "Sparkling",
"manufacturer": "Coca-Cola",
"flavor": "",
"sub_brand": "Original",
"pack_type": "Can",
"pack_size": "180",
"sub_category": "",
"unit": "ML"
}
],
"locations": [
{
"sku_id": "1044059",
"bounding_box": {
"x_min": 0.46711602807044983,
"y_min": 0.7578532695770264,
"x_max": 0.481109082698822,
"y_max": 0.771846354007721
},
"position": {
"index": 0,
"row": 1,
"col": 2,
"stacking": 0
},
"box_id": 0,
"box_type": 0,
"linked_box_id": 0
},
{
"sku_id": "1044059",
"bounding_box": {
"x_min": 0.5359848141670227,
"y_min": 0.7501513361930847,
"x_max": 0.5499778389930725,
"y_max": 0.7641443610191345
},
"position": {
"index": 0,
"row": 1,
"col": 3,
"stacking": 0
},
"box_id": 0,
"box_type": 0,
"linked_box_id": 0
}
],
"qualities": [
{
"id": "23",
"name": "test"
}
],
"metrics": [
{
"id": "16",
"name": "Purity",
"value": "58%"
}
],
"sales": [
{
"sku_id": "1044059",
"sku_name": "cool",
"count": 2
}
]
}
}
]
}
}Assuming that a 350X640 photo is taken, the real coordinates corresponding to (1,1) are (350,640), and the real coordinate position of x_min, x_max, y_min, and y_max needs to be calculated according to the corresponding proportion, and the box diagram is as follows:
The diagram of the rows and columns is as follows:

The number of columns per row in the recognition results is not guaranteed to be exactly the same
Query Store Or Device Daily Data
Description
Query daily summary data by store id or smart id.
Request Config
| Config | Definition |
|---|---|
| URL | /smartware/ir/summary/daily?date=2022-03-01&metrics=sales&store_code=5177er67378273888287321&smart_id=sdt33455 |
| Method | GET |
Params
| Name | Type | Description | Required |
|---|---|---|---|
| store_code | string | Store id,required with smart_id or asset_code or hub_code | No |
| smart_id | string | Smartware id, required with store_code or asset_code or hub_code | No |
| asset_code | string | Asset code, required with store_code id or smart_id or hub_code | No |
| hub_code | string | Hub code, required with store_code or asset_code or smart_id | No |
| date | string | Query time, yyyy-MM-dd,default current date T-1 | No |
| metrics | string | Metric data,include sales,multi data split with ",",sales only for metrics at this stage | No |
Response
Schema of data
| Name | Type | Description |
|---|---|---|
| store | string | Store information |
| + code | string | Store code |
| data | []object | Daily summary info for each device |
| + smartware | string | Smartware |
| + + smart_id | string | Smartware id |
| + + hub_code | string | Hub code |
| + photo_count | int64 | Image count |
| + sales | []object | Sales info |
| + + sku_id | string | Sku id |
| + + sku_name | string | Sku name |
| + + count | int64 | Sku sales count in specified period |
Response Body Sample
{
"code": 0,
"message": "",
"data": {
"store": {
"code": "TEST001"
},
"data": [
{
"smartware": {
"smart_id": "d1c79add-a725-432c-81a3-6d5ae2d0ce25",
"hub_code": "CBSTEST30607e18f2"
},
"sales": [
{
"sku_id": "1044059",
"sku_name": "cool",
"count": 100
}
]
}
]
}
}