云服务


云服务

云服务接口

Base URLs:

Email: Ticos Team

应用鉴权和接入配置

 

应用鉴权和接入配置

 

小程序登录

使用方式

POST /auth/miniapp/login HTTP/1.1

Content-Type: application/json
Accept: */*

POST /auth/miniapp/login

请求参数

{
  "code": "string",
  "appId": "string",
  "appSecret": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» codebodystringtruenone
» appIdbodystringtruenone
» appSecretbodystringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» access_tokenstringtruenonenone
» scopestringtruenonenone
» id_tokenstringtruenonenone
» token_typestringtruenonenone
» expires_instringtruenonenone

 

获取已经配置的小程序应用

使用方式

GET /auth/miniapp?orgId=string HTTP/1.1

Accept: */*

GET /auth/miniapp

参数说明

参数位置类型必需描述
orgIdquerystringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» miniapps[object]truenonenone
»» miniappKeystringtruenonenone
»» miniappSecretstringtruenonenone
»» iamKeystringtruenonenone
»» iamSecretstringtruenonenone

 

配置小程序应用

使用方式

POST /auth/miniapp HTTP/1.1

Content-Type: application/json
Accept: */*

POST /auth/miniapp

请求参数

{
  "orgId": "string",
  "appKey": "string",
  "appSecret": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» orgIdbodystringtruenone
» appKeybodystringtruenone
» appSecretbodystringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» statusstringtruenonenone

摄像头

 

摄像头

 

创建摄像头

使用方式

POST /cameras HTTP/1.1

Content-Type: application/json
Accept: */*

POST /cameras

请求参数

