- Product
- Category
- _User
- _Installation
- Evidence
- Rule
- Device
- _Role
- License
- View
- Crond
- ProductTemplet
- Channel
- LogLevel
- Wechat
- Instruct
- App
- METER
- Gb26875
- System
- Log
- Project
- Group
- Data
- Notification
- TOPO
- _Session
- Menu
- Maintenance
- Timescale
- Permission
- Dict
- Decoder
- OPC
- Devicelog
- aliyun
- FFMPEG
- Article
- Basic
- Dlink
- BACnet
- UniApp
创建关联
正式环境
https://prod.iotn2n.com
正式环境
https://prod.iotn2n.com
POST
/iotapi/relation
Data
请求参数
Body 参数application/json
destClass
string
目标类名
示例值:
_Role
destField
string
目标关联字段
示例值:
users
destId
string
目标类对象
示例值:
0w66Wg1thM
srcClass
string
源类名
示例值:
_User
srcId
string
源类对象
示例值:
hXc9BkGCOD
示例
{
"destClass": "_Role",
"destField": "users",
"destId": "0w66Wg1thM",
"srcClass": "_User",
"srcId": "hXc9BkGCOD"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://prod.iotn2n.com/iotapi/relation' \
--header 'Content-Type: application/json' \
--data-raw '{
"destClass": "_Role",
"destField": "users",
"destId": "0w66Wg1thM",
"srcClass": "_User",
"srcId": "hXc9BkGCOD"
}'
返回响应
🟢201Returns success
application/json
Body
object {0}
示例
{}
🟠400Bad Request
🟠403Forbidden
🔴500Server Internal error