# 创建合同
# 调用方式: POST
# 接口地址:
https://api.freelog.com/v2/contracts
1
# body传入参数说明:
参数 | 必选 | 类型及范围 | 说明 |
---|---|---|---|
subjectId | 必选 | string | 标的物ID |
subjectType | 必选 | int | 标的物类型 1:资源 2:展品 3:用户组 |
policyId | 必选 | string | 策略ID |
licenseeId | 必选 | string | 乙方ID |
licenseeIdentityType | 必选 | int | 乙方身份类型 1:资源方 2:节点方 3:C端用户 |
# body示例
{
"subjectId":"5ee3288b32f1a8439c207aa2",
"subjectType":1,
"policyId":"8cefe2f1dcc6dd0bdaadac946cb63dbc",
"licenseeIdentityType":1,
"licenseeId":"5ef081b8fb172026e434e2fa"
}
1
2
3
4
5
6
7
2
3
4
5
6
7
# 返回说明:
返回值字段 | 字段类型 | 字段说明 |
---|---|---|
contractId | string | 合同ID |
contractName | string | 合同名称 |
subjectId | string | 标的物ID |
subjectName | string | 标的物名称 |
subjectType | int | 标的物类型 |
licensorId | string | 甲方ID |
licensorName | string | 甲方名称 |
licensorOwnerId | int | 甲方所属用户ID |
licensorOwnerName | string | 甲方所属用户名称 |
licenseeId | string | 乙方ID |
licenseeName | string | 乙方名称 |
licenseeOwnerId | int | 乙方所属用户ID |
licenseeOwnerName | string | 乙方所属用户名称 |
licenseeIdentityType | int | 乙方用户类型 |
policyId | string | 策略ID |
isDefault | int | 是否是默认执行合同 |
fsmCurrentState | string | 当前状态机状态名称 |
fsmRunningStatus | int | 状态机运行状态 1:未初始化 2:系统锁定状态 4:生效中(已初始化,未终止) 8:已终止 |
authStatus | int | 合同授权状态 1:正式授权 2:测试授权 128:未获得授权 |
status | int | 合同综合状态: 0:正常 1:已终止(不接受任何事件,也不给授权,事实上无效的合约) 2:异常 |
createDate | date | 创建日期 |
# 返回示例
{
"ret": 0,
"errcode": 0,
"msg": "success",
"data": {
"contractId": "5f27c128ef6d891ee8936901",
"contractName": "免费策略",
"licensorId": "5ee3288b32f1a8439c207aa2",
"licensorName": "yuliang/my-first-resource",
"licensorOwnerId": 50021,
"licensorOwnerName": "yuliang",
"licenseeId": "5ef081b8fb172026e434e2fa",
"licenseeName": "yuliang/my-first-resource4",
"licenseeOwnerId": 50021,
"licenseeOwnerName": "yuliang",
"licenseeIdentityType": 1,
"subjectId": "5ee3288b32f1a8439c207aa2",
"subjectName": "yuliang/my-first-resource",
"subjectType": 1,
"policyId": "8cefe2f1dcc6dd0bdaadac946cb63dbc",
"fsmCurrentState": "",
"fsmRunningStatus": 1,
"authStatus": 8,
"status": 0,
"createDate": "2020-08-03T07:47:52.343Z",
"updateDate": "2020-08-03T07:47:52.357Z",
"isDefault": false,
"isAuth": false,
"isTestAuth": false,
"isPending": true
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32