Device Production API
The Device Production API offers a set of methods that allow authorized customers to access and report key data required for device production processes on the YoSmart platform.
With this API, customers can optimize their workflows, reduce manual effort, and ensure efficient tracking throughout the entire manufacturing lifecycle.
1. Protocol
Post /open/production/v2/api
Request Header
Params | Value | Description |
---|---|---|
Content-Type | "application/json" | The body of request/response should be JSON formatted |
Authorization | "Bearer ${access_token}" | The access_token granted to access the API |
tip
"access_token" can be obtained from "Manage.createAccessToken" for CSID
The "scope" of the access_token must include "production/*"
Request Body
Params | Value | Description |
---|---|---|
method | String* | To access the specified API in Methods |
params | Object | Parameters required to access the specified API |
Response Body
Params | Value | Description |
---|---|---|
code | String* | "000000" means successful, others indicate failure |
data | Object | Data returned from the specified API |
2. Methods
2.1 Request DeviceIds
Request a specified number of deviceIds
caution
Note: Sufficient Device Licenses Required
Request Body
Params | Value | Description |
---|---|---|
method | "requestDeviceId" | Request for deviceIds |
params.size | Number* | Number of requested deviceIds |
Response Body
Params | Value | Description |
---|---|---|
code | String* | "000000" indicates success, any other value indicates failure. |
data.deviceIdList | Array<String>* | List of deviceIds |
2.2 Activate DeviceID
Associates a DeviceID with a specific physical device and activates it in the system
caution
Note: A DeviceID becomes fully operational only after it has been associated with a specific device through this method.
Request Body
Params | Value | Description |
---|---|---|
method | "activateDeviceId" | Activates the specified DeviceID |
params.deviceId | String | Target DeviceID; if omitted, the system will automatically allocate an available DeviceID |
params.chipId | String* | The unique ChipID of the physical device |
params.appEui | String* | The Application EUI of the device |
Response Body
Params | Value | Description |
---|---|---|
code | String* | "000000" indicates successful operation; any other code indicates failure |
data.deviceId | String* | The DeviceID that was successfully activated |
2.3 Request SN Codes
Retrieves serial number codes that comply with YoSmart specifications
Request Body
Params | Value | Description |
---|---|---|
method | "requestSN" | Requests batch generation of serial numbers |
params.size | Number* | Quantity of SN codes to generate |
Response Body
Params | Value | Description |
---|---|---|
code | String* | "000000" indicates successful operation; any other code indicates failure |
data.snList | List<String>* | Array of generated serial number codes |
2.4 Bind SN code to device
Bind the SN code to the specified device
caution
Note: The deviceId of target device must be activated
Request Body
Params | Value | Description |
---|---|---|
method | "bindSN" | Bind SN code |
params.deviceId | String* | Device's DeviceId |
params.sn | String | SN code conforming to YoSmart specifications. If it is empty, the system will automatically generate an SN |
Response Body
Params | Value | Description |
---|---|---|
code | String* | "000000" indicates success, any other value indicates failure. |
data.sn | String* | Successfully bound SN code |