Skip to main content
Version: v3.2.2

Factory Edge Service API - v1.5

1. Revision Record​

VersionModified DateNotes
v1.02025/03/26Initial release
v1.12025/12/17Added "Query Device Details" API, which can be used to retrieve programming status
v1.22025/12/22
  • Updated the required parameter validation and parameter descriptions of the "Query Device Details" API (Supports using the Matter QR code as a query condition to retrieve device information)
  • Added API exception status code definitions
  • Added an error code list
v1.32026/01/26
  • Deprecated "Query Device Data" and "Update Device Info" APIs
  • Added "Update Devices Profile" API
v1.42026/09/10Added the "Upload Device Production Data" API.
v1.52026/10/16
  • Updated the "Query Device Details", "Update Devices Profile", and "Upload Device Production Data" APIs.
  • Added "Query Device Information", "Recover Matter QR Code", "Upload Device Test File", "Connection Heartbeat", "Query Login Options", "Query Programming Station Login Method", "U-Safe Pre-login", "Programming Station Login", "Programming Station Logout", "Query Batches by Order Number", "Assign Programming Station Batch", "Query Programming Station Batch Information", "Get Dynamic Programming Data", "Get Batch Metadata", "Get Full Programming Data" (compatibility API), "Submit Intermediate Programming Request Data", "Report Programming Result", "SE APDU Stepwise Programming", "Get Programming Script URL", "Download File", "Upload Device Event Logs", "Generate Matter Verifier", "Generate Matter Onboarding Payload", and "Generate Matter Unique ID" APIs.
  • Added compatibility notes for the deprecated "Query Device Data" and "Update Device Info" APIs.
  • vAdded common call conventions and error code descriptions.

2. Overview​

Factory Edge Service API supports Programming Station login, production batch management, device programming, production data upload, device data queries, and device profile updates. These APIs use HTTP for data transmission, and all requests and responses are encoded in UTF-8.

This document describes the API conventions and common request headers, and provides request parameters, response parameters, and call examples for each API.

3. Common Request Headers​

These APIs use the following keys (all lowercase):

KeyMandatory Description
content-typeYesContent type, unless otherwise specified, should always be application/json;charset=utf-8
x-snbps-factory-idNoFactory ID
x-snbps-timestampNoRequest time. For example, 2021-09-17T16:47:05.132+0800
x-snbps-langNoLanguage code, default is English: en-US, supports Simplified Chinese: zh-CN
x-snbps-request-idNoRequest traceID

3.1 API Call Conventions and Authentication​

3.1.1 Service Address and Request Format​

The service prefix is {BASE_URL}/api/iot-factory-edge-service. {BASE_URL} is the actual Edge address, including protocol, IP address or domain name, and port; it must not already include the service prefix. Paths below are relative to this prefix. JSON requests use UTF-8 encoding. Pass GET parameters in the URL query string; the client generates the boundary for multipart file uploads.

3.1.2 Programming Station Session and API Validation​

After a Programming Station (PS) calls /login, retrieve the session token from respData.token and send it in the x-snbps-session header of subsequent requests. The station session token is distinct from a programming traceId or uuid. x-snbps-request-id is only for request tracing and cannot replace the business traceId.

The session lifetime is deployment-dependent and is refreshed when a protected API is called.

UkeyPermissionFilter enforces session validation for the following APIs:

/assignBatch
/queryPPCBatchInfo
/v1/queryBatchByOrderNumber
/getPPData
/getProgrammingData
/uploadRequestData
/programmingResult
/executeApdu
/v1/eventLog/upload
/v1/matter/onboarding-payloads/recover
/v1/device/information/query
/v1/testFile/upload
/v1/deviceData/upload

If validation data is missing or invalid, the service returns HTTP 200 with business code 8050.

3.1.3 Platform Authentication and Factory Context​

Platform authentication is controlled separately by deployment configuration. In the current repository, application.yml does not exempt the following API paths from platform authentication:

  • /v1/device/detail
  • /v1/updateDevicesProfile
  • /v1/deviceData/upload
  • /executeApdu
  • /v1/eventLog/upload
  • /v1/queryBatchByOrderNumber
  • The three /generate* API paths

When platform authentication is enabled in the target environment, these calls also require x-snbps-auth-token. Check the target environment's authentication configuration before integration testing; a valid station session token alone does not establish that all authentication requirements are met.

x-snbps-factory-id carries common factory information. The current factory context is primarily resolved from platform login information or a valid station session; this header alone cannot switch factories.

3.2 Unified Response and Error Handling​

Factory Edge Service API generally uses a unified JSON response format, with the following fields:

FieldTypeMandatory / conditionDescription
successbooleanResponsetrue indicates business success.
respCodestringResponse8000 indicates success; see the appendix for other business error codes.
respMsgstringResponseStatus description, affected by the selected language.
respDataobject / array / nullResponseBusiness data for the API; usually null when no data is returned or the business operation fails.
respTimeinteger (int64)ResponseUnix timestamp in seconds, not a string.

3.2.1 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": null,
"respTime": 1792108800
}

3.2.2 Error Handling​

Business exceptions (ClientApiException) and expired station sessions are returned with HTTP 200. Callers must check success and respCode rather than relying on the HTTP status alone.

Parameter binding errors, Bean Validation failures, platform authentication failures, and gateway errors are not guaranteed to return HTTP 200. Handle the actual HTTP status and response content.

3.2.3 Special Responses​

On success, /download returns a file stream directly rather than the unified JSON format.

4. API Index (29 APIs)​

This section lists the current 29 Factory Edge Service APIs, including method, relative path, purpose, and caller identity requirements. See API Call Conventions and Authentication for authentication rules.

No.Request MethodRelative PathAPI NameCaller Identity
5.1POST/v1/device/detailQuery Device DetailsPlatform authentication depends on deployment configuration.
5.2POST/v1/updateDevicesProfileUpdate Devices ProfilePlatform authentication depends on deployment configuration.
5.3POST/v1/deviceData/uploadUpload Device Production DataStation session; see common conventions for platform authentication.
5.4POST/v1/device/information/queryQuery Device InformationStation session; see common conventions for platform authentication.
5.5POST/v1/matter/onboarding-payloads/recoverRecover Matter QR CodeStation session; see common conventions for platform authentication.
5.6POST/v1/testFile/uploadUpload Device Test FileStation session; see common conventions for platform authentication.
5.7GET/heartBeatConnection HeartbeatBefore login / initialization.
5.8GET/queryLoginOptionsQuery Login OptionsBefore login / initialization.
5.9POST/queryLoginTypeQuery Programming Station Login MethodBefore login / initialization.
5.10GET/preLoginU-Safe Pre-loginBefore login / initialization.
5.11POST/loginProgramming Station LoginBefore login / initialization.
5.12POST/logoutProgramming Station LogoutProvide station context as required.
5.13GET/v1/queryBatchByOrderNumberQuery Batches by Order NumberStation session; see common conventions for platform authentication.
5.14POST/assignBatchAssign Programming Station BatchStation session; see common conventions for platform authentication.
5.15GET/queryPPCBatchInfoQuery Programming Station Batch InformationStation session; see common conventions for platform authentication.
5.16GET/getProgrammingDataGet Dynamic Programming DataStation session; see common conventions for platform authentication.
5.17GET/getMetadataGet Batch MetadataProvide station context as required.
5.18GET/getPPDataGet Full Programming Data (Compatibility API)Station session; see common conventions for platform authentication.
5.19POST/uploadRequestDataSubmit Intermediate Programming Request DataStation session; see common cdeploymentns for platform authentication.
5.20POST/programmingResultReport Programming ResultStation session; see common conventions for platform authentication.
5.21POST/executeApduExecute SE APDU Stepwise ProgrammingStation session; see common conventions for platform authentication.
5.22POST/getScriptFileGet Programming Script URLProvide station context as required.
5.23GET/downloadDownload FileProvide station context as required.
5.24POST/v1/eventLog/uploadUpload Device Event LogsStation session; see common conventions for platform authentication.
5.25POST/generateVerifierGenerate Matter VerifierPlatform authentication depends on deployment configuration.
5.26POST/generateOnboardingDataGenerate Matter Onboarding PayloadPlatform authentication depends on deployment configuration.
5.27POST/generateUniqueIdGenerate Matter Unique IDPlatform authentication depends on deployment configuration.
5.28POST/queryDeviceDataQuery Device Data (Deprecated)Provide station context as required.
5.29POST/updateDeviceInfoUpdate Device Info (Deprecated)Provide station context as required.

4.1 API Scope​

This index covers the 29 external routes currently registered by ProgrammingStationController and ExternalSystemController. It excludes administration controllers, the debugging TestController, and the entirely commented-out UsbKeyController.

/v1/testData/upload remains in some filter or authentication exclusion configurations, but no current controller registers it. Upload device production data through /v1/deviceData/upload.

5. API List​

5.1 Query Device Details​

Query device profiles using locator and filter conditions combined with AND logic, and return the groups or fields specified by queryKeys. If no local record matches, query historical data and then cloud data. If multiple results refer to different products or deviceId values, return error code 8102. If multiple records belong to the same product and device, return the most recent by production time.

5.1.1 Request Method​

POST

5.1.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/v1/device/detail

5.1.3 Request Body​

The request body contains the following parameters:

tip

At least one non-empty value is required among chipUid, bleMac, serialNumber, matterQrcode, and matterManualCode in deviceLocator. Other parameters are auxiliary query conditions. All conditions are combined using AND logic. Provide sufficiently precise parameters to identify the target device. queryKeys only selects returned data groups or fields; it does not participate in device matching.

NameTypeMandatoryDescription
deviceLocatorobjectYesUsed to retrieve basic device information. When deviceLocator is selected as a query condition, at least one of the following parameters must be provided: chipUid, bleMac, serialNumber, matterQrcode, or matterManualCode
├──chipUidstringNomcuId in the programmed device chip
├──bleMacstringNoBluetooth MAC address of the chip
├──serialNumberstringNoDevice serial number assigned during programming
├──matterQrcodestringNoMatter commissioning QR code
├──matterManualCodestringNoMatter manual commissioning code
filtersobjectNoAuxiliary filter conditions used to improve device identification accuracy
├──productionTimeStartstringNoDevice programming production start time. Date format: 2025-12-16T12:02:58+08:00
├──productionTimeEndstringNoDevice programming production completion time. Date format: 2025-12-17T12:02:58+08:00
├──batchIdstringNoProduction batch number
matterobjectNoMatter-related device parameters. Providing this parameter helps improve query accuracy
├──pidstringNoMatter PID. Including this parameter helps improve device query accuracy
├──vidstringNoMatter VID. Including this parameter helps improve device query accuracy
customParamsobjectNoCustom filter parameters. For details, refer to the description of customParams parameter.
queryKeysstring[]RecommendedPass a string array naming groups (such as matterData) or fields (such as chipData.chipUid). If a local device profile matches but queryKeys is omitted or empty, the API returns an empty object {} rather than all fields by default. See the queryKeys V2 list for supported keys.

Description of customParams Parameter

This API accepts custom query conditions in customParams for more flexible filtering. To query fields uploaded for a business use case, add the field names and expected values to this object as key-value pairs.

Parameter structure

  • Type: JSON object (key-value collection).
  • Key: The extension field name to match (for example, "customData").
  • Value: The expected value for this field (for example, "customDataValue").

Example

{"customData1": "customDataValue1", "customData2": "customDataValue2"}

This example indicates querying device records where the reported data customData1 equals "customDataValue1" and customData2 equals "customDataValue2".

NameTypeMandatoryDescription
keystringYes Used to query the basic key values in the device profile information. The available keys are either system-generated or a set of custom keys uploaded during the programming process
valuestringYes Each key corresponds to the value of the query parameter

5.1.4 Response Parameters​

tip

The following table shows the data returned when querying all queryKeys. In practice, querying only the required keys can help improve API performance.

NameTypeDescription
respCodestring8000 indicates success; any other value indicates an error. Detailed error information can be found in respMsg
respMsgstringResponse messages, such as NoError or DataNotFound
respDataobjectQuery result data
├──matterDataobjectMatter data related
       ├──iterationsstringIteration count
       ├──commissioningFlowsstringCommissioning flow
       ├──discoverableModestringDevice discoverable mode
       ├──vidstringVendor ID
       ├──pidstringProduct ID
       ├──discriminatorstringDiscriminator
       ├──enableRotatingDeviceIdstringEnable rotating device identifier
       ├──manualCodestringManual pairing code
       ├──passcodestringPairing code
       ├──qrcodestringMatter commissioning QR code
       ├──saltstringSalt
       ├──saltLengthstringSalt length
       ├──uniqueidstringUnique device identifier
       ├──verifierstringPassword verifier
       ├──serialNumberstringMatter device programming serial number
       ├──dacCertMd5stringDAC certificate MD5
       ├──cdFileMd5stringCD file MD5
       ├──cdFileNamestringCD file name
       ├──paiCertMd5stringPAI certificate MD5
