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

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

ParamsValueDescription
method"activateDeviceId"Activate deviceId
params.deviceIdStringDevice's DeviceId, if it is empty, the system will automatically apply for an available DeviceId
params.chipIdString*Device's ChipId
params.appEuiString*Device's AppEUI

Response Body

ParamsValueDescription
codeString*"000000" indicates success, any other value indicates failure.
data.deviceIdString*Successfully activated deviceId

2.3 Request SN codes

Request SN codes compliant with YoSmart Specifications

Request Body

ParamsValueDescription
method"requestSN"Request SN codes
params.sizeNumber*Number of requested SN codes

Response Body

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

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