更新时间:2023-04-13 GMT+08:00
分享

注册LoRa网关

接口说明

loraServer网关上线后,注册LoRa网关。

注意事项

应用已鉴权,在header中携带参数app_key和Authorization: Bearer {accessToken}

URI

请求方法

POST

URI

/api/v3.0/devices/lora/gateway

传输协议

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,用于唯一标识一个产品模型。

gatewayEUI

必选

String

Body

LoRa网关唯一标识,16位hex类型。

name

必选

String

Body

LoRa网关名称。

gatewaySeq

可选

String

Body

LoRa网关接入码,32位hex类型,结合gatewayEUI由LoRa服务商统一生成。

响应参数

名称

类型

说明

deviceId

String

设备ID,用于唯一标识一个设备,在注册LoRa网关时由物联网平台分配获得。

loraServerId

String

LoRaServer接入物联网的标识,由物联网平台分配。

productId

String

LoRa网关关联的产品ID,用于唯一标识一个产品模型。

gatewayEUI

String

LoRa网关唯一标识,16位hex类型。

name

String

LoRa网关名称。

gatewaySeq

String

LoRa网关接入码,32位hex类型,结合gatewayEUI由LoRa服务商统一生成。

请求示例

POST https://{host}:{port}/api/v3.0/devices/lora/gateway
Content-Type: application/json
app_key: ********
Authorization: ********

{
  "ownerAppId" : "string",
  "loraServerId" : "string",
  "productId" : "string",
  "gatewayEUI" : "string",
  "name" : "string",
  "gatewaySeq" : "string"
}

响应示例

Status Code: 201 Created

Content-Type: application/json

{
  "deviceId" : "string",
  "loraServerId" : "string",
  "productId" : "string",
  "gatewayEUI" : "string",
  "name" : "string",
  "gatewaySeq" : "string"
}

错误码

HTTP状态码

HTTP状态码说明

错误码

错误码描述

201

Created

-

-

400

Bad Request

106018

the product not exist.

1200013

The LoRa gateway 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.

1200015

The operation is not allowed. The deviceType of the product model must be LoRaGateway.

1200019

The operation is not allowed. The gatewayEUI 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.

1200001

Failed to register the LoRa gateway.

分享:

    相关文档

    相关产品