├──factoryDataobjectFactory data configuration related
       ├──vendorNamestringVendor name
       ├──hardwareVersionstringHardware version
       ├──hardwareVersionStringstringHardware version string
       ├──partNumberstringPart number
       ├──productUrlstringProduct URL
       ├──productLabelstringProduct label
       ├──productNamestringProduct name
       ├──startAddressstringStart address
├──programmingDataobjectDevice programming results related
       ├──programmingStatusstringDevice programming status
  • Success: success
  • Failure: failure
  • Pending: pending
       ├──programmingLogstringProgramming log
       ├──programmingTimestringProgramming time
├──chipDataobjectChip data related
       ├──chipUidstringmucId in the programmed device chip
       ├──bleMacstringBluetooth MAC address of the chip
├──firmwareDataobject[]Firmware related
       ├──fwNamestringFirmware name
       ├──fwMd5stringFirmware MD5
├──customDataobjectCustom data reported by the customer during production

5.1.5 Request Example​

{
"deviceLocator": {
"chipUid": "f9e203b4cf3ce632363736425055f321",
"bleMac": "f9:e2:03:b4:cf:3c:e6:32",
"serialNumber": "8360224622727172372"
},
"filters": {
"productionTimeStart": "2025-12-16T12:02:58+08:00",
"batchId": "7603594830282752"
},
"matter": {
"pid": "8001",
"vid": "FFF2"
},
"customParams": {
"customData1": "nPK3DqGQQwdE3fYxaofURw==",
"customData2": "1"
},
"queryKeys": [
"matterData.vid",
"matterData.pid",
"matterData.manualCode",
"matterData.passcode",
"matterData.qrcode",
"matterData.salt",
"matterData.uniqueid",
"matterData.verifier",
"matterData.serialNumber",
"matterData.dacCertMd5",
"matterData.paiCertMd5",
"factoryData.vendorName",
"factoryData.hardwareVersion",
"factoryData.hardwareVersionString",
"factoryData.partNumber",
"factoryData.productUrl",
"factoryData.productLabel",
"factoryData.productName",
"programmingData.programmingStatus",
"chipData.chipUid",
"chipData.bleMac",
"firmwareData.fwName",
"firmwareData.fwMd5"
]
}

5.1.6 Response Example​

Note: This response example shows all result data. In practice, use queryKeys to retrieve only the required data.

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"matterData": {
"vid": "FFF2",
"pid": "8001",
"manualCode": "20761614023",
"passcode": "22977984",
"qrcode": "MT:634J0-C714UM2X1HI00",
"salt": "jBRIAMrVMVpvwAbCQ1Hmz9/sIATvea2p2KsFAaEw7a8=",
"uniqueid": "nPK3DqGQQwdE3fYxaofURw==",
"verifier": "TYoyImPfYZSaonfzSxlTnhzSJMuLMXnUZ1lgeQUIEIUESKVboFoQjzLVmwsAl9TUzYjwcbnpflP9WpTIzMNzpxedPeNIqwYk60nYXymhyziGOG/VZjwSHiRb+5xkS2Pn7w==",
"dacCertMd5": "61FC127CD890B6BE828001753161CDE1",
"paiCertMd5": "61FC127CD890B6BE828001753161CD41"
},
"factoryData": {
"vendorName": "vn",
"hardwareVersion": "1",
"hardwareVersionString": "121",
"partNumber": "1234",
"productUrl": "456",
"productLabel": "789",
"productName": "pn"
},
"programmingData": {
"programmingStatus": "success"
},
"firmwareData": [
{
"fwName": "81204_Ctrl_Multi_qpg6200_X_09B9_20250206_V1.8.5.hex",
"fwMd5": "61FC127CD890B6BE828001753161CD42"
},
{
"fwName": "81204_Ctrl_Multi_qpg6200_X_09B9_20251215_V2.0.1.hex",
"fwMd5": "61FC127CD890B6BE828001753111CD12"
}
],
"chipData": {
"chipUid": "0b90cff640d5daf4",
"bleMac": "00:00:00:04:C9:84"
}
},
"respTime": 1765768529
}

5.1.7 Current Implementation Notes​

  • Supported data groups: matterData、factoryData、programmingData、chipData、firmwareData、customData、seData。
  • Field return rules: seData can be returned only as a whole group; specifying seData.xxx does not filter its subfields. Unknown groups in queryKeys add no data. If a requested field is empty or has not been stored, its value may be empty.
  • Programming data: programmingData.programmingStatus supports success, failure, and pending. The current local data construction logic does not populate programmingLog with actual log content; do not rely on it for programming logs.
  • Authentication: UkeyPermissionFilter does not enforce station session validation for this API. See API Call Conventions and Authentication for platform authentication requirements.

5.2 Update Devices Profile​

After a factory modifies device programming data, it can use this API to synchronize the updates to OBIS for centralized management.

5.2.1 Request Method​

POST

5.2.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/v1/updateDevicesProfile

5.2.3 Request Body​

The request body contains the following parameters:

NameTypeMandatoryDescription
deviceLocatorobjectYesUsed to retrieve basic device information. When deviceLocator is selected as a query condition, at least one of the following parameters must be provided: chipUid, bleMac, serialNumber, matterQrcode, or matterManualCode
├──chipUidstringNo mcuId in the programmed device chip
├──bleMacstringNo Bluetooth MAC address of the chip
├──serialNumberstringNo Device serial number assigned during programming
├──matterQrcodestringNo Matter commissioning QR code
├──matterManualCodestringNo Matter manual commissioning code
filtersobjectNo Auxiliary filter conditions used to improve device identification accuracy
├──productionTimeStartstringNo Device programming production start time. Date format: 2025-12-16T12:02:58+08:00
├──productionTimeEndstringNo Device programming production completion time. Date format: 2025-12-17T12:02:58+08:00
├──batchIdstringNo Production batch number
matterobjectNo Matter-related device parameters. Providing this parameter helps improve query accuracy
├──pidstringNo Matter PID. Including this parameter helps improve device query accuracy
├──vidstringNo Matter VID. Including this parameter helps improve device query accuracy
customParamsobjectNo Custom filter parameters. For details, refer to the description of customParams parameter.
updateParamsobject[]NoPass updates as an array. Each item contains type, key, and value, all strings. An empty array does not update fields. See the updateParams description for supported keys and operations.

Description of updateParams Parameter

This API accepts system-supported keys in updateParams to modify specified fields in a device record. Provide the field name, target value, and operation type (type) together as an array.

Parameter structure

  • Type: JSON array.
  • When type is add, a new field record corresponding to the key will be created; if the key already exists, its field value will be updated.
  • Some device data supports deletion. When type is delete, the field record corresponding to the key will be deleted.
  • For details about the keys supported by this parameter, refer to the updatable keys list (updateDevicesProfile).

Example

[
{
"type": "add",
"key": "qrcode",
"value": "MT:XXX-S0XXXX"
},
{
"type": "delete",
"key": "factoryData.productURL"
},
{
"type": "add",
"key": "factoryData.qqbb",
"value": "abcd"
},
{
"type": "add",
"key": "firmwareData.bootloader-xxx-1.1.s37",
"value": "00000001"
}
]

The above example indicates:

  1. Add the qrcode field and set its value to MT:XXX-S0XXXX; if the field already exists in the device, the existing value will be overwritten.
  2. Delete the productURL field from factoryData of the device.
  3. Add the qqbb field to factoryData of the corresponding device and set its value to abcd.
  4. Add the firmware bootloader-xxx-1.1.s37 to the firmware list of the device and set its startAddress to 00000001. If a firmware with the same name already exists in the device, update its start address to this value.

5.2.4 Response Parameters​

NameTypeDescription
respCodestring8000 indicates success; any other value indicates an error. Detailed error information can be found in respMsg
successboolTrue indicates success
respMsgstringResponse messages, such as NoError or DataNotFound

5.2.5 Request Example​

{
"deviceLocator": {
"chipUid": "f9e203b4cf3ce632363736425055f321"
},
"filters": {
"productionTimeStart": "2025-12-16T12:02:58+08:00",
"batchId": "7603594830282752"
},
"matter": {
"pid": "8001",
"vid": "FFF2"
},
"customParams": {
"customData1": "nPK3DqGQQwdE3fYxaofURw=="
},
"updateParams": [
{
"type": "add",
"key": "qrcode",
"value": "MT:XXX-S0XXXX"
},
{
"type": "delete",
"key": "factoryData.productURL",
"value": ""
},
{
"type": "add",
"key": "factoryData.qqbb",
"value": "abcd"
},
{
"type": "add",
"key": "firmwareData.bootloader-xxx.s37",
"value": "00000000"
}
]
}

5.2.6 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respTime": 1765768529
}

5.2.7 Operation Rules and Limits​

The following requirements apply to fields in updateParams:

FieldTypeMandatory / conditionDescription
updateParams[].typestringBy operationadd creates or overwrites; delete applies only to collection fields that support deletion.
updateParams[].keystringYesA system key or collection prefix listed in Appendix 3.
updateParams[].valuestringFor addOnly strings are accepted. Date and integer text must meet the target field format requirements.
Device Location and Update Scope​

The device location rules for deviceLocator, filters, matter, and customParams are the same as for Query Device Details. Updates affect local device profiles only; they do not query historical or cloud data.

Field Value Rules​
  • The environment value supports only test and prod.
  • programmingStatus supports Complete, Failed, and Unreported. Other values are currently treated as incomplete.
Field Update and Deletion Rules​
  • Deletable fields: factoryData.*, firmwareData.*, otherFile.*, attachment.*, and programmingScript.
  • Fields that cannot be deleted: scalar keys and extend.* are currently assigned directly from value; delete is not supported.
  • Unknown fields: unknown keys are currently skipped and do not necessarily produce a parameter error.
Other Processing Rules​
  • If updateParams is an empty array, no fields are updated, but the service still attempts to read the target device profile and metadata.
  • After an update, the record is marked as awaiting synchronization. Receiving the HTTP response does not mean cloud synchronization is complete.

5.3 Upload Device Production Data​

Factories can use this API to upload programming, test, and assembly data generated during device production and maintain the corresponding production record by traceId. At the end of programming, the API reuses the programmingResult processing logic. Test and assembly data are synchronized by a subsequent asynchronous flow.

5.3.1 Request Method​

POST

5.3.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/v1/deviceData/upload

5.3.3 Request Body​

The Content-Type for this API is application/json. In addition to the common request headers, provide the following header:

FieldMandatoryDescription
x-snbps-sessionYesStation session token returned by /login.

5.3.4 Request Body​

The request body contains the following parameters:

NameTypeMandatory / conditionDescription
traceIdstringBy scenarioProduction record trace ID; uuid is an accepted alias. In the programming scenario, use the uuid returned by /getProgrammingData. If omitted, a new record may be created. A supplied value must refer to an existing production record or file task; otherwise the API returns 8006.
scenarioTypestringRequired for test or custom scenariosProduction scenario name, for example RF-Test. The assembly batch uses assembly, and an existing programming session uses programming. Other scenarios return 8069 if this field is absent.
deviceIdstringRequired for test or assembly integrationDevice MCU ID. If omitted, deviceRecord.deviceId is used.
batchIdstringRequired for assembly integrationProduction batch ID. Only a numeric string is treated as an ID. Assembly is identified by batch type, not by scenarioType=assembly alone.
deviceProfileIdstringNoExisting device profile ID; it must correspond to deviceId. If omitted, the service matches an existing profile by device ID.
stationIdstringNoProgramming Station code. If omitted, the station in the current session is used. It need not be numeric.
factoryIdstringNoFactory ID. For new records, only a numeric string takes effect; otherwise the factory from the current session is used.
deviceSnstringNoDevice serial number.
resultbooleanRecommended for programmingProgramming result: true for success, false for failure. If omitted at the end of programming, it is treated as failure.
failureReasonstringNoFailure reason, stored in the production record.
timestampstringNoThis API does not use this field to set the production record time; the server generates the creation time.
statusstringNoCustom status. Programming and assembly may generate and overwrite it from the system result; other nonempty values are stored in customStatus.
deviceRecordobjectPer scenario integration contractDevice production data; deviceProfile is an accepted alias. See deviceRecord parameters for its fields.

5.3.5 deviceRecord Parameters​

deviceRecord contains data produced by the device at the current production stage.

