注册LoRa节点
接口说明
loraServer网关上线后,注册LoRa节点。
注意事项
应用已鉴权,在header中携带参数app_key和Authorization: Bearer {accessToken}
URI
| 请求方法 | POST |
|---|---|
| URI | /api/v3.0/devices/lora/node |
| 传输协议 | HTTPS |
请求参数
| 名称 | 必选/可选 | 类型 | 位置 | 说明 |
|---|---|---|---|---|
| app_key | 必选 | String | Header | 已鉴权应用的appId |
| Authorization | 必选 | String | Header | 请求的认证信息,值为“Bearer ******”,其中******为Auth鉴权接口返回的accessToken |
| ownerAppId | 可选 | String(36) | Body | LoRa节点所属的应用ID,当添加授权应用下的LoRa节点时需要填写。 |
| loraServerId | 必选 | String | Body | LoRaServer接入物联网的标识,由物联网平台分配。 |
| productId | 必选 | String | Body | LoRa节点关联的产品ID,用于唯一标识一个产品模型。 |
| devEUI | 必选 | String | Body | LoRa节点唯一标识,16位hex类型。 |
| name | 必选 | String | Body | LoRa节点名称。 |
| authCode | 可选 | String | Body | LoRa节点接入码,32位hex类型,结合devEUI由LoRa服务商统一生成。 |
| appEUI | 必选 | String | Body | LoRa应用唯一标识,16位hex类型。 |
| deviceClass | 可选 | String | Body | 设备工作模式,不填写时默认是classA。 |
| joinType | 可选 | String | Body | 入网方式,不填写时默认是OTAA。 |
| appSKey | 可选 | String | Body | 应用会话密钥,32位hex类型,joinType是ABP时填写参数。 |
| devAddr | 可选 | String | Body | 设备地址,8位hex类型,joinType是ABP时填写参数。 |
| nwkSKey | 可选 | String | Body | 网络会话密钥,32位hex类型,joinType是ABP时填写参数。 |
| appKey | 可选 | String | Body | 应用密钥,32位hex类型,joinType是OTAA时填写参数。 |
| description | 可选 | String | Body | LoRa节点描述。 |
响应参数
| 名称 | 类型 | 说明 |
|---|---|---|
| deviceId | String | 设备ID,用于唯一标识一个设备,在注册LoRa节点时由物联网平台分配获得。 |
| loraServerId | String | LoRaServer接入物联网的标识,由物联网平台分配。 |
| productId | String | LoRa节点关联的产品ID,用于唯一标识一个产品模型。 |
| devEUI | String | LoRa节点唯一标识,16位hex类型。 |
| name | String | LoRa节点名称。 |
| authCode | String | LoRa节点接入码,32位hex类型,结合devEUI由LoRa服务商统一生成。 |
| appEUI | String | LoRa应用唯一标识,16位hex类型。 |
| deviceClass | String | 设备工作模式。 |
| joinType | String | 入网方式。 |
| appSKey | String | 应用会话密钥,32位hex类型,joinType是ABP时填写参数。 |
| devAddr | String | 设备地址,8位hex类型,joinType是ABP时填写参数。 |
| nwkSKey | String | 网络会话密钥,32位hex类型,joinType是ABP时填写参数。 |
| appKey | String | 应用密钥,32位hex类型,joinType是OTAA时填写参数。 |
| description | String | LoRa节点描述。 |
请求示例
POST https://{host}:{port}/api/v3.0/devices/lora/node
Content-Type: application/json
app_key: ********
Authorization: ********
{
"ownerAppId" : "string",
"loraServerId" : "string",
"productId" : "string",
"devEUI" : "string",
"name" : "string",
"authCode" : "string",
"appEUI" : "string",
"deviceClass" : "string",
"joinType" : "string",
"appSKey" : "string",
"devAddr" : "string",
"nwkSKey" : "string",
"appKey" : "string",
"description" : "string"
} 响应示例
Status Code: 201 Created
Content-Type: application/json
{
"deviceId" : "string",
"loraServerId" : "string",
"productId" : "string",
"devEUI" : "string",
"name" : "string",
"authCode" : "string",
"appEUI" : "string",
"deviceClass" : "string",
"joinType" : "string",
"appSKey" : "string",
"devAddr" : "string",
"nwkSKey" : "string",
"appKey" : "string",
"description" : "string"
} 错误码
| HTTP状态码 | HTTP状态码说明 | 错误码 | 错误码描述 |
|---|---|---|---|
| 201 | Created | - | - |
| 400 | Bad Request | 106018 | the product not exist. |
| 1200008 | Invalid input. The appKey cannot be empty. | ||
| 1200009 | Invalid input. The appSKey cannot be empty. | ||
| 1200010 | Invalid input. The nwkSKey cannot be empty. | ||
| 1200011 | Invalid input. The devAddr cannot be empty. | ||
| 1200012 | The LoRa node already exists. | ||
| 1200014 | The LoRa Server processing failed:% | ||
| 403 | Forbidden | 100217 | The application hasn't been authorized. |
| 100249 | The operation is not allowed.The application does not have edit permission. | ||
| 1200006 | The operation is not allowed. The LoRa Server is not online. | ||
| 1200007 | The operation is not allowed. The protocol of the product model is not LoRaWAN. | ||
| 1200016 | The operation is not allowed. The deviceType of the product model cannot be LoRaGateway. | ||
| 1200018 | The operation is not allowed. The devEUI is duplicated. | ||
| 404 | Not Found | 100203 | The application is not existed. |
| 1200017 | The LoRa Server is not existed. | ||
| 500 | Internal server error | 100001 | Internal server error. |
| 100220 | Get AppKey from header failed. | ||
| 1200000 | Failed to register the LoRa node. |
Last Article: 注册LoRa网关
Next Article: 查询单个LoRa网关信息
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.