Skip to content

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_code required in the following interfaces can be obtained from our Customer Success Manager (CSM).

Query Smartware ​

Description ​

Get Smartware information

Request Config ​

ConfigDefinition
URL/smartware?asset_code=CB408AGD21060111&hub_code=CBSTEST30607e18f2&smart_id=sdt33455
MethodGET

Params ​

NameTypeDescriptionRequired
smart_idstringSmartware id, smart_id/hub_code/asset_code at least oneNo
hub_codestringHub code, smart_id/hub_code/asset_code at least oneNo
asset_codestringAsset code, smart_id/hub_code/asset_code at least oneNo

Response: ​


Schema of data ​

NameTypeDescription
smartwareobjectSmartware information
+ smart_idstringSmartware id
+ hub_codestringHub code
+ asset_codestringAsset code
storeobjectStore information
+ codestringStore code
projectobjectProject information
+ codestringProject code

Response Body Sample ​

json
{
  "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 ​

ConfigDefinition
URL/smartware/project
MethodPOST
Content-Typeapplication/json

Request Body Schema ​

NameTypeDescriptionRequired
smartwareobjectSmartware informationYes
+ smart_idstringSmartware id, smart_id/hub_code/asset_code at least oneNo
+ hub_codestringHub code, smart_id/hub_code/asset_code at least oneNo
+ asset_codestringAsset code, smart_id/hub_code/asset_code at least oneNo
projectobjectProject informationYes
+ codestringProject codeYes

Request Body Sample ​

json
{
  "smartware": {
    "smart_id": "d1c79add-a725-432c-81a3-6d5ae2d0ce25",
    "hub_code": "CBSTEST30607e18f2",
    "asset_code": "CB408AGD21060111"
  },
  "project": {
    "code": "P0"
  }
}

Response ​


Schema of data ​

NameTypeDescription
smartwareobjectSmartware information
+ smart_idstringSmartware id
+ hub_codestringHub code
+ asset_codestringAsset code

Response Body Sample ​

json
{
  "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 ​

ConfigDefinition
URL/smartware/store
MethodPOST
Content-Typeapplication/json

Request Body Schema ​

NameTypeDescriptionRequired
smartwareobjectSmartware informationYes
+ smart_idstringSmartware id, smart_id/hub_code/asset_code at least oneNo
+ hub_codestringHub code smart_id/hub_code/asset_code at least oneNo
+ asset_codestringAsset code smart_id/hub_code/asset_code at least oneNo
storeobjectStore informationYes
+ codestringStore codeYes

Request Body Sample ​

json
{
  "smartware": {
    "smart_id": "d1c79add-a725-432c-81a3-6d5ae2d0ce25",
    "hub_code": "CBSTEST30607e18f2",
    "asset_code": "CB408AGD21060111"
  },
  "store": {
    "code": "TEST001"
  }
}

Response ​


Response Body Sample ​

json
{
  "code": 0,
  "message": ""
}

Unbinding Store ​

Description ​

Unbinding Store

Request Config ​

ConfigDefinition
URL/smartware/store
MethodDELETE
Content-Typeapplication/json

Request Body Schema ​

NameTypeDescriptionRequired
smartwareobjectSmartware informationYes
+ smart_idstringSmartware id smart_id or hub_code is requiredNo
+ hub_codestringHub code id or hub_code is requiredNo

Request Body Sample ​

json
{
  "smartware": {
    "smart_id": "d1c79add-a725-432c-81a3-6d5ae2d0ce25",
    "hub_code": "CBSTEST30607e18f2"
  }
}

Response ​


Response Body Sample ​

json
{
  "code": 0,
  "message": ""
}

Get Device List ​

Description ​

Get Device List By Partner Information

Request Config ​

ConfigDefinition
URL/smartware/list?page_index=1&page_size=100
MethodGET

Params ​

NameTypeDescriptionRequired
page_indexintPage index,default 1No
page_sizeintPage size, default 10,Max 100No

Response ​


Schema of data ​

NameTypeDescription
totallongDevice total count
pageobjectPage info
+ indexintPage index
+ sizeintPage size
results[]objectResults
+ smart_idstringDevice id
+ hub_codestringDevice hub code
+ asset_codestringAsset code
+ fridge_tempintTarget temperature,℃
+ fridge_min_tempintMinimum temperature of control,℃
+ fridge_max_tempintMaximum temperature of control,℃
+ fridge_temp_alarm_delayintTemperature alarm delay time,minutes
+ create_timelongCreate time,millisecond timestamp
+ statusintDevice status,0-unactivated; 1-running; 2-faulty; 3-broken; 4-recycled

Response Body Sample ​

json
{
  "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 ​

ConfigDefinition
URL/smartware/config
MethodPUT
Content-Typeapplication/json

Request Body Schema ​

NameTypeDescriptionRequired
smart_idstringSmartware id smart_id/hub_code/asset_code at least oneNo
hub_codestringHub code smart_id/hub_code/asset_code at least oneNo
asset_codestringAsset code smart_id/hub_code/asset_code at lease oneNo
fridge_tempstringTarget temperature,integer,℃ ,minimum 0,maximum 8No
fridge_min_tempstringMinimum temperature of control,integer,℃ ,minimum -50,maximum 99,must set with fridge_max_tempNo
fridge_max_tempstringMaximum temperature of control,integer,℃ ,minimum -50,maximum 99,must set with fridge_min_tempNo
fridge_temp_alarm_delaystringTemperature alarm delay time,integer,minutesNo

Request Body Sample ​

json
{
  "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 ​

json
{
  "code": 0,
  "message": ""
}

Query Device Config Params ​

Description ​

Query Device Configuration Parameters by Device Information

Request Config ​

ConfigDefinition
URL/smartware/config?smart_id=008d01a1-8e33-451f-86f4-ba3a7b2daa89&hub_code=P31SZ11205M21030001-11E7&asset_code=CB408AGD21060201
MethodGET

Params ​

NameTypeDescriptionRequired
smart_idstringSmartware id, smart_id/hub_code/asset_code at least oneNo
hub_codestringHub code, smart_id/hub_code/asset_code at least oneNo
asset_codestringAsset code, smart_id/hub_code/asset_code at least oneNo

Response ​


Schema of data ​

NameTypeDescription
fridge_tempintTarget temperature,℃
fridge_min_tempintMinimum temperature of control,℃
fridge_max_tempintMaximum temperature of control,℃
fridge_temp_alarm_delayintTemperature alarm delay time,minutes

Response Body Sample ​

json
{
  "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 ​

ConfigDefinition
URL/smartware/control
MethodPUT
Content-Typeapplication/json

Request Body Schema ​

NameTypeDescriptionRequired
smart_idstringSmartware id smart_id/hub_code/asset_code at least oneNo
hub_codestringHub code smart_id/hub_code/asset_code at least oneNo
asset_codestringAsset code smart_id/hub_code/asset_code at least oneNo
fridge_compressorintControl compressor;0-Not control;1-on;2-off;3-Smart modeNo
fridge_lightintControl light bar;0-Not control;1-on;2-off;3-Smart modeNo

Request Body Sample ​

json
{
  "smart_id": "008d01a1-8e33-451f-86f4-ba3a7b2daa89",
  "hub_code": "P31SZ11205M21030001-11E7",
  "asset_code": "CB408AGD21060201",
  "fridge_compressor": 1,
  "fridge_light": 1
}

Response ​


Response Body Sample ​

json
{
  "code": 0,
  "message": ""
}

Query Device Status ​

Description ​

Query device status by device information

Request Config ​

ConfigDefinition
URL/smartware/state?asset_code=CB408AGD21060201&hub_code=P31SZ11205M21030001-11E7&smart_id=008d01a1-8e33-451f-86f4-ba3a7b2daa89
MethodGET

Param: ​

NameTypeDescriptionRequired
smart_idstringSmartware id smart_id/hub_code/asset_code at least oneNo
hub_codestringHub code smart_id/hub_code/asset_code at least oneNo
asset_codestringAsset code smart_id/hub_code/asset_code at least oneNo

Response ​


Schema of data ​

NameTypeDescription
fridge_tempfloat64Current fridge temperature,℃
fridge_latest_temp_timelongTemperature last reported time,millisecond timestamp
fridge_compressorintControl compressor;0-Not control;1-on;2-off;3-Smart mode
fridge_lightintControl light bar;0-Not control;1-on;2-off;3-Smart mode
longitudefloat64Location longitude
latitudefloat64Location latitude
latest_gps_timelongLocation last reported time,millisecond timestamp
alarms[]objectValid alarm list
+ typestringAlarm type,temp=temperature,gps=location
+ dataobjectAlarm data
+ + degreestringTemperature value,appear when type=temp
+ + timelongAlarm time,millisecond timestamp
+ + diffstringOffset value,meters,appear when type=gps
latest_heartbeat_timeintHeartbeat last reported time, millisecond timestamp
is_power_supplyboolIs power supply,true = External power supply,false = buttery powered

Response Body Sample ​

json
{
  "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 ​

ConfigDefinition
URL/smartware/ir/result?capture_end_time=1646618412000&capture_start_time=1646618411000&image_filter=latest&store_code=5177er67378273888287321&smart_id=sdt33455
MethodGET

Params ​

NameTypeDescriptionRequired
store_codestringStore id or smart id or asset code or hub_code is requiredNo
smart_idstringSmartware Id, required with store id or asset code or hub_codeNo
asset_codestringAsset code , required with store id or smart_id or hub_codeNo
hub_codestringHub code, required with store id or asset_code or smart_idNo
capture_start_timelongCapture start time(millisecond)No
capture_end_timelongCapture end time(millisecond)No
image_filterstringImage filters, default lastNo

Response ​


Schema of data ​

NameTypeDescription
storestringStore information
+ codestringStore code
photos[]objectImage information ,each smartId has one
+ smartwarestringSmartware
+ + smart_idstringSmartware id
+ + hub_codestringHub code
+ capture_timelongCapture time,millisecond timestamp
+ image_urlstringImage url
+ dataobjectIR data
+ + sku_list[]objectSku list
+ + + sku_idstringSku id
+ + + sku_namestringSku name
+ + + sku_countint64Sku count
+ + + categorystringSku category
+ + + manufacturerstringSku manufacturer
+ + + flavorstringSku flavor
+ + + brandstringSku brand
+ + + sub_brandstringSku sub brand
+ + + pack_typestringSku pack type
+ + + pack_sizestringSku pack size
+ + + sub_categorystringSku sub category
+ + + unitstringSku unit
+ + locations[]objectSku location
+ + + box_idstringBox id
+ + + box_typeint32Box type,0=unknown 1=model box 2= embedding box 10=price tag box 11= POSM box
+ + + sku_idstringSku Id
+ + + linked_box_idint64Linked box Id
+ + + positionobjectSku location
+ + + + indexint32index
+ + + + rowint32row index,see at row and column diagram
+ + + + colint32column index,see at row and column diagram
+ + + + stackingstringstacking info,0=no stacking,if exists,value in 1~n
+ + + bounding_boxobjectBounding box
+ + + + x_minfloat64Top-left x coordinate, shown in the box diagram
+ + + + y_minfloat64Top-left y coordinate, shown in the box diagram
+ + + + x_maxfloat64Bottom-right x coordinate, shown in the box diagram
+ + + + y_maxfloat64Bottom-right y coordinate, shown in the box diagram
+ + qualities[]objectImage quality,see for details IR Indicators Description
+ + + idstringQuality id
+ + + namestringQuality name
+ + metrics[]objectMetric item, see for details IR Indicators Description
+ + + idstringMetric id
+ + + namestringMetric name
+ + + valuestringMetric value
+ + sales[]objectSales info
+ + + sku_idstringSku id
+ + + sku_namestringSku name
+ + + countint64Sku sales count in this image

Response Body Sample ​

json
{
  "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:
box

The diagram of the rows and columns is as follows:

col_row

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 ​

ConfigDefinition
URL/smartware/ir/summary/daily?date=2022-03-01&metrics=sales&store_code=5177er67378273888287321&smart_id=sdt33455
MethodGET

Params ​

NameTypeDescriptionRequired
store_codestringStore id,required with smart_id or asset_code or hub_codeNo
smart_idstringSmartware id, required with store_code or asset_code or hub_codeNo
asset_codestringAsset code, required with store_code id or smart_id or hub_codeNo
hub_codestringHub code, required with store_code or asset_code or smart_idNo
datestringQuery time, yyyy-MM-dd,default current date T-1No
metricsstringMetric data,include sales,multi data split with ",",sales only for metrics at this stageNo

Response ​


Schema of data ​

NameTypeDescription
storestringStore information
+ codestringStore code
data[]objectDaily summary info for each device
+ smartwarestringSmartware
+ + smart_idstringSmartware id
+ + hub_codestringHub code
+ photo_countint64Image count
+ sales[]objectSales info
+ + sku_idstringSku id
+ + sku_namestringSku name
+ + countint64Sku sales count in specified period

Response Body Sample ​

json
{
  "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
          }
        ]
      }
    ]
  }
}

Powered by Clobotics Retail Team.