NameTypeRequired / ConditionDescription
deviceIdstringConditionally requiredDevice MCU ID; used when top-level deviceId in the request body is empty.
firmwareVersionstringAs needed for programmingFirmware version
seidstringAs needed for SE programmingSEID; use lowercase for the field name.
cplcstringAs needed for SE programmingCPLC data
matterDatamapAs needed for Matter programmingMatter data actually programmed.
factoryDatamapNoFactory Data actually programmed. Field names must be nonempty and values must be strings.
customDatamapNoCustom data, up to 50 fields. Field names must be nonempty and no longer than 64 characters, and values must be strings; otherwise 8002 is returned. This upload replaces all existing customData.
testDatamapRequired for test / assembly integrationTest data; also accepts the legacy field name diagnosticData. Values may be text or lists of file references. Fields with the same name are appended when both values are lists; otherwise the new value overwrites the old one.

5.3.6 Scenario Handling Rules​

Parameter requirements and handling rules for different production scenarios are as follows:

ScenariotraceId and BatchData and Status
ProgrammingUse the existing programming session traceId, usually from /getProgrammingData.Provide deviceRecord based on the actual programmed content and explicitly pass result. At completion, the API reuses /programmingResult handling. Merely setting scenarioType=programming does not create a complete programming flow.
Test / CustomThe first upload may omit traceId; later uploads use the traceId returned in the response. scenarioType is required.Provide deviceId and deviceRecord.testData as specified by the integration contract. If a matching device profile exists, it is associated; otherwise only a production record may be created and deviceProfileId is null.
AssemblybatchId identifies the assembly batch. traceId may come from /getProgrammingData or a file task; a new record can also be created if the first upload omits it.Provide deviceId and deviceRecord.testData. The scenario is fixed to assembly. testData.result affects result status and output counts. The current implementation deduplicates successful assembly records for the same device in the same batch.
Parameter Length and Format Limits​

Database field length limits are as follows:

FieldMaximum Length
traceId64 characters
deviceId128 characters
deviceSn64 characters
failureReason1024 characters
status / scenarioType64 characters

These length limits do not mean that the API automatically validates every request field. ID values must fall within the Java Long range. Overlong fields, invalid number formats, or violations of database constraints may cause data persistence to fail. Numeric strings must also satisfy the applicable length and value limits.

Other Handling Rules​
  • Programming data: The integration contract requires at least one of deviceRecord.firmwareVersion, deviceRecord.seid, deviceRecord.cplc, or deviceRecord.matterData, but the current API does not enforce this requirement.
  • Test and assembly data: Upload test data in deviceRecord.testData. A top-level customData field in the request body is not recognized as deviceRecord.customData.

5.3.7 Request Example​

Programming Scenario​

Use the uuid returned by /getProgrammingData as traceId, and submit the programming result and device data.

{
"traceId": "<uuid returned by getProgrammingData>",
"deviceId": "DEVICE-001",
"result": true,
"deviceRecord": {
"firmwareVersion": "1.2.3",
"matterData": {
"qrcode": "<actual commissioning payload>"
},
"customData": {
"mac": "AA:BB:CC:DD:EE:FF"
}
}
}
Test Scenario​

The first test report may omit traceId. Specify the test scenario through scenarioType and submit the test data in testData.

{
"scenarioType": "RF-Test",
"deviceId": "DEVICE-001",
"status": "success",
"deviceRecord": {
"testData": {
"voltage": "3.3",
"result": "success"
},
"customData": {
"fixture": "A01"
}
}
}
Assembly Scenario​

Use batchId to specify the assembly batch. The first report may omit traceId.

{
"batchId": "<actual assembly batch ID>",
"deviceId": "DEVICE-001",
"deviceRecord": {
"testData": {
"eol": "pass",
"result": "success"
}
}
}

5.3.8 Associate Files with Production​

To associate a test file, first upload it with POST /v1/testFile/upload and save the returned traceId. Then call this API with the same traceId and reference the file through fileName in testData.

If an existing production record has a traceId, you may pass it when uploading the file. fileTraceId is an internal association field and need not be added to the top level of this API request.

Request example:

{
"traceId": "<traceId returned by testFile/upload>",
"scenarioType": "RF-Test",
"deviceId": "DEVICE-001",
"deviceRecord": {
"testData": {
"report": [
{
"fileName": "report.txt"
}
]
}
}
}

5.3.9 Response Parameters​

This API uses the standard JSON response format. See "Standard Response and Error Handling" for common response fields. respData contains the following fields:

FieldTypeDescription
traceIdstringTrace ID ultimately used by the server. Pass it unchanged on subsequent uploads.
deviceProfileIdinteger (int64) / nullAssociated device profile ID; null if none is associated.
programmingRecordIdinteger (int64)Device production record ID

5.3.10 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"traceId": "example-trace-id",
"deviceProfileId": 200,
"programmingRecordId": 11
},
"respTime": 1792108800
}

5.3.11 Main Error Codes​

Error CodeDescription
8002Custom field does not meet requirements.
8006traceId is not associated with an existing production record or file task.
8007Data persistence failed.
8032Batch does not exist.
8037Device profile creation failed.
8050Programming Station session expired.
8069scenarioType is missing for a test or custom scenario.

5.3.12 HTTP Call Example and Subsequent Uploads​

The following curl example uploads test data for the first time. BASE_URL contains only the scheme, host, and port, for example http://edge-host:8005. SESSION is the session token returned by /login for the Programming Station. If platform authentication is enabled in the target environment, also supply the x-snbps-auth-token header.

curl -X POST "$BASE_URL/api/iot-factory-edge-service/v1/deviceData/upload" \
-H "Content-Type: application/json;charset=utf-8" \
-H "x-snbps-session: $SESSION" \
-d '{
"scenarioType": "RF-Test",
"deviceId": "DEVICE-001",
"status": "success",
"deviceRecord": {
"testData": {"voltage": "3.3", "result": "success"},
"customData": {"fixture": "A01"}
}
}'
Subsequent Upload Rules and Notes​
  • Trace ID: After the first successful upload, save respData.traceId from the response. Pass that value at the top level of subsequent uploads to the same production record, and continue to supply scenarioType. Independent tests must not reuse an existing traceId.
  • Identifiers: x-snbps-request-id is only for request tracing and cannot replace the business traceId. Passing a traceId that does not exist and is not associated with a file task returns 8006.
  • Test data: Under the same traceId, list fields with the same name in testData are appended. Repeated requests may create duplicate attachment references.
  • Custom data: Each upload replaces all existing customData. On a subsequent upload, include every custom field you need to retain.
  • Repeated requests: After a network timeout, do not assume that the previous request did not run or that repeated uploads are fully idempotent.

5.4 Query Device Information​

This API queries general information, Matter data, and specified custom data in the local device profile. Unlike /v1/device/detail, it cannot select returned fields through queryKeys.

5.4.1 Request Method​

POST

5.4.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/v1/device/information/query

5.4.3 Request Headers​

In addition to the common request headers, this API requires the following header:

FieldRequiredDescription
x-snbps-sessionYesProgramming Station session token returned by /login.

5.4.4 Request Body​

The request body contains the following parameters. Supply at least one nonempty device identifier.

FieldTypeRequired / ConditionDescription
deviceIdstringAt least one requiredExact match against deviceId in the device profile; maximum 128 characters.
chipIdstringAt least one requiredExact match against chipUid in the device profile; maximum 128 characters.
uniqueIdstringAt least one requiredMatch uniqueId, uniqueid, or the corresponding snake_case fields in Matter data; maximum 128 characters.

5.4.5 Notes​

  • Query conditions: Multiple nonempty device identifiers are combined with AND; all conditions must match.
  • Query scope: Only local device profiles are queried, not the historical database or cloud. If no record matches, the API returns 8101.
  • Query result: If multiple records match, the first result is returned. This does not guarantee identifier uniqueness or that the returned device was programmed successfully.
  • Programming status: provisionStatus currently always returns Success and cannot, by itself, establish the device's actual programming status.

5.4.6 Request Example​

{
"deviceId": "DEVICE-001"
}

5.4.7 Response Parameters​

This API uses the standard JSON response format. respData contains the following data objects:

FieldTypeDescription
generalDataobjectDevice identity, programming information, and product version information.
matterDataobject / nullMatter certificate and commissioning data; may be null for non-Matter devices.
customDataobjectDevice serial number, business identifier, MAC address, and test and calibration data.

Fields without recorded values may be empty.

5.4.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"generalData": {
"deviceId": "DEVICE-001",
"provisionStatus": "Success",
"provisionTime": "2026-10-16T02:00:00Z",
"sourceProgramingBatchId": "10",
"provisionFactoryId": "20",
"provisionStationId": "30",
"productId": "40",
"productName": "sample product",
"productVersionId": "50",
"productVersionName": "1.0"
},
"matterData": null,
"customData": {
"serialNumber": "SN-001",
"customId": "CUSTOM-001",
"macAddress": "AA:BB:CC:DD:EE:FF",
"factoryTestData": null,
"calibrationParams": null
}
},
"respTime": 1792108800
}

5.4.9 Response Field Descriptions​

generalData: General information​
tip

sourceProgramingBatchId is the actual response field name; retain the original "Programing" spelling.

FieldTypeDescription
deviceIdstringDevice ID
provisionStatusstringProgramming status; currently always returns Success.
provisionTimestringProgramming time in UTC ISO 8601 format.
sourceProgramingBatchIdstringSource programming batch ID
provisionFactoryIdstringProgramming factory ID
provisionStationIdstringProgramming Station ID; corresponds to the station primary key in the device profile.
productIdstringProduct ID
productNamestringProduct name
productVersionIdstringProduct version ID
productVersionNamestringProduct version name
matterData: Matter data​
FieldTypeDescription
dacCertstringDAC certificate in its stored Base64 DER or PEM format.
paiCertstringPAI certificate in its stored Base64 DER or PEM format.
certDeclarationstringCertification Declaration (CD), Base64 encoded.
discriminatorintegerMatter Discriminator as a decimal number.
spake2pIterationCountintegerSPAKE2+ iteration count.
passcodestringMatter commissioning passcode.
manualPairingCodestringMatter manual pairing code.
setupPayloadstringMatter commissioning payload.
spake2pVerifierstringSPAKE2+ verifier; retain the stored value.
spake2pSaltstringSPAKE2+ salt; retain the stored value.
customData: Custom data​
tip

Before returning factoryTestData and calibrationParams, the API recursively removes defined credential fields and does not return the device private key.

FieldTypeDescription
serialNumberstringDevice serial number
customIdstringBusiness identifier
macAddressstringMAC address
factoryTestDataJSONFactory test data
calibrationParamsJSONDevice calibration parameters

5.4.10 Main Error Codes​

Error CodeDescription
8002All query parameters are empty.
8007Stored data could not be parsed.
8050Authentication failed.
8101No matching device found.

See the appendix for other error codes.

5.5 Recover Matter QR Code​

During assembly, this API uses the input programming batch associated with the assembly batch, Matter VID, PID, Discriminator, and the Rotating Device Identifier (RDI) in BLE advertising to find a successfully programmed local device profile and recover its Matter onboarding data.

5.5.1 Request Method​

POST

5.5.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/v1/matter/onboarding-payloads/recover

5.5.3 Request Body​

In addition to the common request headers, this API requires the following header:

ParameterRequiredDescription
x-snbps-sessionYesProgramming Station session token returned by /login.

5.5.4 Request Body​

The request body contains the following parameters:

FieldTypeRequiredDescription
batchIdstringYesAssembly batch ID. It must be associated with an input programming batch, have RUNNING status, and not be expired.
matterProductIdstringYesMatter PID as a hexadecimal string without a 0x prefix. Do not use productId or pid as the field name.
matterVendorIdstringYesMatter VID as a hexadecimal string without a 0x prefix. Do not use vendorId or vid as the field name.
discriminatorstringYesHexadecimal string whose parsed value is in the range 0x000–0xFFF, for example 0F00. Do not pass a decimal string.
rotatingDeviceIdentifierstringYesRDI from BLE advertising: 18 bytes (36 hexadecimal characters), without a 0x prefix. Use the actual advertised value.

5.5.5 Notes​

  • Query scope: Only successfully programmed local device profiles in the input programming batch associated with the assembly batch are queried. The API does not look up RDI in the cloud.
  • Device matching: The device is matched using VID, PID, Discriminator, and RDI. An RDI mismatch or no matching device returns 8101.
  • Data format: VID and PID are matched against their text values in the database. Use the same format as the batch data.

5.5.6 Request Example​

{
"batchId": "<assembly batch ID>",
"matterProductId": "8001",
"matterVendorId": "FFF2",
"discriminator": "0F00",
"rotatingDeviceIdentifier": "<actual 36-character hexadecimal BLE advertising RDI>"
}