{
  "name": "string",
  "orgId": "string",
  "serialNo": "string",
  "code": "string",
  "pcUrl": "string",
  "miniUrl": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» namebodystringtrue摄像头名称
» orgIdbodystringtrue组织ID
» serialNobodystringtrue摄像头序列号
» codebodystringtrue摄像头验证码
» pcUrlbodystringtruePC端播放地址
» miniUrlbodystringtrue小程序播放地址

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

查询摄像头列表

使用方式

GET /cameras?orgId=string HTTP/1.1

Accept: */*

GET /cameras

参数说明

参数位置类型必需描述
orgIdquerystringtrue组织ID
searchTypequerystringfalse1为name,2为serialNo
searchKeyquerystringfalse模糊查询内容
$topquerystringfalsenone
$skipquerystringfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenone摄像头ID
» namestringtruenone摄像头名称
» orgIdstringtruenone组织ID
» serialNostringtruenone摄像头序列号
» codestringtruenone摄像头验证码
» pcUrlstringtruenonePC端播放地址
» miniUrlstringtruenone小程序播放地址
» createdTimestringtruenone创建时间
» updatedTimestringtruenone更新时间

 

删除摄像头

使用方式

DELETE /cameras/{cameraId} HTTP/1.1

Accept: */*

DELETE /cameras/{cameraId}

参数说明

参数位置类型必需描述
cameraIdpathstringtrue摄像头ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

更新摄像头

使用方式

PUT /cameras/{cameraId} HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /cameras/{cameraId}

请求参数

{
  "name": "string",
  "orgId": "string",
  "serialNo": "string",
  "code": "string",
  "pcUrl": "string",
  "miniUrl": "string"
}

参数说明

参数位置类型必需描述
cameraIdpathstringtrue摄像头ID
bodybodyobjectfalsenone
» namebodystringfalsenone
» orgIdbodystringfalsenone
» serialNobodystringfalsenone
» codebodystringfalsenone
» pcUrlbodystringfalsenone
» miniUrlbodystringfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

查询摄像头

使用方式

GET /cameras/{cameraId} HTTP/1.1

Accept: */*

GET /cameras/{cameraId}

参数说明

参数位置类型必需描述
cameraIdpathstringtrue摄像头ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenone摄像头ID
» namestringtruenone摄像头名称
» orgIdstringtruenone组织ID
» serialNostringtruenone摄像头序列号
» codestringtruenone摄像头验证码
» pcUrlstringtruenonePC端播放地址
» miniUrlstringtruenone小程序播放地址
» createdTimestringtruenone创建时间
» updatedTimestringtruenone更新时间

设备标签

 

设备标签

 

创建设备标签

使用方式

POST /deviceTags HTTP/1.1

Content-Type: application/json
Accept: */*

POST /deviceTags

请求参数

{
  "id": "string",
  "name": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» idbodystringfalsenone
» namebodystringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

单设备或多设备匹配标签池中哪些标签

使用方式

GET /deviceTags?productId=string HTTP/1.1

Accept: */*

GET /deviceTags

参数说明

参数位置类型必需描述
productIdquerystringtrue产品ID
deviceIdquerystringfalse设备ID
deviceIdsquerystringfalse多个设备ID
$skipquerystringfalse分页启始偏移量
$topquerystringfalse分页取数

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» productIdstringfalsenonenone
» deviceIdstringfalsenonenone
» tagIdstringfalsenonenone
» tagNamestringfalsenonenone
» createdTimestringfalsenonenone

 

删除设备标签

使用方式

POST /deviceTags/{tagId} HTTP/1.1

Accept: */*

POST /deviceTags/{tagId}

参数说明

参数位置类型必需描述
tagIdpathstringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationstring

 

根据标签获取设备列表

使用方式

GET /deviceTags/{tagId}?productId=string HTTP/1.1

Accept: */*

GET /deviceTags/{tagId}

参数说明

参数位置类型必需描述
tagIdpathstringtruenone
productIdquerystringtrue产品ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» productIdstringfalsenone产品ID
» deviceIdstringfalsenone设备ID
» tagIdstringfalsenone标签ID
» tagNamestringfalsenone标签名称
» createdTimestringfalsenone创建时间

 

获得所有标签

使用方式

GET /deviceTags/all HTTP/1.1

Accept: */*

GET /deviceTags/all

参数说明

参数位置类型必需描述
$skipquerystringfalsenone
$topquerystringfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringtruenone标签ID
» namestringtruenone标签名称
» createdTimestringtruenone标签创建时间

 

设备绑定标签

使用方式

POST /deviceTags/bind HTTP/1.1

Content-Type: application/json
Accept: */*

POST /deviceTags/bind

请求参数

{
  "productId": "string",
  "deviceId": "string",
  "tagId": "string",
  "tagName": "string",
  "createdTime": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» productIdbodystringtrue产品ID
» deviceIdbodystringtrue设备ID
» tagIdbodystringtrue设备标签ID
» tagNamebodystringtrue设备标签名称
» createdTimebodystringtrue创建时间

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

设备解绑标签

使用方式

DELETE /deviceTags/unbind HTTP/1.1

Content-Type: application/json
Accept: */*

DELETE /deviceTags/unbind

请求参数

{
  "productId": "string",
  "deviceId": "string",
  "tagId": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» productIdbodystringtrue产品ID
» deviceIdbodystringtrue设备ID
» tagIdbodystringtrue设备标签ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

B端用户服务

 

B端用户服务

用户管理相关接口服务

 

用户创建

使用方式

POST /users HTTP/1.1

Content-Type: application/json
Accept: */*

POST /users

请求参数

{
  "name": "string",
  "password": "string",
  "phone": "string",
  "email": "string",
  "avatar": "string",
  "sourceType": "string",
  "sourceId": "string",
  "authType": "string",
  "isBindWeChat": true
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» namebodystringfalse用户名, 用于登录和展示
» passwordbodystringfalse密码, 用于登录
» phonebodystringfalse手机号
» emailbodystringfalse邮箱
» avatarbodystringfalse用户图像
» sourceTypebodystringfalse用户源, 可选项: TECENT
» sourceIdbodystringfalse用户源用户ID
» authTypebodystringfalse认证方式. 可选项, WECHAT - 微信扫码授权
» isBindWeChatbodybooleanfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringfalsenonenone
» namestringfalsenonenone
» phonestringfalsenonenone
» emailstringfalsenonenone
» avatarstringfalsenonenone
» passwordstringfalsenonenone
» isBindWeChatbooleanfalsenonenone
» createdTimestringfalsenonenone
» updatedTimestringfalsenonenone

 

用户注册

使用方式

POST /:id/register HTTP/1.1

Content-Type: application/json
Accept: */*

POST /:id/register

请求参数

{
  "name": "string",
  "phone": "string",
  "otpCode": "string",
  "optToken": "string",
  "email": "string",
  "company": "string",
  "isBindWeChat": true
}

参数说明

参数位置类型必需描述
idpathstringtruenone
bodybodyobjectfalsenone
» namebodystringtruenone
» phonebodystringtruenone
» otpCodebodystringtruenone
» optTokenbodystringtruenone
» emailbodystringfalsenone
» companybodystringfalsenone
» isBindWeChatbodybooleanfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

用户修改

使用方式

PUT /users/:id HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /users/:id

请求参数

{
  "phone": "string",
  "email": "string",
  "otpCode": "string",
  "otpToken": "string",
  "avatar": "string",
  "isBindWeChat": true
}

参数说明

参数位置类型必需描述
idpathstringtrue用户ID
bodybodyobjectfalsenone
» phonebodystringfalse手机号
» emailbodystringfalse邮箱
» otpCodebodystringfalse验证码
» otpTokenbodystringfalse验证token, 验证码发送接口返回
» avatarbodystringfalse用户图像
» isBindWeChatbodybooleanfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringfalsenonenone
» namestringfalsenonenone
» phonestringfalsenonenone
» emailstringfalsenonenone
» avatarstringfalsenonenone
» passwordstringfalsenonenone
» isBindWeChatbooleanfalsenonenone
» createdTimestringfalsenonenone
» updatedTimestringfalsenonenone

 

删除用户

使用方式

DELETE /users/:id HTTP/1.1

Content-Type: text/plain
Accept: */*

DELETE /users/:id

请求参数

string

参数说明

参数位置类型必需描述
idpathstringtrue用户ID
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationstring

 

获取用户

使用方式

GET /users/:id HTTP/1.1

Content-Type: text/plain
Accept: */*

GET /users/:id

请求参数

string

参数说明

参数位置类型必需描述
idpathstringtrue用户ID
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringfalsenonenone
» namestringfalsenonenone
» phonestringfalsenonenone
» emailstringfalsenonenone
» avatarstringfalsenonenone
» passwordstringfalsenonenone
» isBindWeChatbooleanfalsenonenone
» createdTimestringfalsenonenone
» updatedTimestringfalsenonenone

 

修改密码

使用方式

POST /users/:id/changePassword HTTP/1.1

Content-Type: application/json
Accept: */*

POST /users/:id/changePassword

请求参数

{
  "oldPassword": "string",
  "newPassword": "string"
}

参数说明

参数位置类型必需描述
idpathstringtrue用户ID
bodybodyobjectfalsenone
» oldPasswordbodystringfalse原密码
» newPasswordbodystringfalse新密码

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringfalsenonenone
» namestringfalsenonenone
» phonestringfalsenonenone
» emailstringfalsenonenone
» avatarstringfalsenonenone
» passwordstringfalsenonenone
» createdTimestringfalsenonenone
» updatedTimestringfalsenonenone

 

获取用户组织

使用方式

GET /users/:id/orgs?id=string HTTP/1.1

Accept: */*

GET /users/:id/orgs

参数说明

参数位置类型必需描述
idpathstringtruenone
idquerystringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» orgIdstringtruenone组织id
» namestringtruenone组织名称
» rolesstringtruenone在该组织的角色

C端用户服务

 

C端用户服务

 

创建C端用户

使用方式

POST /consumers HTTP/1.1

Content-Type: application/json
Accept: */*

POST /consumers

请求参数

{
  "openId": "string",
  "orgId": "string",
  "name": "string",
  "phone": "string",
  "email": "string",
  "appId": "string",
  "platform": "string",
  "deviceCount": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» openIdbodystringtrueopenID
» orgIdbodystringfalse组织ID
» namebodystringtrue用户名称
» phonebodystringfalse手机号
» emailbodystringfalseemail名称
» appIdbodystringtrue应用ID
» platformbodystringtrue平台信息
» deviceCountbodystringfalse绑定设备数量

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

查询C端用户服务列表

使用方式

GET /consumers?orgId=string HTTP/1.1

Accept: */*

GET /consumers

参数说明

参数位置类型必需描述
orgIdquerystringtrue组织ID
searchTypequerystringfalse搜索类型,1为用户名称、2为手机号、3为email
searchKeyquerystringfalse搜索的值
$topquerystringfalse最多展现多少条
$skipquerystringfalse翻页偏移量

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» userListobjecttruenonenone
»» idstringtruenone用户ID
»» openIdstringtruenonenone
»» orgIdstringtruenone组织ID
»» namestringtruenone用户名称
»» phonestringtruenone手机号
»» emailstringtruenone邮箱
»» appIdstringtruenone应用ID
»» deviceCountstringtruenone设备数量
» countstringtruenone检索的用户总量

 

删除C端用户

使用方式

DELETE /consumers/{consumerId} HTTP/1.1

Accept: */*

DELETE /consumers/{consumerId}

参数说明

参数位置类型必需描述
consumerIdpathstringtrue用户ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

修改C端用户信息

使用方式

PUT /consumers/{consumerId} HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /consumers/{consumerId}

请求参数

{
  "openId": "string",
  "orgId": "string",
  "name": "string",
  "phone": "string",
  "email": "string",
  "appId": "string",
  "platform": "string",
  "deviceCount": "string"
}

参数说明

参数位置类型必需描述
consumerIdpathstringtruenone
bodybodyobjectfalsenone
» openIdbodystringfalseopenID
» orgIdbodystringtrue组织ID
» namebodystringfalse用户名称
» phonebodystringfalse手机号
» emailbodystringfalseemail
» appIdbodystringfalse应用ID
» platformbodystringfalse平台信息
» deviceCountbodystringfalse绑定设备数量

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

查询C端用户服务

使用方式

GET /consumers/{consumerId} HTTP/1.1

Accept: */*

GET /consumers/{consumerId}

参数说明

参数位置类型必需描述
consumerIdpathstringtrue用户ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenone用户ID
» openIdstringtruenonenone
» orgIdstringtruenone组织ID
» namestringtruenone用户名称
» phonestringtruenone手机号
» emailstringtruenone邮箱
» appIdstringtruenone应用ID
» platformstringtruenone平台信息
» deviceCountstringtruenone设备数量
» createdTimestringtruenone创建时间
» updatedTimestringtruenone更新时间

验证码服务

 

验证码服务

验证码服务

 

发送验证码到手机

使用方式

POST /otp/phone HTTP/1.1

Content-Type: application/json
Accept: */*

POST /otp/phone

请求参数

{
  "phone": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» phonebodystringfalse手机号, 用于发送验证码

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» otpTokenstringtruenone调用用户修改接口并且修改邮箱或者手机号时传入

 

发送验证码到邮箱

使用方式

POST /otp/email HTTP/1.1

Content-Type: application/json
Accept: */*

POST /otp/email

请求参数

{
  "email": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» emailbodystringfalse邮箱 用于发送验证码

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» otpTokenstringtruenone调用用户修改接口并且修改邮箱或者手机号时传入

我的

 

我的

 

用户绑定的设备列表

使用方式

GET /mine/devices HTTP/1.1

Accept: */*
Authorization: Bearer XXXXXX

GET /mine/devices

参数说明

参数位置类型必需描述
AuthorizationheaderstringtrueAuthorization (Only:Bearer XXXXXX)
appUserIdquerystringfalseB端用户调用此接口时的appUserId
$skipquerystringfalsenone
$topquerystringfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» deviceList[object]truenonenone
»» idstringtruenone用户设备绑定ID
»» productIdstringtruenone产品ID
»» deviceIdstringtruenone设备ID
»» createdTimestringtruenone绑定时间
» countstringtruenonenone

 

用户绑定设备

使用方式

POST /mine/devices HTTP/1.1

Content-Type: application/json
Accept: */*
Authorization: Bearer XXXXXX

POST /mine/devices

请求参数

{
  "productId": "string",
  "deviceId": "string"
}

参数说明

参数位置类型必需描述
AuthorizationheaderstringtrueAuthorization (Only:Bearer XXXXXX)
bodybodyobjectfalsenone
» productIdbodystringtrue产品ID
» deviceIdbodystringtrue设备ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenone产品设备绑定ID
» productIdstringtruenone产品ID
» deviceIdstringtruenone设备ID
» createdTimestringtruenone绑定时间

 

用户解绑设备

使用方式

DELETE /mine/devices/{deviceId}?productId=string HTTP/1.1

Accept: */*

DELETE /mine/devices/{deviceId}

参数说明

参数位置类型必需描述
deviceIdpathstringtrue设备ID
productIdquerystringtrue产品ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

场景联动

 

场景联动

设备编排

 

创建设备编排

使用方式

POST /linkages HTTP/1.1

Content-Type: application/json
Accept: */*

POST /linkages

请求参数

{
  "orgId": "string",
  "id": "string",
  "code": "string",
  "name": "string",
  "description": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» orgIdbodystringtrue组织ID
» idbodystringfalse联动ID
» codebodystringtrueNodeRed源码
» namebodystringtrue联动名称
» descriptionbodystringtrue联动描述

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» orgIdstringtruenone组织ID
» idstringtruenone设备编排ID

 

获取设备编排列表

使用方式

GET /linkages?orgId=string HTTP/1.1

Accept: */*

GET /linkages

参数说明

参数位置类型必需描述
orgIdquerystringtrue联动ID
$skipquerystringfalse查询的偏移量
$topquerystringfalse查询的最多数量

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

删除设备编排

使用方式

DELETE /linkages/{linkageId}?orgId=string HTTP/1.1

Accept: */*

DELETE /linkages/{linkageId}

参数说明

参数位置类型必需描述
linkageIdpathstringtruenone
orgIdquerystringtrue组织ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

更新设备编排

使用方式

PUT /linkages/{linkageId} HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /linkages/{linkageId}

请求参数

{
  "orgId": "string",
  "name": "string",
  "description": "string",
  "code": "string"
}

参数说明

参数位置类型必需描述
linkageIdpathstringtruenone
bodybodyobjectfalsenone
» orgIdbodystringtrue组织ID
» namebodystringtrue联动名称
» descriptionbodystringtrue联动描述
» codebodystringtrue联动代码

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

获取设备编排

使用方式

GET /linkages/{linkageId}?orgId=string HTTP/1.1

Accept: */*

GET /linkages/{linkageId}

参数说明

参数位置类型必需描述
linkageIdpathstringtrue联动ID
orgIdquerystringtrue组织ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

查询设备联动的状态

使用方式

GET /linkages/{linkageId}/status?orgId=string HTTP/1.1

Accept: */*

GET /linkages/{linkageId}/status

参数说明

参数位置类型必需描述
linkageIdpathstringtruenone
orgIdquerystringtrue组织ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

启动设备联动

使用方式

POST /linkages/{linkageId}/start?orgId=string HTTP/1.1

Accept: */*

POST /linkages/{linkageId}/start

参数说明

参数位置类型必需描述
linkageIdpathstringtruenone
orgIdquerystringtrue组织ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

停止设备联动

使用方式

POST /linkages/{linkageId}/stop?orgId=string HTTP/1.1

Accept: */*

POST /linkages/{linkageId}/stop

参数说明

参数位置类型必需描述
linkageIdpathstringtruenone
orgIdquerystringtrue组织ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

数据大屏

 

数据大屏

 

删除数据大屏

使用方式

DELETE /digitalScreens/{digitalScreenId}?orgId=string HTTP/1.1

Accept: */*

DELETE /digitalScreens/{digitalScreenId}

参数说明

参数位置类型必需描述
digitalScreenIdpathstringtruenone
orgIdquerystringtrue组织ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

变更数据大屏信息

使用方式

PUT /digitalScreens/{digitalScreenId} HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /digitalScreens/{digitalScreenId}

请求参数

{
  "orgId": "string",
  "pageId": "string",
  "name": "string",
  "description": "string"
}

参数说明

参数位置类型必需描述
digitalScreenIdpathstringtruenone
bodybodyobjectfalsenone
» orgIdbodystringfalsenone
» pageIdbodystringfalsenone
» namebodystringfalsenone
» descriptionbodystringfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

查询数据大屏

使用方式

GET /digitalScreens/{digitalScreenId}?orgId=string HTTP/1.1

Accept: */*

GET /digitalScreens/{digitalScreenId}

参数说明

参数位置类型必需描述
digitalScreenIdpathstringtruenone
orgIdquerystringtrue组织ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

新增数据大屏

使用方式

POST /digitalScreens HTTP/1.1

Content-Type: application/json
Accept: */*

POST /digitalScreens

请求参数

{
  "orgId": "string",
  "pageId": "string",
  "name": "string",
  "description": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» orgIdbodystringtrue组织ID
» pageIdbodystringtrue页面ID,对应洛书的菜单
» namebodystringtrue数字大屏名称
» descriptionbodystringtrue数字大屏描述

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

查询数据大屏列表

使用方式

GET /digitalScreens HTTP/1.1

Accept: */*

GET /digitalScreens

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

设备

 

设备

设备管理相关 API

 

新建设备

使用方式

POST /devices HTTP/1.1

Content-Type: application/json
Accept: */*

POST /devices

请求参数

{
  "productId": "string",
  "name": "string",
  "alias": "string",
  "type": 0,
  "status": 0,
  "tags": [
    "string"
  ],
  "id": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» productIdbodystringtrue产品ID
» namebodystringtrue设备名称
» aliasbodystringfalse设备别名
» typebodynumbertrue设备类型, 1:设备\n2:子设备\n3:网关
» statusbodynumberfalse设备状态, 1-未激活、2-离线、3-在线、4-获取失败
» tagsbody[string]false设备标签
» idbodystringfalse设备ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringtruenone设备ID
» productIdstringtruenone产品ID
» namestringtruenone设备名称
» aliasstringfalsenone设备别名
» typenumbertruenone设备类型, 1:设备
2:子设备
3:网关
» statusnumbertruenone设备状态, 1-未激活、2-离线、3-在线、4-获取失败
» tags[string]falsenone设备标签
» secretstringfalsenone密钥
» firmwareVersionstringfalsenone固件版本
» ipAddressstringfalsenone上次在线ip地址
» lastOnlineTimestringfalsenone上次在线时间
» activationTimestringfalsenone激活时间
» createdTimestringfalsenone创建时间
» updatedTimestringfalsenone更新时间

 

获取设备列表

使用方式

GET /devices?productId=string HTTP/1.1

Content-Type: application/json
Accept: */*

GET /devices

请求参数

{}

参数说明

参数位置类型必需描述
$skipquerystringfalsenone
$topquerystringfalsenone
productIdquerystringtrue产品ID
statusquerystringfalse设备状态, 1-未激活、2-离线、3-在线、4-获取失败
typequerystringfalse设备类型, 1:设备2:子设备3:网关
deviceIdsquerystringfalse设备ID列表
namequerystringfalse设备名称
bodybodyobjectfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» deviceList[object]truenonenone
»» idstringfalsenone设备ID
»» productIdstringfalsenone产品ID
»» namestringfalsenone设备名称
»» aliasstringfalsenone设备别名
»» typenumberfalsenone设备类型, 1:设备
2:子设备
3:网关
»» statusnumberfalsenone设备状态, 1-未激活、2-离线、3-在线、4-获取失败
»» tags[string]falsenone设备标签
»» secretstringfalsenone密钥
»» firmwareVersionstringfalsenone固件版本
»» ipAddressstringfalsenone上次在线ip地址
»» lastOnlineTimestringfalsenone上次在线时间
»» activationTimestringfalsenone激活时间
»» createdTimestringfalsenone创建时间
»» updatedTimestringfalsenone更新时间
» countnumbertruenonenone

 

删除设备

使用方式

DELETE /devices/{deviceId}?productId=string HTTP/1.1

Content-Type: application/json
Accept: */*

DELETE /devices/{deviceId}

请求参数

{}

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID
bodybodyobjectfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

更新设备

使用方式

PUT /devices/{deviceId}?productId=string HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /devices/{deviceId}

请求参数

{
  "productId": "string",
  "name": "string",
  "alias": "string",
  "type": 0,
  "status": 0,
  "tags": [
    "string"
  ]
}

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID
bodybodyobjectfalsenone
» productIdbodystringfalse产品ID
» namebodystringfalse设备名称
» aliasbodystringfalse设备别名
» typebodynumberfalse设备类型, 1:设备
» statusbodynumberfalse设备状态, 1-未激活、2-离线、3-在线、4-获取失败
» tagsbody[string]false设备标签

详细描述

» type: 设备类型, 1:设备 2:子设备 3:网关

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringtruenone设备ID
» productIdstringtruenone产品ID
» namestringtruenone设备名称
» aliasstringfalsenone设备别名
» typenumbertruenone设备类型, 1:设备
2:子设备
3:网关
» statusnumbertruenone设备状态, 1-未激活、2-离线、3-在线、4-获取失败
» tags[string]falsenone设备标签
» secretstringfalsenone密钥
» firmwareVersionstringfalsenone固件版本
» ipAddressstringfalsenone上次在线ip地址
» lastOnlineTimestringfalsenone上次在线时间
» activationTimestringfalsenone激活时间
» createTimestringfalsenone创建时间
» updateTimestringfalsenone更新时间

 

查询设备详情

使用方式

GET /devices/{deviceId}?productId=string HTTP/1.1

Content-Type: application/json
Accept: */*

GET /devices/{deviceId}

请求参数

"string"

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID
bodybodystring(binary)falsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringtruenone设备ID
» productIdstringtruenone产品ID
» namestringtruenone设备名称
» aliasstringfalsenone设备别名
» typenumbertruenone设备类型, 1:设备
2:子设备
3:网关
» statusnumbertruenone设备状态, 1-未激活、2-离线、3-在线、4-获取失败
» tags[string]falsenone设备标签
» secretstringfalsenone密钥
» firmwareVersionstringfalsenone固件版本
» ipAddressstringfalsenone上次在线ip地址
» lastOnlineTimestringfalsenone上次在线时间
» activationTimestringfalsenone激活时间
» createTimestringfalsenone创建时间
» updateTimestringfalsenone更新时间

 

批量更新设备信息

使用方式

POST /devices/batchUpdate HTTP/1.1

Content-Type: application/json
Accept: */*

POST /devices/batchUpdate

请求参数

{
  "devices": [
    {
      "name": "string",
      "productId": "string",
      "status": "string"
    }
  ]
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» devicesbody[object]false设备信息列表
»» namebodystringfalse设备名称
»» productIdbodystringfalse设备所属产品ID
»» statusbodystringfalse设备状态信息

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationstring

 

新建设备孪生

使用方式

POST /devices/{deviceId}/twin?productId=string HTTP/1.1

Content-Type: text/plain
Accept: */*

POST /devices/{deviceId}/twin

请求参数

""

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

更新设备孪生

使用方式

PUT /devices/{deviceId}/twin?productId=string HTTP/1.1

Accept: */*

PUT /devices/{deviceId}/twin

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

删除设备孪生

使用方式

DELETE /devices/{deviceId}/twin?productId=string HTTP/1.1

Accept: */*

DELETE /devices/{deviceId}/twin

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

查询设备孪生

使用方式

GET /devices/{deviceId}/twin?productId=string HTTP/1.1

Accept: */*

GET /devices/{deviceId}/twin

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

检索数据孪生

使用方式

POST /twin?query=string HTTP/1.1

Accept: */*

POST /twin

KQL select * from digitalTwins where ???

参数说明

参数位置类型必需描述
queryquerystringtrue查询SQL语句

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

设备上报遥测

使用方式

POST /devices/{deviceId}/telemetry?productId=string HTTP/1.1

Accept: */*

POST /devices/{deviceId}/telemetry

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

发送设备命令

使用方式

POST /devices/{deviceId}/commands?productId=string HTTP/1.1

Accept: */*

POST /devices/{deviceId}/commands

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

desired设备属性变化

使用方式

POST /devices/{deviceId}/desired?productId=string HTTP/1.1

Content-Type: text/plain
Accept: */*

POST /devices/{deviceId}/desired

请求参数

'{"type":"object","title":"empty object","properties":{}}'

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

desired设备属性patch变化

使用方式

POST /devices/{deviceId}/patch/desired?productID=string HTTP/1.1

Content-Type: text/plain
Accept: */*

POST /devices/{deviceId}/patch/desired

符合:https://jsonpatch.com/open in new window

请求参数

|
[
  {
    "op": "add",
    "path": "/$metadata/color",
    "value": {
      "desiredValue": "blue",
      "desiredVersion": 1
    }
  }
]

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIDquerystringtrue产品ID
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

reported设备属性变化

使用方式

POST /devices/{deviceId}/reported?productId=string HTTP/1.1

Content-Type: text/plain
Accept: */*

POST /devices/{deviceId}/reported

请求参数

|
{
    "water_volume": 120,
    "$lastUpdateTime": "2020-07-17T06:11:04.9309159Z",
    "$requestId":"xxx"
}

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

reported设备属性patch变化

使用方式

POST /devices/{deviceId}/patch/reported?productId=string HTTP/1.1

Content-Type: text/plain
Accept: */*

POST /devices/{deviceId}/patch/reported

符合:https://jsonpatch.com/open in new window

请求参数

|
[
  {
    "op": "add",
    "path": "/water_volume",
    "value": 120
  },
  {
    "op": "add",
    "path": "/$metadata/water_volume/lastUpdateTime",
    "value": "2020-07-17T06:11:04.9309159Z"
  }
]

参数说明

参数位置类型必需描述
deviceIdpathstringtruenone
productIdquerystringtrue产品ID
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

产品模版

 

产品模版

产品模版相关 API

 

删除产品模版

使用方式

DELETE /productTemplates/{productTemplateId} HTTP/1.1

Content-Type: application/json
Accept: */*

DELETE /productTemplates/{productTemplateId}

请求参数

{}

参数说明

参数位置类型必需描述
productTemplateIdpathstringtruenone
bodybodyobjectfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

更新产品模版

使用方式

PUT /productTemplates/{productTemplateId} HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /productTemplates/{productTemplateId}

请求参数

{
  "name": "string",
  "description": "string",
  "category": "string",
  "iconUrl": "string",
  "deviceModel": "string",
  "packageInfo": "string"
}

参数说明

参数位置类型必需描述
productTemplateIdpathstringtruenone
bodybodyobjectfalsenone
» namebodystringfalsenone
» descriptionbodystringfalsenone
» categorybodystringfalse模版所属类别, 从模版列表api获取可选类别
» iconUrlbodystringfalsenone
» deviceModelbodystringfalsenone
» packageInfobodystringfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

 

查询设备模版详情

使用方式

GET /productTemplates/{productTemplateId} HTTP/1.1

Content-Type: application/json
Accept: */*

GET /productTemplates/{productTemplateId}

请求参数

"string"

参数说明

参数位置类型必需描述
productTemplateIdpathstringtruenone
bodybodystring(binary)falsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenonenone
» namestringtruenonenone
» categorystringtruenone模版所属类别
» descriptionstringtruenonenone
» iconUrlstringtruenone用于展示产品的图片地址
» deviceModelstringtruenone设备模型,用于描述设备具体功能, 采用DTDL 建模语言进行描述。关于DTDL请参考https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.mdopen in new window
» packageInfostringtruenone产品代码信息, JSON格式字符串

 

新增产品模版

使用方式

POST /productTemplates HTTP/1.1

Content-Type: application/json
Accept: */*

POST /productTemplates

请求参数

{
  "name": "string",
  "category": "string",
  "description": "string",
  "iconUrl": "string",
  "deviceModel": "string",
  "packageInfo": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» namebodystringtruenone
» categorybodystringtrue模版所属类别,从模版列表接口获取可选类别
» descriptionbodystringfalsenone
» iconUrlbodystringtrue模版产品展示的图片地址,地址从上传接口获取
» deviceModelbodystringtrue设备模型,用于描述设备具体功能, 采用DTDL 建模语言进行描述。关于DTDL请参考https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.mdopen in new window
» packageInfobodystringtrue产品代码信息, JSON格式字符串

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

获取设备模版列表

使用方式

GET /productTemplates HTTP/1.1

Content-Type: application/json
Accept: */*

GET /productTemplates

请求参数

"string"

参数说明

参数位置类型必需描述
bodybodystring(binary)falsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringtruenonenone
» namestringtruenone第一级类别名称
» subCategories[object]truenonenone
»» idstringtruenonenone
»» namestringtruenone第二级类别名称
»» subCategories[object]truenonenone
»»» idstringtruenonenone
»»» namestringtruenone第二级类别名称
»»» productTemplates[object]truenonenone
»»»» idstringtruenonenone
»»»» namestringtruenone模版名称
»»»» descriptionstringtruenonenone
»»»» iconUrlstringtruenone用于展示产品的图片地址

产品

 

产品

产品管理相关 API

 

新建产品

使用方式

POST /products HTTP/1.1

Content-Type: application/json
Accept: */*

POST /products

请求参数

{
  "name": "string",
  "encryptionType": 0,
  "productType": 0,
  "netType": "string",
  "dataProtocol": 0,
  "description": "string",
  "projectId": "string",
  "productTemplateId": "string",
  "brand": "string",
  "modelNumber": "string",
  "iconUrl": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» namebodystringtrue产品名称
» encryptionTypebodyintegertrue加密类型,1表示证书认证,2表示签名认证
» productTypebodyintegertrue产品类型,0-设备,5-网关, 9 子设备
» netTypebodystringtrue连接类型, wifi, cellular, ble, else
» dataProtocolbodyintegertrue数据协议, 1 物模型 2 自定义
» descriptionbodystringfalse产品描述
» projectIdbodystringtrue所属项目id
» productTemplateIdbodystringtrue设备模版ID
» brandbodystringfalse品牌
» modelNumberbodystringfalse型号
» iconUrlbodystringfalse产品展示图片, 图片地址通过上传接口获取

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringfalsenone产品ID
» namestringfalsenone产品名称
» productTemplateIdstringfalsenone产品品类模板ID
» projectIdstringfalsenone所属项目id
» encryptionTypeintegerfalsenone加密类型 加密类型,1表示证书认证,2表示签名认证。
» productTypeintegerfalsenone设备类型,0设备,5网关。
» netTypestringfalsenone连接类型
» dataProtocolintegerfalsenone数据协议 1 使用物模型 2 为自定义
» descriptionstringfalsenone产品描述
» statusstringfalsenone状态
» brandstringfalsenone品牌
» modelNumberstringfalsenone型号
» iconUrlstringfalsenonenone
» createdTimestringfalsenone创建时间
» updatedTimestringfalsenone最后一次更新时间
» releasedTimestringfalsenone发布时间

 

修改产品

使用方式

PUT /products/{productId} HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /products/{productId}

请求参数

{
  "name": "string",
  "description": "string",
  "brand": "string",
  "modelNumber": "string",
  "iconUrl": "string",
  "status": "string"
}

参数说明

参数位置类型必需描述
productIdpathstringtruenone
bodybodyobjectfalsenone
» namebodystringfalse产品名称
» descriptionbodystringfalse产品描述
» brandbodystringfalse品牌
» modelNumberbodystringfalse型号
» iconUrlbodystringfalse产品展示图片。 图片地址从上传接口获取
» statusbodystringfalse产品状态。 开发中 - develop, 发布 - release

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringfalsenonenone
» namestringfalsenonenone
» productTemplateIdstringfalsenonenone
» projectIdstringfalsenonenone
» encryptionTypenumberfalsenonenone
» productTypenumberfalsenonenone
» netTypestringfalsenonenone
» dataProtocolnumberfalsenonenone
» descriptionstringfalsenonenone
» statusstringfalsenonenone
» firmwareIdstringfalsenonenone
» brandstringfalsenonenone
» modelNumberstringfalsenonenone
» iconUrlstringfalsenonenone
» createdTimestringfalsenonenone
» updatedTimestringfalsenonenone
» releasedTimestringfalsenonenone

 

删除产品

使用方式

DELETE /products/{productId} HTTP/1.1

Content-Type: text/plain
Accept: */*

DELETE /products/{productId}

请求参数

'{"type":"object","title":"empty object","properties":{}}'

参数说明

参数位置类型必需描述
productIdpathstringtruenone
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationstring

 

获取产品详情

使用方式

GET /products/{productId} HTTP/1.1

Content-Type: application/json
Accept: */*

GET /products/{productId}

请求参数

"string"

参数说明

参数位置类型必需描述
productIdpathstringtruenone
bodybodystring(binary)falsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringfalsenonenone
» namestringfalsenonenone
» productTemplateIdstringfalsenonenone
» projectIdstringfalsenonenone
» encryptionTypenumberfalsenonenone
» productTypenumberfalsenonenone
» netTypestringfalsenonenone
» dataProtocolnumberfalsenonenone
» firmwareIdstringfalsenonenone
» descriptionstringfalsenonenone
» statusstringfalsenonenone
» brandstringfalsenonenone
» modelNumberstringfalsenonenone
» iconUrlstringfalsenonenone
» createdTimestringfalsenonenone
» updatedTimestringfalsenonenone
» releasedTimestringfalsenonenone

 

获取产品列表

使用方式

GET /products/?orgIds=string HTTP/1.1

Content-Type: application/json
Accept: */*

GET /products/

请求参数

{}

参数说明

参数位置类型必需描述
projectIdsquerystringfalsenone
namequerystringfalsenone
statusquerystringfalsenone
$skipquerystringfalsenone
$topquerystringfalsenone
orgIdsquerystringtruenone
bodybodyobjectfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» productList[object]truenonenone
»» idstringtruenone产品ID
»» namestringfalsenone产品名称
»» projectIdstringfalsenone所属项目id
»» encryptionTypeintegerfalsenone加密类型 加密类型,1表示证书认证,2表示签名认证。
»» productTypeintegerfalsenone设备类型,0设备,5网关。
»» netTypestringfalsenone连接类型
»» dataProtocolintegerfalsenone数据协议 1 使用物模型 2 为自定义
»» firmwareIdstringfalsenonenone
»» descriptionstringfalsenone产品描述
»» statusstringfalsenone状态, 开发中 - develop, 发布 - release
»» brandstringfalsenonenone
»» modelNumberstringfalsenonenone
»» iconUrlstringfalsenonenone
»» productTemplateIdstringfalsenone品类方案
»» createdTimestringfalsenonenone
»» updatedTimestringfalsenonenone
»» releasedTimestringfalsenonenone
» countnumbertruenonenone

 

更新产品设备模型

使用方式

PUT /products/{productId}/deviceModel HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /products/{productId}/deviceModel

请求参数

{
  "deviceModel": "string"
}

参数说明

参数位置类型必需描述
productIdpathstringtruenone
bodybodyobjectfalsenone
» deviceModelbodystringtrue传入设备模型,用于描述设备模型的json字符串必须符合DTDL规范

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

获取产品设备模型

使用方式

GET /products/{productId}/deviceModel HTTP/1.1

Content-Type: text/plain
Accept: */*

GET /products/{productId}/deviceModel

请求参数

string

参数说明

参数位置类型必需描述
productIdpathstringtruenone
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» deviceModelstringtruenonenone

 

创建量产任务

使用方式

POST /products/{productId}/productions HTTP/1.1

Content-Type: application/json
Accept: */*

POST /products/{productId}/productions

请求参数

{
  "generationMethod": 0,
  "batchFile": "string",
  "batchCount": 0
}

参数说明

参数位置类型必需描述
productIdpathstringtruenone
bodybodyobjectfalsenone
» generationMethodbodyintegerfalse生成方式, 0 系统生成 1 文件上传
» batchFilebodystringfalse文件上传url, 生成方式为文件上传时填写
» batchCountbodyintegerfalse量产数量,生成方式为系统生成时填写

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringfalsenone量产任务ID
» batchCountnumbertruenone量产设备数量
» generationMethodnumbertruenone生成方式
» statusstringtruenone量产任务状态
» createdTimestringtruenonenone
» createdUserstringtruenonenone

 

获取量产数据列表

使用方式

GET /products/{productId}/productions HTTP/1.1

Content-Type: application/json
Accept: */*

GET /products/{productId}/productions

请求参数

"string"

参数说明

参数位置类型必需描述
productIdpathstringtruenone
$skipquerystringfalsenone
$topquerystringfalsenone
bodybodystring(binary)falsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» productionList[object]truenonenone
»» idstringfalsenonenone
»» productIdstringfalsenonenone
»» generationMethodnumberfalsenonenone
»» statusstringfalsenone量产任务状态
»» batchCountnumberfalsenone设备数量
»» createdTimestringfalsenonenone
»» createdUserstringfalsenone量产创建人
» countnumbertruenonenone

 

获取量产详情

使用方式

GET /products/{productId}/productions/{productionId} HTTP/1.1

Content-Type: application/json
Accept: */*

GET /products/{productId}/productions/{productionId}

请求参数

"string"

参数说明

参数位置类型必需描述
productIdpathstringtruenone
productionIdpathstringtruenone
bodybodystring(binary)falsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» batchCountintegerfalsenone量产设备数量
» generationMethodintegerfalsenone生成方式
» batchFilestringfalsenone上传文件url
» statusstringfalsenone量产任务状态
» createdTimestringfalsenone创建时间
» createUserstringfalsenone创建人

 

获取量产生成结果

使用方式

GET /products/{productId}/productions/{productionId}/result HTTP/1.1

Content-Type: application/json
Accept: */*

GET /products/{productId}/productions/{productionId}/result

请求参数

"string"

参数说明

参数位置类型必需描述
productIdpathstringtruenone
productionIdpathstringtruenone
bodybodystring(binary)falsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» data[object]truenonenone
»» productIdstringtruenonenone
»» deviceIdstringtruenonenone
»» deviceSecretstringtruenonenone
»» statusstringtruenonenone

上传下载

 

上传下载

上传下载公用接口

 

上传

使用方式

POST /uploads HTTP/1.1

Content-Type: multipart/form-data
Accept: */*

POST /uploads

请求参数

type: string
file: string

参数说明

参数位置类型必需描述
bodybodyobjecttruenone
» typebodystringtruenone
» filebodystring(binary)truenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» urlstringtruenonenone

 

分片上传文件

使用方式

POST /uploads/multiPart HTTP/1.1

Content-Type: multipart/form-data
Accept: */*

POST /uploads/multiPart

{"key":"hyy_test2","uploadId":"1658385568f7e393bdd30b2b0876984ec5a410e69acf68d8208620e4e3f90cd94929856f97","partNumber":"1","etag":""5a615c98f0069fa03c3253147b27628a""}

请求参数

key: string
uploadId: string
partNumber: string
file: string

参数说明

参数位置类型必需描述
bodybodyobjecttruenone
» keybodystringtruenone
» uploadIdbodystringtruenone
» partNumberbodystringtrue第几片文件
» filebodystring(binary)true文件块

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» keystringtruenonenone
» uploadIdstringtruenonenone
» partNumberstringtruenonenone
» etagstringtruenonenone

 

分片上传文件-初始化

使用方式

POST /uploads/initMultiPart HTTP/1.1

Content-Type: application/json
Accept: */*

POST /uploads/initMultiPart

{"key":"hyy_test2","uploadId":"1658385368d7e6febc590093211fc2229e9fec0e75d2ab260fc0575dfed5f563b89c3bc483"}

请求参数

{
  "key": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» keybodystringtrue上传文件标识

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» keystringtruenonenone
» uploadIdstringtruenonenone

 

分片上传文件-完成

使用方式

POST /uploads/completeMultiPart HTTP/1.1

Content-Type: multipart/form-data
Accept: */*

POST /uploads/completeMultiPart

{"fileUrl":"https://tisvc-test-1310070803.cos.ap-guangzhou.myqcloud.com/hyy_test3open in new window","fileSize":0,"fileSign":"","signMethod":"md5"}

请求参数

key: string
uploadId: string
etags: string

参数说明

参数位置类型必需描述
bodybodyobjecttruenone
» keybodystringtruenone
» uploadIdbodystringtruenone
» etagsbodystringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» fileUrlstringtruenonenone
» fileSizestringtruenonenone
» fileSignstringtruenonenone
» signMethodstringtruenonenone

 

获取上传文件临时授权

使用方式

GET /uploads/auth HTTP/1.1

Content-Type: text/plain
Accept: */*

GET /uploads/auth

请求参数

string

参数说明

参数位置类型必需描述
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» secretIdstringfalsenonesecretId
» secretKeystringfalsenonesecretkey
» sessionTokenstringfalsenonesessionToken
» expiredTimenumberfalsenone失效时间,UNIX 时间戳
» regionstringfalsenone区域
» bucketstringfalsenonebucket
» providerstringfalsenoneprovider

项目

 

项目

 

新建项目

使用方式

POST /projects HTTP/1.1

Content-Type: application/json
Accept: */*

POST /projects

请求参数

{
  "name": "string",
  "orgId": "string",
  "description": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» namebodystringtruenone
» orgIdbodystringtruenone
» descriptionbodystringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenonenone
» namestringtruenonenone
» orgIdstringtruenonenone
» descriptionstringtruenonenone
» createdTimestringtruenonenone
» updatedTimestringtruenonenone

 

获取项目列表

使用方式

GET /projects?orgId=string HTTP/1.1

Accept: */*

GET /projects

参数说明

参数位置类型必需描述
orgIdquerystringtrue根据组织获取项目
$skipquerystringfalse起始位置
$topquerystringfalse获取条数

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» projectList[object]truenonenone
»» idstringtruenonenone
»» namestringtruenonenone
»» orgIdstringtruenonenone
»» descriptionstringtruenonenone
»» createdTimestringtruenonenone
»» updatedTimestringtruenonenone
» countstringtruenonenone

 

删除项目

使用方式

DELETE /projects/{projectId} HTTP/1.1

Content-Type: application/json
Accept: */*

DELETE /projects/{projectId}

请求参数

{}

参数说明

参数位置类型必需描述
projectIdpathstringtruenone
bodybodyobjectfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

更新项目

使用方式

POST /projects/{projectId} HTTP/1.1

Content-Type: application/json
Accept: */*

POST /projects/{projectId}

请求参数

{
  "name": "string",
  "description": "string"
}

参数说明

参数位置类型必需描述
projectIdpathstringtruenone
bodybodyobjectfalsenone
» namebodystringfalsenone
» descriptionbodystringfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenonenone
» namestringtruenonenone
» orgIdstringtruenonenone
» descriptionstringtruenonenone
» createTimestringtruenonenone
» updateTimestringtruenonenone

 

获取项目

使用方式

GET /projects/{projectId} HTTP/1.1

Accept: */*

GET /projects/{projectId}

参数说明

参数位置类型必需描述
projectIdpathstringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenonenone
» namestringtruenonenone
» orgIdstringtruenonenone
» descriptionstringtruenonenone
» createTimestringtruenonenone
» updateTimestringtruenonenone

组织

 

组织

 

新建组织

使用方式

POST /orgs HTTP/1.1

Content-Type: application/json
Accept: */*

POST /orgs

请求参数

{
  "name": "string",
  "level": 0,
  "orgType": 0,
  "licenseType": "string",
  "license": "string",
  "code": "string",
  "contacts": "string",
  "phoneNumber": "string",
  "idType": "string",
  "idNumber": "string",
  "address": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» namebodystringtruenone
» levelbodynumberfalse组织登录,1为个人版(缺省),2为专业版,3为企业版
» orgTypebodynumbertrue组织类型,1 - 个人, 2 - 企业
» licenseTypebodystringfalse企业类型时必填, 企业的证照类型。可选项:营业执照 - BusinessLicense,其他 - Other
» licensebodystringfalse企业类型时必填,证照图片地址, 地址通过上传接口获取
» codebodystringfalse企业类型时必填, 企业的社会信用代码或者机构代码
» contactsbodystringtrue个人类型时为注册者本人, 企业类型时为企业的联系人
» phoneNumberbodystringtrue个人或者联系人电话
» idTypebodystringtrue个人或者联系人证件类型。 可选项: 身份证号 - ID,其他 - Others
» idNumberbodystringtrue个人或者联系人证件号码
» addressbodystringtrue通讯地址

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenonenone
» appIdstringtruenonenone
» namestringtruenonenone
» orgTypenumbertruenone组织类型,1 - 个人, 2 - 企业
» licenseTypestringfalsenone企业类型时必填, 企业的证照类型。可选项:营业执照,其他
» licensestringfalsenone企业类型时必填,证照图片地址, 地址通过上传接口获取
» codestringfalsenone企业类型时必填, 企业的社会信用代码或者机构代码
» contactsstringtruenone个人类型时为注册者本人, 企业类型时为企业的联系人
» phoneNumberstringtruenone个人或者联系人电话
» idTypestringtruenone个人或者联系人证件类型。 可选项: 身份证号,其他
» idNumberstringtruenone个人或者联系人证件号码
» addressstringtruenone通讯地址
» memberInfoobjecttruenone该组织的主账号
»» memberIdstringtruenonenone
»» appKeystringtruenonenone
»» appSecretstringtruenonenone
»» roles[string]truenone主账号权限范围

 

更新组织

使用方式

PUT /orgs/{orgId} HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /orgs/{orgId}

请求参数

{
  "name": "string",
  "level": 0,
  "orgType": 0,
  "licenseType": "string",
  "license": "string",
  "code": "string",
  "contacts": "string",
  "phoneNumber": "string",
  "idType": "string",
  "idNumber": "string",
  "address": "string"
}

参数说明

参数位置类型必需描述
orgIdpathstringtruenone
bodybodyobjectfalsenone
» namebodystringtrue组织名称
» levelbodynumberfalse组织登录,1为个人版(缺省),2为专业版,3为企业版
» orgTypebodynumbertrue组织类型,1 - 个人, 2 - 企业
» licenseTypebodystringfalse企业类型时必填, 企业的证照类型。可选项:营业执照,其他
» licensebodystringfalse企业类型时必填,证照图片地址, 地址通过上传接口获取
» codebodystringfalse企业类型时必填, 企业的社会信用代码或者机构代码
» contactsbodystringtrue个人类型时为注册者本人, 企业类型时为企业的联系人
» phoneNumberbodystringtrue个人或者联系人电话
» idTypebodystringtrue个人或者联系人证件类型。 可选项: 身份证号,其他
» idNumberbodystringtrue个人或者联系人证件号码
» addressbodystringtrue通讯地址

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenonenone
» appIdstringtruenonenone
» namestringtruenonenone
» levelnumbertruenone组织登录,1为个人版(缺省),2为专业版,3为企业版
» orgTypenumbertruenone组织类型,1 - 个人, 2 - 企业
» licenseTypestringfalsenone企业类型时必填, 企业的证照类型。可选项:营业执照,其他
» licensestringfalsenone企业类型时必填,证照图片地址, 地址通过上传接口获取
» codestringfalsenone企业类型时必填, 企业的社会信用代码或者机构代码
» contactsstringtruenone个人类型时为注册者本人, 企业类型时为企业的联系人
» phoneNumberstringtruenone个人或者联系人电话
» idTypestringtruenone个人或者联系人证件类型。 可选项: 身份证号,其他
» idNumberstringtruenone个人或者联系人证件号码
» addressstringtruenone通讯地址
» memberInfoobjecttruenone该组织的主账号
»» memberIdstringtruenonenone
»» appKeystringtruenonenone
»» appSecretstringtruenonenone
»» roles[string]truenone主账号权限范围

 

获取组织信息

使用方式

GET /orgs/{orgId} HTTP/1.1

Accept: */*

GET /orgs/{orgId}

参数说明

参数位置类型必需描述
orgIdpathstringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenonenone
» appIdstringtruenonenone
» namestringtruenonenone
» levelnumbertruenone组织登录,1为个人版(缺省),2为专业版,3为企业版
» orgTypenumbertruenone组织类型,1 - 个人, 2 - 企业
» licenseTypestringfalsenone企业类型时必填, 企业的证照类型。可选项:营业执照,其他
» licensestringfalsenone企业类型时必填,证照图片地址, 地址通过上传接口获取
» codestringfalsenone企业类型时必填, 企业的社会信用代码或者机构代码
» contactsstringtruenone个人类型时为注册者本人, 企业类型时为企业的联系人
» phoneNumberstringtruenone个人或者联系人电话
» idTypestringtruenone个人或者联系人证件类型。 可选项: 身份证号,其他
» idNumberstringtruenone个人或者联系人证件号码
» addressstringtruenone通讯地址
» memberInfoobjecttruenone该组织的主账号
»» memberIdstringtruenonenone
»» appKeystringtruenonenone
»» appSecretstringtruenonenone
»» roles[string]truenone主账号权限范围

 

添加成员

使用方式

POST /orgs/{orgId}/members HTTP/1.1

Content-Type: application/json
Accept: */*

POST /orgs/{orgId}/members

请求参数

{
  "userId": "string",
  "roles": [
    "string"
  ]
}

参数说明

参数位置类型必需描述
orgIdpathstringtruenone
bodybodyobjectfalsenone
» userIdbodystringtruenone
» rolesbody[string]true此成员在该组织的权限范围

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» memberIdstringtruenonenone
» roles[string]truenone此成员在该组织的权限范围
» appKeystringtruenone用于访问该组织所属数据
» appSecretstringtruenone用于访问该组织所属数据
» createdTimestringtruenone加入该组织时间

 

获取组织成员列表

使用方式

GET /orgs/{orgId}/members HTTP/1.1

Accept: */*

GET /orgs/{orgId}/members

参数说明

参数位置类型必需描述
orgIdpathstringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringtruenonenone
» namestringtruenonenone
» roles[string]truenonenone
» createdTimestringtruenonenone

 

移除成员

使用方式

DELETE /orgs/{orgId}/members/{memberId} HTTP/1.1

Accept: */*

DELETE /orgs/{orgId}/members/{memberId}

参数说明

参数位置类型必需描述
orgIdpathstringtruenone
memberIdpathstringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

更新成员

使用方式

PUT /orgs/{orgId}/members/{memberId} HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /orgs/{orgId}/members/{memberId}

请求参数

{
  "memberId": "string",
  "roles": [
    "string"
  ],
  "appKey": "string",
  "appSecret": "string",
  "createdTime": "string"
}

参数说明

参数位置类型必需描述
orgIdpathstringtruenone
memberIdpathstringtruenone
bodybodyobjectfalsenone
» memberIdbodystringtruenone
» rolesbody[string]true此成员在该组织的权限范围
» appKeybodystringtrue用于访问该组织所属数据
» appSecretbodystringtrue用于访问该组织所属数据
» createdTimebodystringtrue加入组织时间

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

获取成员信息

使用方式

GET /orgs/{orgId}/members/{memberId} HTTP/1.1

Accept: */*

GET /orgs/{orgId}/members/{memberId}

参数说明

参数位置类型必需描述
orgIdpathstringtruenone
memberIdpathstringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» memberIdstringtruenonenone
» roles[string]truenone此成员在该组织的权限范围
» appKeystringtruenone用于访问该组织所属数据
» appSecretstringtruenone用于访问该组织所属数据
» createdTimestringtruenone成员加入组织时间

固件版本

 

固件版本

固件版本

 

上传固件文件

使用方式

POST /firmware/{firmwareId}/file HTTP/1.1

Content-Type: multipart/form-data
Accept: */*

POST /firmware/{firmwareId}/file

请求参数

upgradeFile: string
productFile: string

参数说明

参数位置类型必需描述
firmwareIdpathstringtruenone
bodybodyobjecttruenone
» upgradeFilebodystring(binary)true升级固件文件
» productFilebodystring(binary)false生产固件文件

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» upgradeFirmwareFileobjectfalsenone升级文件信息
»» fileUrlstringfalsenone文件URL地址
»» fileSizenumberfalsenone文件大小
»» fileSignstringfalsenone文件签名
»» signMethodstringfalsenone文件签名方法
» productFirmwareFileobjectfalsenone生产文件信息
»» fileUrlstringfalsenone文件URL地址
»» fileSizenumberfalsenone文件大小
»» fileSignstringfalsenone文件签名
»» signMethodstringfalsenone文件签名方法

 

添加固件版本

使用方式

POST /firmware/{firmwareId}/versions HTTP/1.1

Content-Type: application/json
Accept: */*

POST /firmware/{firmwareId}/versions

请求参数

{
  "fileUrl": "string",
  "fileSize": 0,
  "fileSign": "string",
  "signMethod": "string",
  "productFileUrl": "string",
  "productFileSize": 0,
  "productFileSign": "string",
  "productSignMethod": "string",
  "status": 0,
  "version": "string",
  "description": "string"
}

参数说明

参数位置类型必需描述
firmwareIdpathstringtrue固件ID
bodybodyobjectfalsenone
» fileUrlbodystringtrue升级固件文件地址
» fileSizebodynumbertrue升级固件文件大小,单位字节
» fileSignbodystringtrue升级固件签名
» signMethodbodystringtrue升级签名算法, md5
» productFileUrlbodystringfalse生产固件文件地址
» productFileSizebodynumberfalse生产固件文件大小,单位字节
» productFileSignbodystringfalse生产固件签名
» productSignMethodbodystringfalse生产签名算法, md5
» statusbodynumberfalse状态,1为正常可用,2为不可用
» versionbodystringtrue固件版本号
» descriptionbodystringfalse版本描述

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringtruenone固件版本ID
» firmwareIdstringtruenone固件ID
» fileUrlstringtruenone升级固件文件地址
» fileSizenumbertruenone升级固件文件大小
» fileSignstringtruenone升级固件签名
» signMethodstringtruenone升级签名算法, md5
» productFileUrlstringfalsenone生产固件文件地址
» productFileSizenumberfalsenone生产固件文件大小
» productFileSignstringfalsenone生产固件签名
» productSignMethodstringfalsenone生产签名算法, md5
» statusnumbertruenone状态,1为正常可用,2为不可用
» versionstringtruenone固件版本号
» descriptionstringtruenone版本描述

 

获取固件版本列表

使用方式

GET /firmware/{firmwareId}/versions HTTP/1.1

Content-Type: text/plain
Accept: */*

GET /firmware/{firmwareId}/versions

总页数

请求参数

""

参数说明

参数位置类型必需描述
firmwareIdpathstringtruenone
$skipquerystringfalsenone
$topquerystringfalsenone
bodybodystring(binary)falseraw paramter

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» firmwareVersionList[object]truenonenone
»» idstringtruenone固件版本ID
»» firmwareIdstringtruenone固件ID
»» fileUrlstringtruenone固件文件地址
»» fileSizenumbertruenone固件文件大小
»» fileSignstringtruenone固件签名
»» signMethodstringtruenone签名算法
»» productFileUrlstringtruenone生产固件文件地址
»» productFileSizenumbertruenone生产固件文件大小
»» productFileSignstringtruenone生产固件签名
»» productSignMethodstringtruenone生产签名算法
»» statusnumbertruenone状态,1为正常可用,2为不可用
»» versionstringtruenone固件版本号
»» descriptionstringtruenone版本描述
» countnumbertruenonenone

枚举值

属性取值
signMethodmd5

 

删除固件版本

使用方式

DELETE /firmware/{firmwareId}/versions/{versionId} HTTP/1.1

Accept: */*

DELETE /firmware/{firmwareId}/versions/{versionId}

参数说明

参数位置类型必需描述
firmwareIdpathstringtrue固件ID
versionIdpathstringtrue固件版本ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationstring

 

更新固件版本

使用方式

PUT /firmware/{firmwareId}/versions/{versionId} HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /firmware/{firmwareId}/versions/{versionId}

请求参数

{
  "fileUrl": "string",
  "fileSize": 0,
  "sign": "string",
  "signMethod": "string",
  "productFileUrl": "string",
  "productFileSize": "string",
  "productFileSign": "string",
  "productSignMethod": "string",
  "status": "string",
  "version": "string",
  "description": "string"
}

参数说明

参数位置类型必需描述
firmwareIdpathstringtrue固件ID
versionIdpathstringtrue固件版本ID
bodybodyobjectfalsenone
» fileUrlbodystringfalse升级固件文件地址
» fileSizebodynumberfalse升级固件文件大小
» signbodystringfalse升级固件签名
» signMethodbodystringfalse升级签名算法, md5
» productFileUrlbodystringfalse生产固件文件地址
» productFileSizebodystringfalse生产固件文件大小
» productFileSignbodystringfalse生产固件文件签名
» productSignMethodbodystringfalse生产签名算法
» statusbodystringfalse状态,1为正常可用,2为不可用
» versionbodystringfalse固件版本号
» descriptionbodystringfalse版本描述

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringtruenone固件版本ID
» firmwareIdstringtruenone固件ID
» fileUrlstringtruenone升级固件文件地址
» fileSizenumbertruenone升级固件文件大小
» signstringtruenone升级固件签名
» signMethodstringtruenone升级固件签名算法, md5
» productFileUrlstringtruenone生产固件文件地址
» productFileSizestringtruenone生产固件文件大小
» productFileSignstringtruenone生产固件签名
» productSignMethodstringtruenone生产固件签名算法, md5
» versionstringtruenone固件版本号
» descriptionstringtruenone版本描述

 

获取固件版本详情

使用方式

GET /firmware/{firmwareId}/versions/{versionId} HTTP/1.1

Accept: */*

GET /firmware/{firmwareId}/versions/{versionId}

参数说明

参数位置类型必需描述
firmwareIdpathstringtrue固件ID
versionIdpathstringtrue固件版本ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» idstringtruenone固件版本ID
» firmwareIdstringtruenone固件ID
» fileUrlstringtruenone升级固件文件地址
» fileSizenumbertruenone升级固件文件大小
» signstringtruenone升级固件签名
» signMethodstringtruenone升级固件签名算法, md5
» productFileUrlstringtruenone生产固件文件地址
» productFileSizenumbertruenone生产固件文件大小
» productFileSignstringtruenone生产固件签名
» productSignMethodstringtruenone生产固件签名算法, md5
» statusnumbertruenone状态,1为正常可用,2为不可用
» versionstringtruenone固件版本号
» descriptionstringtruenone版本描述

固件的升级任务

 

固件的升级任务

固件升级接口

 

添加固件升级任务

使用方式

POST /ota/updates HTTP/1.1

Content-Type: application/json
Accept: */*

POST /ota/updates

请求参数

{
  "products": [
    "string"
  ],
  "targetVersion": "string",
  "sourceVersions": [
    "string"
  ],
  "upgradeScope": 0,
  "deviceListId": "string",
  "greyCount": 0,
  "upgradeMode": 0,
  "description": "string",
  "firmwareId": "string",
  "status": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» productsbody[string]true产品ID列表
» targetVersionbodystringtrue目标版本
» sourceVersionsbody[string]true待升级版本列表
» upgradeScopebodynumbertrue升级范围, all 1/test 2/package 3/gray 4
» deviceListIdbodystringfalse自主上传设备包ID(暂时不做)
» greyCountbodynumberfalse灰度升级的数量
» upgradeModebodynumbertrue升级方式, force 1/hint 2
» descriptionbodystringtrue更新说明
» firmwareIdbodystringtrue固件ID
» statusbodystringtrue升级任务状态

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenone升级任务ID
» organizationIdstringtruenone组织ID
» firmwareIdstringtruenone固件ID
» statusnumbertruenone升级任务状态
» products[string]truenone产品ID列表
» targetVersionstringtruenone目标版本
» sourceVersions[string]truenone待升级版本列表
» upgradeScopenumbertruenone升级范围, all 1/test 2/package 3/gray 4
» upgradeModenumbertruenone升级方式, force 1/hint 2
» descriptionstringtruenone更新说明
» createUserIdstringfalsenone创建用户ID
» createUserNamestringfalsenone创建用户名称
» updateUserIdstringfalsenone更新用户ID
» updateUserNamestringfalsenone更新用户名称
» createdTimestringtruenone创建时间
» updatedTimestringtruenone更新时间

 

查看固件升级任务列表

使用方式

GET /ota/updates?%24skip=string&%24top=string&orgId=string&firmwareIds=string HTTP/1.1

Accept: */*

GET /ota/updates

参数说明

参数位置类型必需描述
$skipquerystringtruenone
$topquerystringtruenone
orgIdquerystringtrue组织ID
firmwareIdsquerystringtrue固件ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» upgradeTaskList[object]falsenonenone
»» idstringfalsenone升级任务ID
»» organizationIdstringfalsenone组织ID
»» firmwareIdstringfalsenone固件ID
»» statusnumberfalsenone升级任务状态
»» products[string]falsenone产品ID列表
»» targetVersionstringfalsenone目标版本
»» sourceVersions[string]falsenone待升级版本列表
»» upgradeScopenumberfalsenone升级范围, all/test/package
»» upgradeModenumberfalsenone升级方式, force/hint
»» descriptionstringfalsenone更新说明
»» createUserIdstringfalsenone更新说明
»» createUserNamestringfalsenone更新说明
»» updateUserIdstringfalsenone更新说明
»» updateUserNamestringfalsenone更新说明
»» createdTimestringfalsenone更新说明
»» updatedTimestringfalsenone更新说明
» countnumbertruenonenone

 

删除固件升级任务

使用方式

DELETE /ota/updates/{updateId} HTTP/1.1

Content-Type: application/json
Accept: */*

DELETE /ota/updates/{updateId}

请求参数

{}

参数说明

参数位置类型必需描述
updateIdpathstringtruenone
bodybodyobjectfalsenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription

 

更新固件升级任务信息

使用方式

PUT /ota/updates/{updateId} HTTP/1.1

Content-Type: application/json
Accept: */*

PUT /ota/updates/{updateId}

请求参数

{
  "products": [
    "string"
  ],
  "targetVersion": "string",
  "sourceVersions": [
    "string"
  ],
  "upgradeScope": 0,
  "devicePackageId": "string",
  "upgradeMode": 0,
  "description": "string",
  "firmwareId": "string"
}

参数说明

参数位置类型必需描述
updateIdpathstringtruenone
bodybodyobjectfalsenone
» productsbody[string]false产品ID列表
» targetVersionbodystringfalse目标版本
» sourceVersionsbody[string]false待升级版本列表
» upgradeScopebodynumberfalse升级范围, all 1/test 2/package 3/gray 4
» devicePackageIdbodystringfalse自主上传设备包ID
» upgradeModebodynumberfalse升级方式, force/hint
» descriptionbodystringfalse更新说明
» firmwareIdbodystringfalse固件ID

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenone升级任务ID
» organizationIdstringtruenone组织ID
» firmwareIdstringtruenone固件ID
» statusnumbertruenone升级任务状态
» products[string]truenone产品ID列表
» targetVersionstringtruenone目标版本
» sourceVersions[string]truenone待升级版本列表
» upgradeScopenumbertruenone升级范围, all 1/test 2/package 3/gray 4
» upgradeModenumbertruenone升级方式, force/hint
» descriptionstringtruenone更新说明
» createUserIdstringfalsenone创建用户ID
» createUserNamestringfalsenone创建用户名称
» updateUserIdstringfalsenone更新用户ID
» updateUserNamestringfalsenone更新用户名称
» createdTimestringtruenone创建时间
» updatedTimestringtruenone更新时间

 

查看固件升级信息

使用方式

GET /ota/updates/{updateId} HTTP/1.1

Accept: */*

GET /ota/updates/{updateId}

参数说明

参数位置类型必需描述
updateIdpathstringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» idstringtruenone升级任务ID
» organizationIdstringtruenone组织ID
» firmwareIdstringtruenone固件ID
» statusnumbertruenone升级任务状态
» products[string]truenone产品ID列表
» targetVersionstringtruenone目标版本
» sourceVersions[string]truenone待升级版本列表
» upgradeScopenumbertruenone升级范围, all 1/test 2/package 3/gray 4
» upgradeModenumbertruenone升级方式, force/hint
» descriptionstringtruenone更新说明
» createUserIdstringfalsenone创建用户ID
» createUserNamestringfalsenone创建用户名称
» updateUserIdstringfalsenone更新用户ID
» updateUserNamestringfalsenone更新用户名称
» createdTimestringtruenone创建时间
» updatedTimestringtruenone更新时间

 

获得可升级固件信息

使用方式

GET /ota/checkUpdate?productId=string&deviceId=string&currentVersion=string HTTP/1.1

Accept: */*

GET /ota/checkUpdate

参数说明

参数位置类型必需描述
productIdquerystringtruenone
deviceIdquerystringtruenone
currentVersionquerystringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» targetVersionstringfalsenonenone
» fileUrlstringfalsenonenone
» fileSizestringfalsenonenone
» signstringfalsenonenone
» signMethodstringfalsenonenone
» versionDescriptionstringfalsenonenone

 

升级结果上报

使用方式

POST /ota/upgradeResult HTTP/1.1

Content-Type: application/json
Accept: */*

POST /ota/upgradeResult

请求参数

{
  "taskId": "string",
  "productId": "string",
  "deviceId": "string",
  "firmwareId": "string",
  "sourceVersion": "string",
  "targetVersion": "string",
  "status": 0,
  "processRatio": "string"
}

参数说明

参数位置类型必需描述
bodybodyobjectfalsenone
» taskIdbodystringfalse升级任务ID
» productIdbodystringtrue产品ID
» deviceIdbodystringtrue设备ID
» firmwareIdbodystringfalse固件ID
» sourceVersionbodystringtrue升级后固件版本ID
» targetVersionbodystringfalse升级前固件版本ID
» statusbodynumbertrue固件升级结果,1-检测升级、2-升级中、3-升级成功、4-升级失败
» processRatiobodystringfalse当status为2时,需要有此字段上报升级进度百分比,值为0-100

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationstring

 

上传设备包(暂不实现)

使用方式

POST /ota/updates/{updateId}/devicePackage?file=string HTTP/1.1

Accept: */*

POST /ota/updates/{updateId}/devicePackage

参数说明

参数位置类型必需描述
updateIdpathstringtruenone
filequerystringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
» devicePackageIdstringtruenonenone

 

查看固件升级统计数据

使用方式

GET /ota/updates/{updateId}/stats HTTP/1.1

Accept: */*

GET /ota/updates/{updateId}/stats

参数说明

参数位置类型必需描述
updateIdpathstringtruenone

响应结果示例

200 Response

响应状态

状态含义描述Schema
200OKopen in new windowsuccessful operationInline

Response Schema

Status Code 200

empty object

NameTypeRequiredRestrictionsDescription
上次编辑于: 2022/12/17 07:45:59
Loading...