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
Bind the DeviceId to a specific device and activate it
caution
Note: A deviceID will only be activated after it is bound to a specific device via the this method.
Request Body
Params | Value | Description |
---|---|---|
method | "activateDeviceId" | Activate deviceId |
params.deviceId | String | Device's DeviceId, if it is empty, the system will automatically apply for an available DeviceId |
params.chipId | String* | Device's ChipId |
params.appEui | String* | Device's AppEUI |
Response Body
Params | Value | Description |
---|---|---|
code | String* | "000000" indicates success, any other value indicates failure. |
data.deviceId | String* | Successfully activated deviceId |
2.3 Request SN codes
Request SN codes compliant with YoSmart Specifications
Request Body
Params | Value | Description |
---|---|---|
method | "requestSN" | Request SN codes |
params.size | Number* | Number of requested SN codes |
Response Body
Params | Value | Description |
---|---|---|
code | String* | "000000" indicates success, any other value indicates failure. |
data.snList | List<String>* | List of SN 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 |