5.5.7 Response Parameters​

This API uses the standard JSON response format. The current implementation returns the following four fields in respData, rather than only setupPayload:

FieldTypeDescription
setupPayloadstringMatter QR-code commissioning payload.
deviceIdstringDevice ID
deviceProfileIdintegerDevice profile ID
manualCodestringMatter manual onboarding code. The field name is manualCode, not manualPairingCode.

5.5.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"setupPayload": "<actual QR code payload>",
"deviceId": "DEVICE-001",
"deviceProfileId": 200,
"manualCode": "<actual manual pairing code>"
},
"respTime": 1792108800
}

5.5.9 Main Error Codes​

Error CodeDescription
8002Invalid Discriminator parameter.
8009Batch has expired.
8010Batch is not in RUNNING status.
8032Assembly batch or its association does not exist.
8050Authentication failed.
8101No matching device found.

See the appendix for other error codes.

5.6 Upload Device Test File​

This API uploads device test files. After receiving a file, it saves the file locally and creates an asynchronous upload task. The HTTP response only confirms receipt and local processing; it does not mean the file has reached cloud storage.

5.6.1 Request Method​

POST

5.6.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/v1/testFile/upload

5.6.3 Request Body​

This API uses multipart/form-data as its Content-Type. In addition to the common request headers, supply the following header:

ParameterRequiredDescription
x-snbps-sessionYesProgramming Station session token returned by /login.

5.6.4 Request Body​

This API uploads files through multipart/form-data with the following parameters:

FieldTypeRequiredDescription
traceIdstring (form field)NoExisting script trace ID, if available; generated automatically if omitted. Pass the returned traceId unchanged to the production data upload API.
filesfile[] (multipart parts)YesList of files to upload; include at least one nonempty file. Repeat the files field to upload multiple files in one request. File names must not include a path, must not be . or .., and must be unique within the request.

5.6.5 Notes​

  • File handling: After receiving a file, the API saves it locally, then creates an asynchronous upload task.
  • Task tracking: Pass an existing traceId if available; otherwise the API generates one. Pass the returned traceId unchanged to subsequent production data uploads.
  • Upload status: A successful HTTP request does not mean the file has reached cloud storage. Errors during the background upload may not appear in the initial HTTP response.
  • File size limits: File size is limited by the deployment's multipart configuration. application.yml defaults to 2 GB per file and 4 GB per request; the dev configuration sets 200 MB and 250 MB, respectively. Environment variables or external configuration may override the actual limits.

5.6.6 Request Example​

curl -X POST "$BASE_URL/api/iot-factory-edge-service/v1/testFile/upload" \
-H "x-snbps-session: $SESSION" \
-F "files=@./report.txt" \
-F "files=@./photo.png"

5.6.7 Response Parameters​

This API uses the standard JSON response format. respData contains the following fields:

FieldTypeDescription
traceIdstringFile task trace ID.
fileCountintegerNumber of files received in this request.
statusintegerAsynchronous file upload task status: 1 pending sync; 2 uploading; 3 successful; 4 awaiting retry; 5 failed; 6 local file cleaned up.

5.6.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"traceId": "example-file-trace-id",
"fileCount": 2,
"status": 1
},
"respTime": 1792108800
}

5.6.9 Main Error Codes​

Error CodeDescription
8057Invalid upload parameters.
8058File list or file name does not meet requirements.
8059Local file storage failed.
8060Failed to save the file upload task.
8061Background cloud storage upload failed.
8051Insufficient storage space or concurrent processing capacity.

Errors during asynchronous background upload may not appear in the initial HTTP response. See the appendix for other error codes.

5.7 Connection Heartbeat​

The programming client uses this API to check connectivity to the Edge service.

5.7.1 Request Method​

GET

5.7.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/heartBeat

5.7.3 Request Parameters​

This is an initialization API. It does not require a Programming Station session token in advance and has no request parameters.

5.7.4 Notes​

The client may call this API periodically as needed. A successful heartbeat only means the Edge HTTP service is reachable; it does not establish that other business services are healthy.

5.7.5 Request Example​

GET {BASE_URL}/api/iot-factory-edge-service/heartBeat

5.7.6 Response Parameters​

This API uses the standard JSON response format. On success, respData is null.

5.7.7 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": null,
"respTime": 1792108800
}

5.8 Query Login Options​

For compatibility with older clients, this API queries whether a U-Safe and a production password are required for the batch assigned to the Programming Station.

5.8.1 Request Method​

GET

5.8.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/queryLoginOptions

5.8.3 Request Parameters​

This is an initialization API and does not require a Programming Station session token in advance. Pass the following fields as query parameters:

FieldTypeRequired / ConditionDescription
usafeSNstringProvide at least one of usafeSN or stationId.Legacy U-Safe serial number.
stationIdstringProvide at least one of usafeSN or stationId.Programming Station code; takes precedence when supplied.

5.8.4 Notes​

  • Query conditions: The Programming Station and its assigned batch must exist.
  • Compatibility: This API supports older clients. In the newer login flow, call /queryLoginType first to determine the Programming Station login method.

5.8.5 Request Example​

GET {BASE_URL}/api/iot-factory-edge-service/queryLoginOptions?stationId=STATION-001

5.8.6 Response Parameters​

This API uses the standard JSON response format. respData contains the following fields:

FieldTypeDescription
requireUsafebooleanWhether U-Safe is required; currently always true.
requirePasswordbooleanWhether a production password is required, as determined by the assigned batch setting.

5.8.7 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"requireUsafe": true,
"requirePassword": false
},
"respTime": 1792108800
}

5.8.8 Main Error Codes​

Error CodeDescription
8007Programming Station or assigned batch not found.

See the appendix for other error codes.

5.9 Query Programming Station Login Method​

This API queries the login method for a specified Programming Station and supports reporting client information for compatibility.

5.9.1 Request Method​

POST

5.9.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/queryLoginType

5.9.3 Request Body​

This is an initialization API and does not require a Programming Station session token in advance. The request body contains the following parameters:

FieldTypeRequired / ConditionDescription
factoryIdinteger (int64)Required for cloud factoriesIn cloud mode, verifies that the specified factory exists and is a cloud factory.
stationIdstringYesProgramming Station code
clientPcMessagestringNoJSON object string containing client information. Deprecated since 3.3.2; new clients should report it through /login.

5.9.4 Notes​

Cloud factory login supports only password or Identity U-Safe authentication.

5.9.5 Request Example​

{
"factoryId": 20,
"stationId": "STATION-001"
}

5.9.6 Response Parameters​

This API uses the standard JSON response format. respData contains the following fields:

FieldTypeDescription
loginTypeintegerLogin method: 1 passwordless; 2 password; 3 Identity U-Safe.

5.9.7 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"loginType": 2
},
"respTime": 1792108800
}

5.9.8 Main Error Codes​

Error CodeDescription
8016Programming Station does not exist.
8036Invalid cloud factory ID.

See the appendix for other error codes.

5.10 U-Safe Pre-login​

This API performs the first step of U-Safe mutual authentication and returns the server certificate, challenge, and signature.

5.10.1 Request Method​

GET

5.10.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/preLogin

5.10.3 Request Parameters​

This is an initialization API and does not require a Programming Station session token in advance. Pass the following fields as query parameters:

FieldTypeRequired / ConditionDescription
usafeSNstringYesIdentity U-Safe serial number.
noncestringYesClient-generated random challenge.
typeintegerNoCompatibility parameter; the current method does not use its value.
factoryIdinteger (int64)Pass by factory in cloud modeUsed to match the factory scope in cloud mode.

5.10.4 Notes​

  • Scope: This API is for U-Safe mutual authentication, not direct password login.
  • Signature handling: sign in the response is the server signature and cannot be used directly as the client login signature. The client should verify the server's identity, sign challenge according to the existing U-Safe authentication protocol, then call /login.

5.10.5 Request Example​

GET {BASE_URL}/api/iot-factory-edge-service/preLogin?usafeSN=USAFE-001&nonce=%3C%E5%AE%A2%E6%88%B7%E7%AB%AF%E9%9A%8F%E6%9C%BA%E6%95%B0%3E&factoryId=20

5.10.6 Response Parameters​

This API uses the standard JSON response format. respData contains the following fields:

FieldTypeDescription
certstringServer authentication certificate.
challengestringServer challenge data for the client to sign.
signstringServer signature for the client to verify server identity.

5.10.7 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"cert": "<authentication certificate>",
"challenge": "<server challenge>",
"sign": "<server signature>"
},
"respTime": 1792108800
}

5.10.8 Main Error Codes​

Error CodeDescription
8020U-Safe does not exist.
8031U-Safe is unavailable.
8024 / 8026Authentication or signature verification failed.

See the appendix for other error codes.

5.11 Programming Station Login​

This API authenticates the Programming Station and obtains a station session token. After a successful login, the programming client passes the returned token in the x-snbps-session header on subsequent requests requiring a station session.

5.11.1 Request Method​

POST

5.11.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/login

5.11.3 Request Body​

This is an initialization API and does not require a Programming Station session token in advance. The request body contains the following parameters:

FieldTypeRequired / ConditionDescription
stationIdstringRequired for new login flowWhen nonempty, authenticates the Programming Station; when omitted, uses the legacy U-Safe authentication flow.
factoryIdinteger (int64)Required for cloud factoriesFactory ID
passwordstringRequired when loginType=2Password encrypted with the existing RSA public key; do not pass plaintext.
usafeSNstringRequired for loginType=3 or legacy flowIdentity U-Safe serial number; must match the Programming Station.
signstringRequired for U-Safe authenticationClient signature over the challenge returned by /preLogin.
usafeCertstringNoCompatibility field; not directly used by the current controller branch.
clientPcMessagestringNoJSON object string containing client information.

5.11.4 Notes​

  • Login method: Follow the authentication flow corresponding to the method returned by /queryLoginType.
  • Passwordless login: NO_PASSWORD (loginType=1) does not require a password.
  • Password login: PASSWORD (loginType=2) requires an RSA-encrypted password.
  • U-Safe login: IDENTITY_USAFE (loginType=3) requires a prior /preLogin call and a client signature.
  • Session token: The returned token authenticates the Programming Station session and must not be confused with a business operation's uuid or traceId.

5.11.5 Request Example​

{
"factoryId": 20,
"stationId": "STATION-001",
"password": "<RSA-encrypted password>",
"clientPcMessage": "{\"hostname\":\"PS-01\"}"
}

5.11.6 Response Parameters​

This API uses the standard JSON response format. respData contains the following fields:

FieldTypeDescription
stationIdstringProgramming Station code
tokenstringProgramming Station session token
factoryIdinteger (int64)Factory ID
partnerCodestringTenant code

5.11.7 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"stationId": "STATION-001",
"token": "<station session token>",
"factoryId": 20,
"partnerCode": "<tenant code>"
},
"respTime": 1792108800
}

5.11.8 Main Error Codes​

Error CodeDescription
8012Programming Station already logged in
8014Incorrect password
8016Programming Station does not exist
8017Unsupported login method
8020 / 8021U-Safe does not exist or does not match
8036Invalid cloud factory ID

See the appendix for other error codes.

5.12 Programming Station Logout​

This API removes the current Programming Station session from the cache to log the station out.

5.12.1 Request Method​

POST

5.12.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/logout

5.12.3 Request Body​

This API should include the following header to identify the current Programming Station and factory context:

ParameterRequired / ConditionDescription
x-snbps-sessionRequired for an effective logout.Programming Station session token returned by /login

5.12.4 Request Parameters​

This API requires no request parameters.

5.12.5 Notes​

  • Session identification: A valid x-snbps-session is required to identify and clear the corresponding Programming Station session.
  • Validation: This API is not on the mandatory UkeyPermissionFilter validation path, but a valid session token is still required to log out effectively.
  • Logout result: If the Programming Station context cannot be identified, do not assume that the specified station session was cleared.

5.12.6 Request Example​

curl -X POST "$BASE_URL/api/iot-factory-edge-service/logout" \
-H "x-snbps-session: $SESSION"

5.12.7 Response Parameters​

This API uses the standard JSON response format; respData is null.

5.12.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": null,
"respTime": 1792108800
}

5.13 Query Batches by Order Number​

This API queries running batches for a specified order number in the current factory.

5.13.1 Request Method​

GET

5.13.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/v1/queryBatchByOrderNumber

5.13.3 Request Body​

In addition to the common request headers, this API requires the following header:

ParameterMandatoryDescription
x-snbps-sessionYesProgramming Station session token from /login

5.13.4 Request Parameters​

This API accepts the following query parameter:

