获取展品授权信息 (响应类型:授权结果/展品信息/资源信息/文件流)
调用方式: GET
接口地址:
url1: https://api.freelog.com/v2/auths/presentables/{presentableId}/{result|info|resourceInfo|fileStream}
url2: https://api.freelog.com/v2/auths/presentables/nodes/{nodeId}/{resourceIdOrName}/{result|info|resourceInfo|fileStream}
1
2
url1传入参数说明:
| 参数 | 必选 | 类型及范围 | 说明 |
| presentableId | 必选 | string | 展品Id |
| parentNid | 可选 | string | 依赖树上的父级节点ID,一般获取展品子依赖需要传递 |
| subResourceIdOrName | 可选 | string | 子依赖的资源ID或者名称 |
| subResourceFile | 可选 | string | 主题或插件的压缩包内部子资源,需要带相对路径 |
url2传入参数说明:(resourceId,resourceName,presentableName必选其一)
| 参数 | 必选 | 类型及范围 | 说明 |
| nodeId | 必选 | int | 节点ID |
| resourceIdOrName | 必选 | string | 资源ID或者名称,需要encodeURIComponent编码 |
| parentNid | 可选 | string | 依赖树上的父级节点ID,一般获取展品子依赖需要传递 |
| subResourceIdOrName | 可选 | string | 子依赖的资源ID或者名称 |
| subResourceFile | 可选 | string | 主题或插件的压缩包内部子资源,需要带相对路径 |
| 返回值字段 | 字段类型 | 字段说明 |
| freelog-entity-nid | string | 当前响应的展品的依赖树链路ID |
| freelog-presentable-id | string | 展品ID |
| freelog-presentable-name | string | 展品名称,encodeURIComponent编码 |
| freelog-sub-dependencies | string | 当前展品的子依赖,encodeURIComponent编码的json字符串 |
| freelog-resource-type | string | 资源类型 |
| freelog-resource-property | string | 资源meta信息,encodeURIComponent编码过的json字符串 |
response-type: result (标准授权响应结果)
| 返回值字段 | 字段类型 | 字段说明 |
| subjectType | int | 标的物类型 |
| referee | int | 标的物服务类型ID |
| defaulterIdentityType | int | 授权不通过责任方(1:资源 2:节点 4:消费者 128:未知). 多个违约方会通过|运算符计算,注意区分 |
| authCode | int | 授权码 |
| isAuth | bool | 是否授权通过 |
| data | object | 附加数据,例如授权失败的资源 |
| errorMsg | string | 授权错误提示 |
response-type: info (展品信息)
| 返回值字段 | 字段类型 | 字段说明 |
| presentableId | string | 展示方案ID |
| presentableName | string | 展示方案名称,节点内唯一 |
| presentableTitle | string | 展示方案标题,用于展示 |
| tags | string[] | 用户定义的tags |
| intro | string | presentable简介 |
| onlineStatus | int | 上线状态 0:下线 1:上线 |
| userId | int | 创建方案的用户ID |
| nodeId | int | 节点ID |
| resolveResources | object[] | 资源以及其上抛的解决方式 |
| ** resourceId | string | 解决的资源ID |
| ** resourceName | string | 解决的资源名称 |
| ** contracts | object[] | 解决的资源的策略 |
| **** policyId | string | 选中的策略ID |
| **** contractId | string | 策略生成的合约ID |
| policies | object[] | 对外授权的策略组 |
| ** policyId | string | 策略ID |
| ** policyName | string | 策略名称 |
| ** status | int | 策略状态 0:下线(未启用) 1:上线(启用) |
| resourceInfo | object | presentable引用的资源基础信息 |
| ** resourceId | string | 资源ID |
| ** resourceName | string | 资源名称 |
| ** resourceType | string | 资源类型 |
| version | string | 展品的版本,同引用的资源版本号 |
| createDate | date | 创建日期 |
response-type: resourceInfo (资源信息)
| 返回值字段 | 字段类型 | 字段说明 |
| resourceId | string | 资源ID |
| resourceType | string | 资源类型 |
| resourceName | string | 资源名称 |
| userId | int | 用户ID |
| username | string | 用户姓名 |
| coverImages | string[] | 封面图片 |
| intro | string | 资源简介 |
| tags | string[] | 资源标签集 |
| latestVersion | string | 资源最大版本号 |
| resourceVersions | object[] | 资源版本信息 |
| ** version | string | 资源版本号 |
| ** versionId | string | 资源版本Id |
| ** createDate | date | 版本创建时间 |
| policies | object[] | 资源授权策略 |
| baseUpcastResources | object[] | 基础上抛信息 |
| ** resourceId | string | 上抛资源ID |
| ** resourceName | string | 上抛资源名称 |
response-type: fileStream (文件流)
标准 fileStream 文件流
授权失败时统一响应(非 response-type: result)
| 返回值字段 | 字段类型 | 字段说明 |
| ret | int | 公共标准响应结果 |
| errcode | int | 3:授权失败错误 |
| data | object | 具体的授权信息 |
| ** subjectType | int | 标的物类型 |
| ** referee | int | 标的物服务类型ID |
| ** breachResponsibilityType | int | 授权未通过的责任主体类型: 1:资源方 2:节点方 4:C端用户 128:无 |
| ** authCode | int | 授权码 |
| ** isAuth | bool | 是否授权通过 |
| ** data | object | 附加数据,例如授权失败的资源 |
| ** errorMsg | string | 授权错误提示 |