Skip to main content

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

ParamsValueDescription
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

ParamsValueDescription
methodString*To access the specified API in Methods
paramsObjectParameters required to access the specified API

Response Body

ParamsValueDescription
codeString*"000000" means successful, others indicate failure
dataObjectData 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

ParamsValueDescription
method"requestDeviceId"Request for deviceIds
params.sizeNumber*Number of requested deviceIds

Response Body

ParamsValueDescription
codeString*"000000" indicates success, any other value indicates failure.
data.deviceIdListArray<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

ParamsValueDescription
method"activateDeviceId"Activates the specified DeviceID
params.deviceIdStringTarget DeviceID; if omitted, the system will automatically allocate an available DeviceID
params.chipIdString*The unique ChipID of the physical device
params.appEuiString*The Application EUI of the device

Response Body

ParamsValueDescription
codeString*"000000" indicates successful operation; any other code indicates failure
data.deviceIdString*The DeviceID that was successfully activated

2.3 Request SN Codes

Retrieves serial number codes that comply with YoSmart specifications

Request Body

ParamsValueDescription
method"requestSN"Requests batch generation of serial numbers
params.sizeNumber*Quantity of SN codes to generate

Response Body

ParamsValueDescription
codeString*"000000" indicates successful operation; any other code indicates failure
data.snListList<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

ParamsValueDescription
method"bindSN"Bind SN code
params.deviceIdString*Device's DeviceId
params.snStringSN code conforming to YoSmart specifications. If it is empty, the system will automatically generate an SN

Response Body

ParamsValueDescription
codeString*"000000" indicates success, any other value indicates failure.
data.snString*Successfully bound SN code