FieldTypeMandatoryDescription
orderNumberstringYesFactory order number; it cannot be empty or whitespace only

5.13.5 Notes​

  • Query scope: Only batches in RUNNING status for the specified order number in the current factory are queried.
  • Batch assignment: This API only queries batches; it does not automatically assign the returned batch to the current Programming Station.

5.13.6 Request Example​

GET {BASE_URL}/api/iot-factory-edge-service/v1/queryBatchByOrderNumber?orderNumber=ORDER-001

5.13.7 Response Parameters​

This API uses the standard JSON response format. respData is an array of batch information, or an empty array [] if no batch matches. Each object contains:

FieldTypeDescription
batchIdinteger (int64)Batch ID
batchNamestringBatch name

5.13.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": [
{
"batchId": 10,
"batchName": "BATCH-001"
}
],
"respTime": 1792108800
}

5.13.9 Main Error Codes​

Error codeDescription
8039Order number is empty
8050Authentication failed

See the appendix for other error codes.

5.14 Assign Programming Station Batch​

This API assigns a specified batch to the currently logged-in Programming Station and synchronizes the station–batch association.

5.14.1 Request Method​

POST

5.14.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/assignBatch

5.14.3 Request Headers​

In addition to the common request headers, this API requires the following header:

ParameterMandatoryDescription
x-snbps-sessionYesProgramming Station session token from /login

5.14.4 Request Body​

The request body contains:

FieldTypeMandatoryDescription
batchIdinteger (int64)YesBatch ID to assign. It must belong to the current factory, be unexpired, and be running.

5.14.5 Notes​

  • Batch requirements: Only an unexpired, running batch in the current factory can be assigned.
  • Assignment restriction: A Programming Station already assigned through Edge management cannot be reassigned through this API if overriding the association is prohibited.
  • Repeated assignment: Assigning the same batch to a station already assigned to it returns 8011.

5.14.6 Request Example​

{
"batchId": 10
}

5.14.7 Response Parameters​

This API uses the standard JSON response format. respData.batchInfo.batches is an array of batch details with the same structure as the batch details returned by /queryPPCBatchInfo.

5.14.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"batchInfo": {
"batches": [
{
"batchId": "10",
"batchName": "BATCH-001",
"programmingType": "SE",
"bindType": 2
}
]
}
},
"respTime": 1792108800
}

5.14.9 Main Error Codes​

Error codeDescription
8009Batch has expired
8010Batch is closed
8011Programming Station is already assigned to this batch
8013Data parsing failed
8016Programming Station does not exist
8032Batch does not exist
8035Conflict with an assignment made in Edge management
8050Authentication failed

See the appendix for other error codes.

5.15 Query Programming Station Batch Information​

This API queries the batches associated with a Programming Station, programming scripts, and server load information.

5.15.1 Request Method​

GET

5.15.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/queryPPCBatchInfo

5.15.3 Request Headers​

In addition to the common request headers, this API requires the following header:

ParameterMandatoryDescription
x-snbps-sessionYesProgramming Station session token from /login

5.15.4 Request Parameters​

This API accepts the following query parameters:

FieldTypeMandatoryDescription
usafeSNstringNoFor legacy U-Safe Programming Station queries
batchIdinteger (int64)NoWhen positive, queries the specified running batch. If neither parameter is provided, queries by the station in the current session.

5.15.5 Notes​

  • Query and assignment: This API only queries batch information; it does not perform /assignBatch.
  • Programming type: programmingType distinguishes programming types such as MCU, SE, and SE_MCU. Use the value in the actual batch.
  • Enum values: Follow the ProgrammingType enum and the actual API response. MATTER and SE_MATTER in older comments must not be used directly as request enum values.

5.15.6 Request Example​

GET {BASE_URL}/api/iot-factory-edge-service/queryPPCBatchInfo

5.15.7 Response Parameters​

This API uses the standard JSON response format and mainly returns the station's associated batches and server load information.

FieldTypeDescription
usafeSNstringU-Safe serial number
batchInfo.batchesarrayArray of batches associated with the Programming Station; may be empty if no batch is available
serverLoadInfo.pressureLevelintegerServer load level
serverLoadInfo.pressurePercentagenumberServer load percentage

5.15.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"batchInfo": {
"batches": [
{
"batchId": "10",
"batchName": "BATCH-001",
"total": 100,
"produced": 10,
"toBeProduced": 90,
"programmingType": "SE",
"scriptName": "burn-1.0",
"scriptMd5": "<md5>",
"scriptUrl": "<script download URL>"
}
]
},
"serverLoadInfo": {
"pressureLevel": 1,
"pressurePercentage": 10.0
}
},
"respTime": 1792108800
}

5.15.9 Batch Detail Fields​

Each object in batchInfo.batches contains batch, chip, programming script, and production progress information, including:

FieldTypeDescription
batchIdstringBatch ID
batchNamestringBatch name
chipsobject[]Chip information array; chipPart, chipVendor, and objectid are strings
envstringEnvironment information
extDatastringExtended data
markstringBatch marker
notesstringBatch notes
orderNostringOrder number
producedintegerQuantity produced
toBeProducedintegerQuantity remaining
totalintegerTotal batch quantity
productNamestringProduct name
versionstringProduct version
regionstringRegion
secureDebugReopenintegerSecure debug switch
supportProtocolsstring[]Supported protocol list
scriptNamestringProgramming script name
scriptMd5stringProgramming script MD5 digest
scriptUrlstringProgramming script download URL
vidstringMatter VID
pidstringMatter PID
bindTypeintegerAssignment method: 1, Edge management; 2, manual client assignment
programmingTypestringProgramming type, such as MCU, SE, or SE_MCU; choose the programming flow from the actual response value

5.15.10 Main Error Codes​

Error codeDescription
8013Data parsing failed
8015Programming Station has no assigned batch
8016Programming Station does not exist
8050Authentication failed

See the appendix for other error codes.

5.16 Get Dynamic Programming Data​

This API generates device programming data for the batch assigned to the current Programming Station and creates a production record for this programming operation.

5.16.1 Request Method​

GET

5.16.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/getProgrammingData

5.16.3 Request Headers​

In addition to the common request headers, this API requires the following header:

ParameterMandatoryDescription
x-snbps-sessionYesProgramming Station session token from /login

5.16.4 Request Parameters​

This API accepts the following query parameters:

FieldTypeMandatory / conditionDescription
uuidstringNoTrace ID for a single programming operation. If omitted, getProgrammingData generates one; retain and reuse it in later calls.
ppcliVersionstringNoClient script version
usafeSNstringLegacy flow compatibilitySince 3.1.1, no longer a primary parameter in the new flow. Station information takes precedence when a session station exists.
chipIndexintegerNoNo longer used since 3.1.1.

5.16.5 Notes​

  • Programming trace: Omit uuid on the initial call. After obtaining the returned uuid, retain and reuse it in subsequent /uploadRequestData, /executeApdu, or programming result requests.
  • SE programming: In an SE-only scenario, a programming record is created even if the returned bundles array is empty.
  • File download: Use the downloadUrl in the actual response for large files.
  • Sensitive material: Sensitive production material is not sent as plaintext in a bundle.

5.16.6 Request Example​

GET {BASE_URL}/api/iot-factory-edge-service/getProgrammingData?ppcliVersion=1.0.0

5.16.7 Response Parameters​

This API uses the standard JSON response format. respData is a batch Bundle object containing:

FieldTypeDescription
batchIdstringBatch ID
batchNamestringBatch name
uuidstringTrace ID for this programming operation
bundlesobject[]Data entries for this programming operation; may be an empty array in an SE-only scenario

5.16.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"batchId": "10",
"batchName": "BATCH-001",
"uuid": "example-programming-trace",
"bundles": []
},
"respTime": 1792108800
}

5.16.9 Main Error Codes​

Error codeDescription
8013Bundle data parsing failed
8030No available Programming Station batch
8050Authentication failed

See the appendix for other error codes.

5.17 Get Batch Metadata​

This API returns complete batch metadata and download URLs for firmware and other files so the client can prepare device programming.

5.17.1 Request Method​

GET

5.17.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/getMetadata

5.17.3 Request Headers​

The following header is recommended to resolve the current Programming Station and factory context:

ParameterMandatory / conditionDescription
x-snbps-sessionRecommendedProgramming Station session token from /login

This API is not on the mandatory UkeyPermissionFilter validation path.

5.17.4 Request Parameters​

This API accepts the following query parameters:

FieldTypeMandatory / conditionDescription
uuidstringNoTrace ID for a single programming operation. If omitted, a later getProgrammingData call may generate one; retain it for later calls.
ppcliVersionstringNoClient script version
usafeSNstringLegacy flow compatibilitySince 3.1.1, no longer a primary parameter in the new flow. Station information takes precedence when a session station exists.
chipIndexintegerNoNo longer used since 3.1.1.

5.17.5 Notes​

  • Metadata retrieval: Returns the complete batch Bundle, performs the necessary metadata processing, and removes specified key material.
  • Production record: This API does not replace /getProgrammingData in creating a programming record. The uuid in its response does not prove that a new production session was created.
  • Programming Station context: A valid x-snbps-session can be used to resolve the current Programming Station.

5.17.6 Request Example​

GET {BASE_URL}/api/iot-factory-edge-service/getMetadata?usafeSN=USAFE-001

5.17.7 Response Parameters​

This API uses the standard JSON response format. respData is a batch Bundle object containing:

FieldTypeDescription
batchIdstringBatch ID
batchNamestringBatch name
uuid1stringProgramming trace ID in the response; does not prove that a production record was created
bundlesobject[]Complete batch data entries

5.17.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"batchId": "10",
"batchName": "BATCH-001",
"uuid": "example-programming-trace",
"bundles": []
},
"respTime": 1792108800
}

The empty bundles array in the example illustrates the response structure only; it does not mean every batch returns an empty array.

5.17.9 Main Error Codes​

Error codeDescription
8013Data parsing failed
8030No available Programming Station batch

See the appendix for other error codes.

5.18 Get Full Programming Data (Compatibility API)​

This is the legacy API for retrieving a complete Bundle. Its service method is marked @Deprecated. New clients should use /getMetadata and /getProgrammingData.

5.18.1 Request Method​

GET

5.18.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/getPPData

5.18.3 Request Headers​

In addition to the common request headers, this API requires the following header:

ParameterMandatoryDescription
x-snbps-sessionYesProgramming Station session token from /login

5.18.4 Request Parameters​

This API accepts the following query parameters:

FieldTypeMandatory / conditionDescription
uuidstringNoTrace ID for a single programming operation. In the new flow, getProgrammingData generates one if omitted; retain it for later calls.
ppcliVersionstringNoClient script version
usafeSNstringLegacy flow compatibilitySince 3.1.1, no longer a primary parameter in the new flow. Station information takes precedence when a session station exists.
chipIndexintegerNoNo longer used since 3.1.1.

5.18.5 Notes​

  • Batch query: This API identifies the batch by usafeSN, generates a new uuid, and returns the processed complete programming data.
  • No available batch: The response may be null if no usable batch is found.
  • Compatibility: This API supports legacy clients. New clients should use /getMetadata and /getProgrammingData.

5.18.6 Request Example​

GET {BASE_URL}/api/iot-factory-edge-service/getPPData?usafeSN=USAFE-001

5.18.7 Response Parameters​

This API uses the standard JSON response format. respData is a batch Bundle object containing:

FieldTypeDescription
batchIdstringBatch ID
batchNamestringBatch name
uuidstringProgramming trace ID returned in this response
bundlesobject[]Processed complete programming data entries

5.18.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"batchId": "10",
"batchName": "BATCH-001",
"uuid": "example-programming-trace",
"bundles": []
},
"respTime": 1792108800
}

The empty bundles array in the example illustrates the response structure and is not the actual content for every batch. In an SE-only scenario, /getProgrammingData may return an empty bundles array.

5.18.9 Common Bundle Structure​

Each Bundle object in the bundles array contains:

FieldTypeDescription
typestringBundle type
sectionstringSection to which the Bundle belongs
ownerIdstringAssociated object ID
authTokenstringAuthentication token
authCertstringAuthentication certificate
authSignstringAuthentication signature
itemsobject[]List of Bundle data entries

Each entry in the items array contains:

FieldTypeDescription
itemIdstringEntry ID
keystringEntry key
objectIdstringObject ID
parentIdstringParent object ID
fieldTypestringField type
attributeJSON objectEntry attributes; structure depends on field type

Bundle fields and content may differ by batch. Clients should follow the actual server response and download URLs; do not treat the empty bundles example as actual data for every batch.

5.18.10 Main Error Codes​

Error codeDescription
8050Authentication failed

