Overview
The account management interface can help you operate and query the account information in the system through interface docking. By adding the corresponding request parameters to the request according to the interface instructions, the system will return the processing results after the call. The request and response are encoded using the UTF-8 character set.
API | Description |
---|---|
v2/operator/createOperator | Create operator |
v2/operator/createMultipleOperator | Batch create operators |
v2/operator/updateOperator | Update operator |
v2/operator/queryOperatorDetail | Query details of operator |
v2/operator/queryOperatorList | Query operators |
v2/operator/assignOperator2Project | Assign DCP permissions to operator |
v2/operator/operatorPermissionList | Get the collection of permissions for the specified project operator |
-
Create Operator
POST v2/operator/createOperator
Create operator. The interface has idempotent property, which is determined by the field of requestNo. If the field of requestNo is different, it will be treated as a new request. When orderStatus is FAILURE, developers need to add compensation mechanism. When the orderStatus is SUCCESS, you need to use the toolchainOperatorUUID in the returned result to call query details of operator interface. The status field in the operator details determines whether the call is successful. When the status field is "enable", it indicates that the call is successful. Otherwise, the call fails, and a compensation mechanism needs to be added.
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
requestNo | string | Y | request number, length is no more than 50, only letters and numbers are allowed |
account | string | Y | login account |
name | string | Y | name |
string | Y | ||
address | string | N | address |
telNo | string | N | phone number |
Request Example
{
"requestNo": "2021060800001",
"account": "accountforapi001",
"name": "namei2g2941cen-chen",
"address": "",
"email": "charlie.liu@vechain.com",
"telNo": ""
}
Response Example
{
"code": "common.success",
"data": {
"orderStatus": "SUCCESS",
"toolchainOperatorUUID": "0x58d8cb921885331129393e0ab1897163712c701f0dccb14b43539ebeaeb0c204",
"account": "accountforapi001"
}
}
Response Parameters
Name | Type | Description |
---|---|---|
toolchainOperatorUUID | string | operator ID |
account | string | login account |
orderStatus | string | request status(INIT,PROCESSING,SUCCESS,FAILURE), for more details, please refer to here |
-
Batch create operators
POST v2/operator/createMultipleOperator
Batch create operators.The interface has idempotent property, which is determined by the field of requestNo. If the field of requestNo is different, it will be treated as a new request. When orderStatus is FAILURE, developers need to add compensation mechanism. When the orderstatus is SUCCESS, the operator in the failure list needs to add a compensation mechanism according to the information of errorinfo. The operator in the success list calls query details of operator interface according to the toolchain operator UUID, and the status field in the operator details determines whether the operator has created successfully, When the status field is "enable", it indicates that the creation of the operator is successful. Otherwise, the creation fails, and a compensation mechanism needs to be added.
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
requestNo | string | Y | request number, length is no more than 50, only letters and numbers are allowed |
+ operatorList | array (CreateOperatorRequestInfo) | Y | collection of operators to be created |
└ account | string | Y | login account |
└ name | string | Y | operator name |
string | Y | ||
└ address | string | N | address |
└ telNo | string | N | phone number |
Request Example
{
"operatorList": [
{
"account": "accountforMultipleOperator001",
"name": "name2021060801",
"address": "",
"email": "charlie.liu@vechain.com",
"telNo": ""
},
{
"account": "accountforMultipleOperator002",
"name": "name2021060801",
"address": "",
"email": "charlie.liu01@vechain.com",
"telNo": ""
}
],
"requestNo": "20210608000001"
}
Response Example
{
"code": "common.success",
"data": {
"failureList": [],
"successList": [
{
"toolchainOperatorUUID": "0x9aa1cdd296864abc3337f62504c5215b9ad6bf3c29bbfbf316d98c3e574434ea",
"account": "accountforMultipleOperator001"
},
{
"toolchainOperatorUUID": "0x08bb7f8d28295c962178ee9f8ca22a0b589c37baffd2ba22263e21a40bba3f03",
"account": "accountforMultipleOperator002"
}
],
"orderStatus": "SUCCESS"
}
}
Response Parameters
Name | Type | Description |
---|---|---|
data.failureList |
array (CreateOperatorResponseInfo) |
collection of failed operators |
+data.successList |
array (CreateOperatorResponseInfo) |
collection of successful operators |
└ toolchainOperatorUUID | string | operator ID |
└ account | string | login account |
└ errorInfo | string | error information |
orderStatus | string | request status (INIT,PROCESSING,SUCCESS,FAILURE), for more details, please refer to here |
-
Update Operator
POST v2/operator/updateOperator
update the information of operator.
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
account | string | Y | login account |
+ changeDataInfo | object | Y | project change information |
└ accountStatus | string | Y | status(ENABLE,DISABLE) |
string | Y | ||
└ address | string | N | address |
└ name | string | N | name |
└ telNo | string | N | phone number |
Request Example
{
"account": "testoperator-charlie",
"changeDataInfo":
{
"accountStatus": "ENABLE",
"address": "xxx",
"email": "charlie022@163.COM",
"name": "123",
"telNo": "18611117555"
}
}
Response Example
{
"code": "common.success",
"data": {
"orderStatus": "SUCCESS",
"account": "testoperator-charlie"
}
}
Response Parameters
Name | Type | Description |
---|---|---|
orderStatus | string | request status (INIT,PROCESSING,SUCCESS,FAILURE), for more details, please refer to here. |
account | string | login account |
-
Query details of operator
POST v2/operator/queryOperatorDetail
Query details of operator.
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
account | string | Y | login account |
Request Example
{
"account": "testruozin"
}
Response Example
{
"code": "common.success",
"data": {
"address": "",
"createTime": 1619599860016,
"name": "ruoxin",
"updateTime": 1619599960144,
"toolchainOperatorUUID": "0x5103e672f25751d69ea78de14a8cd0fd151218c51fb01059a6d9c691a4a547d3",
"account": "testruozin",
"telNo": "CN+86-18293443556",
"email": "ruoxin.zhang@vechain.com",
"status": "ENABLE"
}
}
Response Parameters
Name | Type | Description |
---|---|---|
address | string | address |
createTime | long | create time |
upadteTime | long | update time |
name | string | name |
toolchainOperatorUUID | string | operator ID |
account | string | login account |
telNo | string | phone number |
string | ||
status | string | status(ENABLE,DISABLE) |
-
Query operators
POST v2/operator/queryOperatorList
Query operators, support pagination query and fuzzy query of operator name.
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
page | int | Y | page number, ex: page 3 |
size | int | Y | row number displayed per page, up to 100 |
startTime | long | N | filter the start time of operator based on the UTC time (accurate to milliseconds) of the create time |
endTime | long | N | filter the end time of operator based on the UTC time (accurate to milliseconds) of the create time |
operatorNameKeyword | string | N | keyword of operator name |
toolchainOperatorUUID | string | N | operator ID, please refer to here |
Request Example
{
"operatorNameKeyword": "",
"page": 1,
"size": 5,
"toolchainOperatorUUID": ""
}
Response Example
{
"code": "common.success",
"data": {
"exist": true,
"size": 5,
"page": 1,
"rows": 19,
"list": [
{
"address": "",
"createTime": 1622108070020,
"name": "zhangsan",
"updateTime": 1622110414480,
"toolchainOperatorUUID": "0xeadfff9b09963aff0d863982bdf54a0920c7e1bfef0e0b0729eff4a7b1698949",
"account": "zhangsan",
"telNo": "",
"email": "",
"status": "ENABLE"
},
{
"address": "",
"createTime": 1622001000030,
"name": "worker1",
"updateTime": 1622001200143,
"toolchainOperatorUUID": "0xbdb11f137b74a0710d0f015fe1fffed1be4c4190fad1da3ea7f21e605e643f8b",
"account": "centralkitchen",
"telNo": "",
"email": "",
"status": "ENABLE"
},
{
"address": "",
"createTime": 1621309480173,
"name": "namei2g2941cen-chen06",
"updateTime": 1621309590172,
"toolchainOperatorUUID": "0xa6edde4922fbf5f800f18a8d52799e80d7d33deb6d8db70afaaa8ef976c18dbc",
"account": "accountforapi06",
"telNo": "",
"email": "",
"status": "ENABLE"
},
{
"address": "",
"createTime": 1620985600165,
"name": "name2021042504",
"updateTime": 1620985700186,
"toolchainOperatorUUID": "0x95802a62e5ecac57c850b15bcedf79f2f554e7749816d5316fda83b70cbcafa3",
"account": "createMultipleOperator08",
"telNo": "",
"email": "",
"status": "ENABLE"
},
{
"address": "",
"createTime": 1620985580020,
"name": "name2021042503",
"updateTime": 1620985700040,
"toolchainOperatorUUID": "0x6d8188ef84be3c89b5b6ada4f5305f4ee07ecf95ff06fdd4fafb30e341f61bd5",
"account": "createMultipleOperator07",
"telNo": "",
"email": "",
"status": "ENABLE"
}
]
}
}
Response Parameters
Name | Type | Description |
---|---|---|
exist | boolean | if data exist |
size | int | row number displayed per page |
page | int | page number |
rows | int | total rows |
+ data.list |
array( AccountInfo) |
collection of operator information |
└ address | string | address |
└ createTime | int | create time |
└ upadteTime | int | update time |
└ name | string | name |
└ toolchainOperatorUUID | string | operator ID |
└ account | string | login account |
└ telNo | string | phone number |
string | ||
└ status | string | status(ENABLE,DISABLE) |
-
Assign DCP permissions to operator
POST v2/operator/assignOperator2Project
Assign DCP permissions to operator.
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
requestNo | string | Y | request number, length is no more than 50, only letters and numbers are allowed |
projectUUID | string | Y | project ID, please refer to here |
toolchainOperatorUUID | string | Y | operator ID, please refer to here |
+ permissionPairDcpList | array (PermissionDcpPair) | Y | collection of DCP permissions |
└ dcpInstanceUUID | string | Y | If you need to set permissions for all DCP permissions, use *, otherwise use single DCP instance UUID, please refer to here |
└ dcpPermission | string [] | Y | DCP permission given to operator(VIEWPERMISSION,OPERATEPERMISSION,FULLPERMISSION) |
Request Example
{
"permissionPairDcpList": [
{
"dcpInstanceUUID": "10000700-5d4b-48ef-9e5b-2f3301200000",
"dcpPermission": ["VIEWPERMISSION","OPERATEPERMISSION"]
}
],
"projectUUID": "156DA623-574B-5B40-C9B0-C32944400001",
"requestNo": "assignOperator2Project202104250003",
"toolchainOperatorUUID": "0x2cdbcc10a1376a72ad10ae046773e8ec0b1d38e1d1671c1804dcfc82715b8b53"
}
Response Example
{
"code": "common.success",
"data": {
"orderStatus": "SUCCESS"
}
}
Response Parameters
Name | Type | Description |
---|---|---|
orderStatus | string | request status(INIT,PROCESSING,SUCCESS,FAILURE), for more details, please refer to here |
-
Get operator permission List
POST v2/operator/operatorPermissionList
Get the collection of permissions for the specified project operator。
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
projectUUID | string | Y | project ID, please refer to here |
toolchainOperatorUUID | string | Y | operator ID, please refer to here |
Request Example
{
"projectUUID": "1561A2AD-F1CD-CCBF-F201-5D6D0A400001",
"toolchainOperatorUUID": "0x90353a3bd479dce99aac59b61122a49a5cb5a7d84fcb3c92a76b407848e19e7b"
}
Response Example
{
"code": "common.success",
"data": {
"toolchainOperatorUUID": "0x90353a3bd479dce99aac59b61122a49a5cb5a7d84fcb3c92a76b407848e19e7b",
"permissionPairDcpList": [
{
"dcpInstanceUUID": "10000700-5be4-44f6-aa2e-034801200002",
"dcpPermission": [
"OPERATEPERMISSION"
]
}
],
"projectUUID": "1561A2AD-F1CD-CCBF-F201-5D6D0A400001"
}
}
Response Parameters
Name | Type | Description |
---|---|---|
projectUUID | string | project ID |
+ permissionPairDcpList | array (PermissionDcpPair) | collection of DCP permissions |
└ dcpInstanceUUID | string | DCP UUID, please refer to here |
└ dcpPermission | string [] | DCP permission given to operator(VIEWPERMISSION,OPERATEPERMISSION,FULLPERMISSION) |
Comments
0 comments
Please sign in to leave a comment.