Other exceptional behavior of this legacy API depends on the old flow. See the appendix for specific error codes.

5.19 Submit Intermediate Programming Request Data​

This API reports chip execution results for batch Bundle entries and lets the corresponding processor generate the next stage of programming data.

5.19.1 Request Method​

POST

5.19.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/uploadRequestData

5.19.3 Request Headers​

In addition to the common request headers, this API requires the following header:

ParameterMandatoryDescription
x-snbps-sessionYesProgramming Station session token from /login

5.19.4 Request Body​

The request body contains:

FieldTypeMandatory / conditionDescription
batchIdstringYesBatch ID in the current factory
uuidstringRequired by business rulesProgramming trace ID returned by /getProgrammingData; IDRule number allocation requires a valid, stable traceId
bundlesobject[]As neededReported Bundle data; if empty, the current implementation returns respData=null
bundles[].typestringPer templateBundle type
bundles[].sectionstringPer templateSection to which the Bundle belongs
bundles[].deviceIdstringRecommended for IDRuleStable device identifier. If omitted, the service attempts to resolve it from the record for uuid. Do not change it after initial number allocation.
bundles[].itemsobject[]Required for a nonempty BundleList of Bundle entries; empty items or null entries are not allowed
bundles[].items[].keystringYesNonempty entry key
bundles[].items[].responseobject[]Per item protocolList of results from the previous step; fields are defined by fieldType and the corresponding processor protocol

5.19.5 Notes​

  • Purpose: This API submits intermediate programming data; it does not report the final programming result.
  • Data structure: Populate items[].key and response according to the actual batch template and processor protocol. Do not use the placeholders in the example directly.
  • Device identifier: In an IDRule scenario, reuse a stable device identifier for the same device. Do not change deviceId in later programming steps after the first number allocation.
  • Empty data: If bundles is empty, the current implementation returns respData=null.

5.19.6 Request Example​

{
"batchId": "10",
"uuid": "<uuid returned by getProgrammingData>",
"bundles": [
{
"section": "<template section>",
"deviceId": "DEVICE-001",
"items": [
{
"key": "<template item key>",
"response": [
{
"<protocol field>": "<actual execution result>"
}
]
}
]
}
]
}

5.19.7 Response Parameters​

This API uses the standard JSON response format. respData contains:

FieldTypeDescription
batchIdstringBatch ID
batchNamestringBatch name
uuidstringProgramming trace ID for this operation
bundlesobject[]Next-stage programming data entries generated by the corresponding processor

5.19.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"batchId": "10",
"batchName": "BATCH-001",
"uuid": "example-programming-trace",
"bundles": []
},
"respTime": 1792108800
}

5.19.9 Main Error Codes​

Error codeDescription
8002Invalid request parameters
8003Data processing failed
8032Batch does not exist
8040–8046Certificate or key agreement error
8065Invalid IDRule rule
8066Number range exhausted
8067State conflict
8068Stable device identifier is missing
8050Authentication failed

See the appendix for other error codes.

5.20 Report Programming Result​

This API closes an existing device programming record and creates or updates the device profile, while remaining compatible with legacy clients.

5.20.1 Request Method​

POST

5.20.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/programmingResult

5.20.3 Request Headers​

In addition to the common request headers, this API requires the following header:

ParameterMandatoryDescription
x-snbps-sessionYesProgramming Station session token from /login

5.20.4 Request Body​

The request body contains:

FieldTypeMandatory / conditionDescription
uuidstringYes (integration contract)traceId of an existing programming record
batchIdinteger (int64)RecommendedUsed as additional context when the programming record lacks batch information
resultbooleanExplicitly recommendedtrue means success; false or null is treated as failure
failureReasonstringNoReason for programming failure
deviceProfileobjectNoActual CPS programming data. Fields are described under deviceRecord in the Production Data Upload API, including deviceId, firmwareVersion, seid, cplc, matterData, factoryData, and customData.
changeKeysobjectNoCompatibility field. Accepts null, an empty string, or a JSON object; other types return 8002. The current programming result flow does not use this field further.

5.20.5 Notes​

  • Record handling: If the programming record does not exist or the current factory batch cannot be identified, the current method skips device profile creation and returns normally.
  • Duplicate report: A repeated report with the same status, or a report for a record already in success status, is not processed again.
  • Result confirmation: respCode="8000" does not necessarily mean a new device profile was created. Confirm through a device query API.
  • Custom data: customData values must be strings and may contain at most 50 entries.
  • Compatibility: The newer unified production data upload flow can report programming results through /v1/deviceData/upload.

5.20.6 Request Example​

{
"uuid": "<current programming uuid>",
"batchId": 10,
"result": true,
"deviceProfile": {
"deviceId": "DEVICE-001",
"firmwareVersion": "1.2.3",
"customData": {
"fixture": "A01"
}
}
}

5.20.7 Response Parameters​

This API uses the standard JSON response format. On success, respData is null.

5.20.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": null,
"respTime": 1792108800
}

5.20.9 Main Error Codes​

Error codeDescription
8002Invalid request parameters
8007Data processing or storage error
8037Device profile creation failed
8050Authentication failed

See the appendix for other error codes.

5.21 SE APDU Stepwise Programming​

This API performs stepwise APDU programming of an SE device. The client executes the APDU commands returned by the server in order and submits their results to obtain the next commands. A nextStep value of EOF means the programming flow is complete.

5.21.1 Request Method​

POST

5.21.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/executeApdu

5.21.3 Request Headers​

In addition to the common request headers, this API requires the following header:

ParameterMandatoryDescription
x-snbps-sessionYesProgramming Station session token from /login

5.21.4 Request Body​

The request body contains:

FieldTypeMandatory / conditionDescription
batchIdstringYesSE configuration batch ID in the current factory. It cannot be omitted in reliance on the station assignment alone.
cplcstringProvide for SE integrationCPLC protocol value of the SE device, usually 84 characters, used for the SE device record
seIdstringProvide for SE integrationSE identifier. The field name is case-sensitive: use seId.
nfcUidstringFor power keysProtocol hex value of the device physical identifier; nfcId is accepted as an input alias. It must remain identical on initial and subsequent steps.
programmingTraceIdstringOptional for BOF; required for other stepsProgramming trace ID; uuid is accepted as an input alias. In an SE_MCU flow, reuse the Matter session traceId. The response returns only programmingTraceId.
currentStepstringYesUse BOF on the initial call. On subsequent calls, use nextStep from the previous response unchanged; do not construct a step cursor.
commandResultsobjectRequired for subsequent stepsPrevious APDU execution result. Omit for BOF. For subsequent steps, succeed must be true and results must correspond to the previous commands.
commandResults.succeedbooleanRequired for subsequent stepsWhether the previous step succeeded. false stops the flow and returns 8053.
commandResults.resultsobject[]For subsequent steps, follow the previous responseList of APDU execution results. Each entry contains index (integer) and command, checker, and result (strings). index must numerically match the string sequence number of the previous command.

5.21.5 Notes​

  • Initial call: Start programming with currentStep="BOF" and save programmingTraceId from the response for later steps.
  • Command execution: The client must execute APDU commands in the order of commands and submit the actual results of the previous batch in the next request.
  • Step control: Use the previous response's nextStep unchanged in the next request. Do not parse or modify the server step cursor. Stop at EOF; do not submit EOF again.
  • Session recovery: 8054 means the current session cannot continue. Restart from BOF; do not automatically replay earlier APDU commands.
  • Session lifetime: The current SE session lifetime is defined by a server configuration constant.
  • Power key: nfcUid (or its input alias nfcId) must stay the same on the initial and subsequent steps. Do not use seId as the NFC UID.

5.21.6 Request Example​

Use BOF on the initial call:

{
"batchId": "10",
"cplc": "<device CPLC>",
"seId": "<device SEID>",
"currentStep": "BOF"
}

5.21.7 Response Parameters​

This API uses the standard JSON response format. respData contains:

FieldTypeDescription
nextStepstringNext server step cursor; EOF means the flow is complete
programmingTraceIdstringTrace ID of this SE programming operation
commandsobject[]List of APDU commands to execute in this step
commands[].indexstringAPDU command sequence number
commands[].checkerstringAPDU response checker
commands[].commandstringAPDU hex command to execute

5.21.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"nextStep": "<server step cursor>",
"programmingTraceId": "example-programming-trace",
"commands": [
{
"index": "1",
"checker": "<server-provided checker>",
"command": "<server-provided APDU hex>"
}
]
},
"respTime": 1792108800
}

5.21.9 APDU Subsequent-Step Request Example​

After executing the previous batch of APDU commands, the client submits the results using programmingTraceId and nextStep returned by the server.

{
"batchId": "10",
"programmingTraceId": "<programmingTraceId from previous response>",
"currentStep": "<nextStep from previous response>",
"cplc": "<same device CPLC>",
"seId": "<same device SEID>",
"commandResults": {
"succeed": true,
"results": [
{
"index": 1,
"command": "<original command>",
"checker": "<original checker>",
"result": "<actual card response hex>"
}
]
}
}

For a power key, include the same nfcUid (or input alias nfcId) in the initial request and every subsequent request. Do not download the raw production key file separately to the client. Edge prepares the relevant production material and returns it through the APDU commands for the current step. After successful programming reaches EOF, use the existing production count and device profile handling flow. If command execution on the card clearly failed, do not report commandResults.succeed as true.

5.21.10 Power Key Device Binding Rules​

  • Device identifiers: The current power key flow requires both nfcUid (input alias nfcId is supported) and seId.
  • Data format: Pass both identifiers as even-length hexadecimal strings as required by the device protocol. The current allocation endpoint requires non-empty values of at most 64 characters and converts them to uppercase.
  • Alias usage: Do not submit nfcUid and nfcId with different values. Keep the same nfcUid and device identity in the initial call and every continuation request.
  • Material binding: Production materials are stored against the device binding of factory, batch, NFC UID, and SEID. Even if a device changes traceId or resends BOF, previously bound materials are reused first.
  • Binding conflict: If an NFC UID or SEID is already bound but the other device identifier differs, the API returns 8073.
  • Material exhaustion: If no production materials are available, the API returns 8072.
  • Historical data: If a batch still has an allocation state from legacy Redis or production records that has not been migrated, the API may also return 8073. Resending BOF does not allocate new materials.

5.21.11 Main Error Codes​

Error codeDescription
8006Batch or programming record is missing
8047SE configuration is missing
8048Data parsing failed
8049CPLC-related error
8052Step execution result does not match
8053Previous step failed
8054Session cannot continue; restart required
8055APDU processing failed
8056Configuration decryption failed
8070–8074Production data, material allocation, or configuration error
8050Authentication failed

See the appendix for other error codes.

5.22 Get Programming Script URL​

This API obtains the programming script download URL for a specified batch.

5.22.1 Request Method​

POST

5.22.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/getScriptFile

5.22.3 Request Headers​

Provide the following request header to resolve the current station and factory context:

ParameterMandatoryDescription
x-snbps-sessionRecommendedStation session token returned by /login

This API is not on the mandatory validation path list of UkeyPermissionFilter.

5.22.4 Request Body​

The request body contains the following parameters:

FieldTypeMandatory / conditionDescription
batchIdinteger (int64)Required when querying by batchBatch ID
productIdinteger (int64)NoCompatibility parameter for product-based queries
chipPartstringAs neededChip model
chipVendorstringAs neededChip vendor

5.22.5 Notes​

  • Download URL: The client should download the programming script from the fileUrl returned by the API.
  • Script verification: An HTTP success response does not mean the client has completed local script download and verification.

5.22.6 Request Example​

{
"batchId": 10
}

5.22.7 Response Parameters​

This API uses the standard JSON response format. respData contains the following field:

FieldTypeDescription
fileUrlstringProgramming script download URL returned by the server

5.22.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"fileUrl": "<server-generated script download URL>"
},
"respTime": 1792108800
}

5.22.9 Main Error Codes​

Error codeDescription
8022Failed to get the programming script

See the appendix for other error codes.

5.23 Download File​

This API downloads a file by its local file record ID.

5.23.1 Request Method​

GET

5.23.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/download

5.23.3 Request Headers​

Calls requiring factory context should provide the following request header:

ParameterMandatory / conditionDescription
x-snbps-sessionWhen factory context is requiredValid station session token returned by /login

5.23.4 Request Parameters​

Pass the following fields as query parameters:

FieldTypeMandatoryDescription
fileIdinteger (int64)YesLocal file record ID
fileNamestringNoDownload filename requested by the client

5.23.5 Notes​

  • Response format: On success, the API returns a binary file stream with download headers such as Content-Disposition. It does not use the standard ClientR JSON response structure.
  • Download URL: The client can use the full download URL returned by /getScriptFile or /getMetadata rather than building it manually.
  • Session requirement: Provide a valid x-snbps-session when factory context is required.

5.23.6 Request Example​

curl -L "$BASE_URL/api/iot-factory-edge-service/download?fileId=100&fileName=burn.zip" \
-H "x-snbps-session: $SESSION" \
-o burn.zip

5.23.7 Response Parameters​

On success, the API returns a binary file stream, not JSON respData.

5.23.8 Main Error Codes​

Error codeDescription
8022File record does not exist
8023File download failed

See the appendix for other error codes.

5.24 Upload Device Event Logs​

This API receives event logs produced during device programming, filters them by configured priority, and reports them through MQTT. If sending fails, it saves a compensation record.

5.24.1 Request Method​

POST

5.24.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/v1/eventLog/upload

5.24.3 Request Headers​

In addition to the common request headers, provide the following header:

ParameterMandatoryDescription
x-snbps-sessionYesStation session token returned by /login

5.24.4 Request Body​

The request body contains the following parameters:

FieldTypeMandatory / conditionDescription
programmingTraceIdstringYes (non-null)Programming trace ID; uuid is also accepted as an input alias
eventsobject[]Yes (non-null)Event log list; an empty array may be ignored
events[].eventNamestringRecommendedEvent name
events[].timestampstringRecommendedClient event time in the format defined by the event protocol
events[].sourcestringRecommendedEvent source
events[].prioritystringRecommendedEvent priority as a numeric string from 1 to 5; larger values mean higher priority. Empty or invalid values are filtered out.
events[].statusstringRecommendedEvent status: success or failure
events[].contentstringNoLog content; the current implementation truncates it after 256 characters.

5.24.5 Notes​

  • Event filtering: The server filters events by the configured priority threshold. Events below the threshold or with invalid priority are not reported further.
  • Log synchronization: A successful HTTP request means only that the API received and processed the request; it does not mean every event has been synchronized to the cloud.
  • Failure compensation: If MQTT sending fails, the server saves a compensation record.

5.24.6 Request Example​

{
"programmingTraceId": "<current programming traceId>",
"events": [
{
"eventName": "ProgrammingFinished",
"timestamp": "2026-10-16T10:00:00+08:00",
"source": "PS",
"priority": "5",
"status": "success",
"content": "Burn completed"
}
]
}

5.24.7 Response Parameters​

This API uses the standard JSON response format. On success, respData is null.

5.24.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": null,
"respTime": 1792108800
}

5.24.9 Main Error Codes​

Error codeDescription
8050Authentication failed

Request parameter binding or validation may also produce errors. See the appendix for other error codes.

5.25 Generate Matter Verifier​

This API calls the Matter SDK to generate a Matter passcode, Salt, and Verifier.

5.25.1 Request Method​

POST

5.25.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/generateVerifier

5.25.3 Request Headers​

The current application.yml does not exclude this API from platform authentication. If platform authentication is enabled in the deployment, provide the following header:

ParameterMandatory / conditionDescription
x-snbps-auth-tokenWhen platform authentication is enabledPlatform authentication token, distinct from the station session token x-snbps-session

5.25.4 Request Parameters​

This API requires no request parameters.

5.25.5 Notes​

  • Generation parameters: The current implementation fixes saltLen at 32 bytes and iterations at 1000. They cannot be overridden in the request body.
  • Runtime dependency: The corresponding native Matter SDK must be deployed on the server.
  • Status interpretation: The outer respCode and respData.status have different meanings. The former indicates the API business response status; the latter is the status returned by the Matter SDK.
  • Example data: Numeric values in the response example illustrate field types only.

5.25.6 Request Example​

POST {BASE_URL}/api/iot-factory-edge-service/generateVerifier

5.25.7 Response Parameters​

This API uses the standard JSON response format. respData contains the following fields:

FieldTypeDescription
statusintegerStatus code returned by the Matter SDK
passcodeintegerMatter passcode
saltstringBase64-encoded Salt
verifierstringBase64-encoded Verifier

5.25.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"status": 0,
"passcode": 20202021,
"salt": "<Base64 salt>",
"verifier": "<Base64 verifier>"
},
"respTime": 1792108800
}

5.26 Generate Matter Onboarding Payload​

This API calls the Matter SDK with specified Matter parameters to generate a QR code onboarding payload and manual pairing code.

5.26.1 Request Method​

POST

5.26.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/generateOnboardingData

5.26.3 Request Headers​

The current application.yml does not exclude this API from platform authentication. If platform authentication is enabled in the deployment, provide the following header:

ParameterMandatory / conditionDescription
x-snbps-auth-tokenWhen platform authentication is enabledPlatform authentication token, distinct from the station session token x-snbps-session

5.26.4 Request Parameters​

The API accepts the following query or form parameters, not a JSON request body.

FieldTypeMandatoryDescription
vidintegerYesMatter Vendor ID (VID) as a decimal integer, unlike the hexadecimal text used by the Matter payload recovery API
pidintegerYesMatter Product ID (PID) as a decimal integer
passcodeintegerYesMatter passcode
commissioningFlowintegerYesMatter SDK commissioning flow parameter
discoveryModeintegerYesMatter SDK device discovery mode parameter

5.26.5 Notes​

  • Parameter transport: Although this API uses POST, all five parameters are bound with @RequestParam. Pass them through URL query or form parameters, not a JSON request body.
  • Parameter validation: The underlying Matter SDK determines the valid range for each parameter.
  • VID/PID format: This API uses decimal integers, unlike the hexadecimal strings used by /v1/matter/onboarding-payloads/recover.

5.26.6 Request Example​

POST {BASE_URL}/api/iot-factory-edge-service/generateOnboardingData?vid=65522&pid=32769&passcode=20202021&commissioningFlow=0&discoveryMode=2

5.26.7 Response Parameters​

This API uses the standard JSON response format. respData contains the following fields:

FieldTypeDescription
statusintegerStatus code returned by the Matter SDK
discriminatorintegerMatter onboarding Discriminator
qrcodestringMatter QR code onboarding payload
manualcodestringMatter manual pairing code; note that the field name manualcode is all lowercase

5.26.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"status": 0,
"discriminator": 3840,
"qrcode": "<SDK-generated QR code payload>",
"manualcode": "<SDK-generated manual pairing code>"
},
"respTime": 1792108800
}

5.27 Generate Matter Unique ID​

This API calls the Matter SDK to generate a Matter Unique ID.

5.27.1 Request Method​

POST

5.27.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/generateUniqueId

5.27.3 Request Headers​

The current application.yml does not exclude this API from platform authentication. If platform authentication is enabled in the deployment, provide the following header:

ParameterMandatory / conditionDescription
x-snbps-auth-tokenWhen platform authentication is enabledPlatform authentication token, distinct from the station session token x-snbps-session

5.27.4 Request Parameters​

This API requires no request parameters or request body.

5.27.5 Notes​

  • Generation: The Matter SDK generates the Unique ID; the client supplies no generation parameters.
  • Status interpretation: A successful Matter SDK status is usually 0, while the outer API business success code is 8000. They have different meanings.

5.27.6 Request Example​

POST {BASE_URL}/api/iot-factory-edge-service/generateUniqueId

5.27.7 Response Parameters​

This API uses the standard JSON response format. respData contains the following fields:

FieldTypeDescription
statusintegerStatus code returned by the Matter SDK
resultstringBase64-encoded Unique ID

5.27.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"status": 0,
"result": "<Base64 uniqueId>"
},
"respTime": 1792108800
}

5.28 Query Device Data (Legacy API, Deprecated)​

This API supports device data queries by legacy clients. New clients should use /v1/device/detail, or /v1/device/information/query for station query scenarios.

5.28.1 Request Method​

POST

5.28.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/queryDeviceData

5.28.3 Request Body​

Provide the following request header to resolve the current station and factory context:

ParameterMandatory / conditionDescription
x-snbps-sessionRecommendedStation session token returned by /login

This API is not on the mandatory validation path list of UkeyPermissionFilter.

5.28.4 Request Body​

The request body contains the following parameters:

FieldTypeMandatory / conditionDescription
batchIdstringYesBatch ID
paramKeystringYesKey identifying the parameter group
paramFieldstringYesField to locate
paramValuestringYesField value identifying the device
queryKeysstring[]YesSee the queryable keys list (queryKeys V1) for supported keys.

5.28.5 Notes​

  • Compatibility: This API was declared deprecated in the v1.3 document and remains only for legacy clients.
  • Query source: If the batch was deleted, a file cannot be read, or no local device profile matches, the API may query historical records or cloud data.
  • Query parameters: queryKeys must follow the legacy Bundle query protocol. Do not use field definitions from the newer QueryKeys V2 directly.

5.28.6 Request Example​

{
"batchId": "10",
"paramKey": "<legacy protocol key>",
"paramField": "<legacy protocol field>",
"paramValue": "<actual value>",
"queryKeys": [
"<legacy query key>"
]
}

5.28.7 Response Parameters​

This API uses the standard JSON response format. respData contains the following fields:

FieldTypeDescription
batchIdstringBatch ID
paramKeystringParameter Key used by the query
paramFieldstringField used by the query
paramValuestringField value used by the query
datamap<string,map<string,object>>Device information in the legacy data structure

5.28.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {
"batchId": "10",
"paramKey": "<legacy protocol key>",
"paramField": "<legacy protocol field>",
"paramValue": "<actual value>",
"data": {}
},
"respTime": 1792108800
}

5.28.9 Main Error Codes​

Error codeDescription
8006Batch does not exist
8003Legacy device information query failed

See the appendix for other error codes.

5.29 Update Device Information (Legacy API, Deprecated)​

This API supports updates using the legacy device data model. New clients should use /v1/updateDevicesProfile.

5.29.1 Request Method​

POST

5.29.2 Request URL​

{BASE_URL}/api/iot-factory-edge-service/updateDeviceInfo

5.29.3 Request Headers​

Provide the following request header to resolve the current station and factory context:

ParameterMandatory / conditionDescription
x-snbps-sessionRecommendedStation session token returned by /login

This API is not on the mandatory validation path list of UkeyPermissionFilter.

5.29.4 Request Body​

The request body contains the following parameters:

FieldTypeMandatory / conditionDescription
batchIdinteger (int64)YesBatch ID; note that this differs from the string type used by the legacy query API
paramKeystringYesKey identifying the parameter group
paramFieldstringYesField to locate
paramValuestringYesField value identifying the device
datamap<string,map<string,string>>YesDevice data to update

5.29.5 Notes​

  • Compatibility: This API uses the legacy device data model. New clients should use /v1/updateDevicesProfile.
  • Batch handling: If the specified batch does not exist, the current service returns directly, while the controller may still return the data from the request.
  • Update confirmation: respCode="8000" and an echoed data value do not prove that data was persisted. Do not infer a successful device information update solely from the API response.

5.29.6 Request Example​

{
"batchId": 10,
"paramKey": "<legacy protocol key>",
"paramField": "<legacy protocol field>",
"paramValue": "<actual value>",
"data": {}
}

5.29.7 Response Parameters​

This API uses the standard JSON response format. respData is the data object from the request, of type map<string, map<string, string>>. It only echoes request data; it does not represent a fresh read of persisted state.

5.29.8 Response Example​

{
"success": true,
"respCode": "8000",
"respMsg": "NoError",
"respData": {},
"respTime": 1792108800
}

6. Appendix​

6.1 Appendix One: Queryable Keys (queryKeys V2)​

Data itemKey
Matter commissioning: PBKDF iterations (1000)matterData.iterations
Matter commissioning: salt length (32 bytes)matterData.saltLength
Matter commissioning flow type (0 = standard flow)matterData.commissioningFlows
Device discovery modematterData.discoverableMode
Matter Vendor IDmatterData.vid
Matter Product IDmatterData.pid
DiscriminatormatterData.discriminator
Matter commissioning: rotating device ID enabled (true = enabled)matterData.enableRotatingDeviceId
Matter manual pairing codematterData.manualCode
Matter passcodematterData.passcode
Matter onboarding QR codematterData.qrcode
Matter salt used by the password derivation algorithmmatterData.salt
Matter device Unique ID (Base64 encoded)matterData.uniqueid
Matter VerifiermatterData.verifier
Matter programming device serial numbermatterData.serialNumber
Matter DAC certificate MD5matterData.dacCertMd5
Matter PAI certificate MD5matterData.paiCertMd5
Matter CD filenamematterData.cdFileName
Matter CD file MD5matterData.cdFileMd5
Factory data; see the OBIS product configuration UIfactoryData.vendorName
Factory data; see the OBIS product configuration UIfactoryData.hardwareVersion
Factory data; see the OBIS product configuration UIfactoryData.hardwareVersionString
Factory data; see the OBIS product configuration UIfactoryData.partNumber
Factory data; see the OBIS product configuration UIfactoryData.productUrl
Factory data; see the OBIS product configuration UIfactoryData.productLabel
Factory data; see the OBIS product configuration UIfactoryData.productName
Factory data; see the OBIS product configuration UIfactoryData.startAddress
Programming statusprogrammingData.programmingStatus
Programming logprogrammingData.programmingLog
Programming timeprogrammingData.programmingTime
MCU ID in the programmed chipchipData.chipUid
Chip Bluetooth MAC addresschipData.bleMac
Firmware name (returns firmware list)firmwareData.fwName
Firmware MD5 (returns firmware list)firmwareData.fwMd5
Custom fieldcustomData.<custom field>

6.1.1 Additional Query Keys​

tip

This API follows queryKeys V2 naming. Matter data uses matterData.manualCode, matterData.qrcode, and matterData.uniqueid, which differ from manualPairingCode and setupPayload in the "Query Device Information" API; do not mix them.

Data itemKeyDescription
SE dataseDataReturns the complete SE data object in the device profile
Query entire groupmatterData / factoryData / programmingData / chipData / firmwareData / customDataA group name without a dot queries its supported fields; the exact response depends on the current implementation.

6.2 Appendix Two: Error Code List​

The following table lists client business error codes used by the APIs and their descriptions.

  • Each API uses only a subset of these codes. See the corresponding API description for causes and handling.
  • Parameter validation, platform authentication, and framework processing may produce other error codes not listed here.
  • An SDK status of 0 has a different meaning from respCode="8000" in the standard API response; do not confuse them.
respCodeEnum nameDescription
8000NO_ERROROperation succeeded (NoError)
8001REQUEST_FAILEDRequest failed (RequestFailed)
8002PARAM_ERRORInvalid parameter (ParamError)
8003METHOD_ERRORInvalid method (MethodError)
8004AUTH_ERRORAuthentication failed (AuthError)
8005USAFE_TYPE_ERRORInvalid U-Safe type (USafeTypeError)
8006DATA_NOT_FOUNDData not found (DataNotFound)
8007DATA_ERRORInvalid data (DataError)
8008NOT_ALLOWEDOperation not allowed (NotAllowed)
8009BATCH_EXPIRED_ERRORBatch expired
8010BATCH_STATUS_CLOSEDBatch closed
8011STATION_BATCH_HAS_BINDBatch already assigned to this station
8012STATION_HAS_LOGINStation already logged in (StationHasLogin)
8013BATCH_BUNDLE_PARSE_ERRORFailed to parse the Bundle file generated for the batch
8014STATION_PASSWORD_ERRORIncorrect station password (StationPasswordError)
8015STATION_NOT_BIND_BATCHStation has no assigned batch
8016STATION_NOT_EXISTStation does not exist
8017UNKNOWN_LOGIN_TYPEUnknown login type
8018FACTORY_NOT_EXISTFactory does not exist
8019FACTORY_STATUS_LOCKEDFactory is locked
8020USAFE_NOT_FOUNTU-Safe not found
8021STATION_USAFE_NOT_MATCHU-Safe does not match station ID
8022FETCH_BURN_SCRIPT_ERRORFailed to get programming script
8023DOWNLOAD_BURN_SCRIPT_ERRORFailed to download programming script
8024PRELOGIN_AUTH_ERRORPre-login authentication failed
8025HSM_CERT_SYNC_REQUIREDHSM authentication certificate not found. Edit factory HSM information in the cloud to trigger certificate synchronization.
8026SIGN_VERIFY_ERRORSignature verification failed
8027BATCH_HAS_DONEBatch completed
8028BATCH_FILE_NOT_EXISTOperation failed: product batch file does not exist
8029BATCH_IMPORT_FAILEDFailed to import batch
8030PS_BURN_STATION_RECORDING_FINISHEDU-Safe SN has completed programming or is not assigned to a batch
8031USAFE_UNAVAILABLEU-Safe unavailable
8032BATCH_NOT_FOUNDBatch not found
8033BATCH_DOWNLOAD_STATUS_NOT_WAITBatch download status is not pending
8034DEVICES_PROGRAMMER_DATA_UPLOAD_ERRORFailed to upload device adapter data
8035STATION_HAS_EDGE_BINDStation already assigned a batch from the Edge Service
8036CLOUD_FACTORY_ID_ERRORInvalid cloud factory ID
8037DEVICE_PROFILE_GENERATE_ERRORFailed to generate device profile
8038UNSUPPORTED_CERTIFICATE_FORMATUnsupported certificate format
8039ORDER_NUMBER_CANNOT_BE_EMPTYOrder number must not be empty
8040CERT_CHAIN_VERIFY_FAILEDSilicon Labs certificate chain verification failed
8041PUBKEY_SIGNATURE_VERIFY_FAILEDChip temporary public key signature verification failed
8042ECDH_KEY_AGREEMENT_FAILEDECDH key agreement failed
8043SESSION_KEY_NOT_FOUNDSession key does not exist or has expired
8044KEY_WRAP_FAILEDKey encapsulation failed
8045DAC_PUBKEY_SIGNATURE_VERIFY_FAILEDDAC public key signature verification failed
8046BUNDLE_PUBLIC_KEY_NOT_FOUNDBundle public key material for the specified keyCode not found
8047SE_PROFILE_NOT_FOUNDSE Profile for the batch not found
8048SE_PROFILE_PARSE_ERRORFailed to parse SE Profile
8049CPLC_INVALIDInvalid CPLC; length must be 84
8050PERMISSION_CHECK_DENYAuthorization verification failed; obtain verification permission again
8051SERVER_PERFORMANCE_LIMITConcurrency limit reached; ask the factory administrator to check the server
8052APDU_SESSION_INVALIDInvalid executeApdu session: command result for the current step does not match the expected result
8053APDU_STEP_FAILEDPrevious APDU execution failed
8054APDU_RESTART_REQUIREDAPDU session invalid or expired; restart programming for this device
8055APDU_PROCESS_FAILEDFailed to process APDU Profile step
8056SE_PROFILE_DECRYPT_ERRORFailed to decrypt SE Profile
8057TEST_FILE_PARAM_ERRORInvalid test file upload parameters
8058TEST_FILE_MANIFEST_ERRORInvalid test file manifest
8059TEST_FILE_STORAGE_ERRORFailed to save test file locally
8060TEST_FILE_TASK_ERRORFailed to save test file upload task
8061TEST_FILE_UPLOAD_ERRORFailed to upload test file to cloud storage
8064TEST_DATA_TASK_ERRORFailed to save test data report task
8065ID_RULE_INVALIDInvalid ID Rule description
8066ID_RULE_RANGE_EXHAUSTEDID Rule allocation range exhausted
8067ID_RULE_CONFLICTID Rule status conflicts with batch description
8068ID_RULE_DEVICE_KEY_REQUIREDA stable device identifier is required to parse the ID Rule
8069SCENARIO_TYPE_NOT_BE_NULLscenarioType must not be empty
8070DATA_INVALIDInvalid production data
8071KEY_DECRYPT_FAILEDFailed to decrypt batch protection key
8072DATA_EXHAUSTEDProduction data exhausted
8073ASSIGNMENT_CONFLICTProduction data allocation conflicts with batch or device
8074PROFILE_INVALIDProgramming requires a PERSONALIZE operation and corresponding Applet selection information
8101DEVICE_NOT_FOUNDDevice not found; check query parameters
8102MULTI_DEVICES_FOUNDMultiple devices matched; add filters
8103QUERY_CONDITION_REQUIREDSpecify at least one valid query condition in deviceLocator

6.3 Appendix Three: Updatable Keys (updateDevicesProfile)​

Keys supported by the Update Devices Profile API:

Data itemKeyValue description
Device extension fieldextend.<extension field key>Supported extension fields: vid, pid, chipId, qrcode, pairingCode
envenvironmenttest / prod
Production timemanufactureTime
  • string
  • Time format: 2020-11-11T01:11:11+08:00
Version nameproductVersionstring
Batch nameproductBatchstring
Factory namefactorystring
Programming station nameprogrammingStationstring
Programming statusprogrammingStatusComplete / Failed / Unreported
DAC certificate serial numberdacSerialNostring
DAC certificate commonNamedacCommonNamestring
DAC certificate VIDdacVidstring
DAC certificate PIDdacPidstring
Subject key identifiersubjectKeyIdentifierstring
Authority key identifierauthorityKeyIdentifierstring
DAC effective datenotBefore
  • string
  • Time format: 2020-11-11T01:11:11+08:00
DAC expiration datenotAfter
  • string
  • Time format: 2020-11-11T01:11:11+08:00
Pairing codepairingCodestring
QR codeqrcodestring
DAC expiration time (date, time, and time zone)expiryDate
  • string
  • Time format: 2020-11-11T01:11:11+08:00
Remaining days of DAC validityleftDaysstring
Issued DAC certificatecertificatestring
Field in factoryDatafactoryData.<key name>
  • string
  • Supports deletion of the corresponding key in factory data.
Script filenameprogrammingScript
  • string
  • Supports deletion of the script file with this name. Only one script file may exist; uploading a new script filename overwrites the prior file record.
FirmwarefirmwareData.<firmware name>
  • The startAddress of the named firmware may be updated.
  • Deletion of the named firmware is supported.
otherFilesotherFile.<filename>
  • The key of the named file in otherFile may be updated.
  • Deletion of the named file is supported.
attachmentFilesattachment.<filename>
  • The key of the named attachment may be updated.
  • Deletion of the named file is supported.

6.4 Appendix Four: Queryable Keys (queryKeys V1)​

tip
  • If a data item is not configured for the product, the API returns an empty value for it.
  • The digit 1 in the key fw1.fileName denotes the first firmware file.
Data itemKey
CD file MD5cdFile.md5
CD filenamecdFile.fileName
Commissioning flowmatterCommissioningParameter.commissioningFlows
DAC MD5dacTemplate.md5
Discovery modematterCommissioningParameter.discoverableMode
DiscriminatormatterCommissioningParameter.discriminator
EnableRotatingDeviceIdmatterCommissioningParameter.enableRotatingDeviceId
hardwareVersionhardwareVersion
hardwareVersionStringhardwareVersionString
mcuIdmcuId
PAI MD5paiCert.md5
partNumberpartNumber
PIDpid
productLabelproductLabel
productUrlproductUrl
saltmatterCommissioningParameter.salt
softwareVersionsoftwareVersion
softwareVersionStringsoftwareVersionString
SPAKE2+IterationsmatterCommissioningParameter.iterations
UniqueIDmatterCommissioningParameter.uniqueId
vendorNamevendorName
verifiermatterCommissioningParameter.verifier
VIDvid
QR codematterCommissioningParameter.qrcode
Firmware filenamefw1.fileName
Device programming resultprogrammingStatus
Manual pairing codematterCommissioningParameter.manualCode
Original passcodematterCommissioningParameter.passcode

6.5 Typical Business Call Flows​

This section gives typical API call sequences for station programming, testing, and assembly. See each API description for its request parameters, response structure, and handling rules.

6.5.1 Station Programming​

After login, batch query, and assignment, the station obtains programming data, programs the device, and reports the result. A typical call flow is:

queryLoginType
↓
preLogin (as needed)
↓
login
↓
queryPPCBatchInfo / queryBatchByOrderNumber
↓
assignBatch (as needed)
↓
getMetadata
↓
getProgrammingData
↓
uploadRequestData (as required by programming items)
↓
programmingResult / deviceData/upload

For SE programming, also observe the following rules:

  • SE-only scenario: A production record may be created at the BOF stage.
  • Mixed SE_MCU programming: Reuse the same traceId from the MCU or Matter programming stage, then execute SE programming operations through executeApdu until EOF.

6.5.2 Testing and Assembly​

Testing and assembly data is reported through /v1/deviceData/upload. To associate a test file, upload the file first, then submit the related production data. A typical call flow is:

login
↓
testFile/upload (as needed)
↓
deviceData/upload

When calling these APIs, note:

  • Testing: For the first upload without attachments, traceId may be omitted, but scenarioType is required. Use the traceId returned by the API for subsequent uploads.
  • File association: To attach a test file, first upload it through /v1/testFile/upload, then use the returned traceId in /v1/deviceData/upload.
  • Assembly: Use the batchId of the actual assembly batch and report the execution result through deviceRecord.testData.result.

Depending on the business flow, a scan may first call /v1/matter/onboarding-payloads/recover to recover Matter onboarding data. Use /v1/device/information/query when detailed device information is needed.

Footer Icon
Download IconDownload User Manual