POST /shared-links
基本信息
Note: 该端点在Alfresco 5.2和更高版本中可用。
在请求正文中创建指向文件nodeId的shared-links。 另外,可以设置一个可选的到期日期,因此,当达到到期日期时,shared-links将无效。 例如:
{ "nodeId": "1ff9da1a-ee2f-4b9c-8c34-3333333333", "expiresAt": "2017-03-23T23:00:00.000+0000" }
Note:您可以创建指向多个文件的shared-links,以指定JSON正文中的nodeId列表,如下所示:
[ { "nodeId": "1ff9da1a-ee2f-4b9c-8c34-4444444444" }, { "nodeId": "1ff9da1a-ee2f-4b9c-8c34-5555555555" } ]
如果将列表指定为输入,则在响应正文中返回分页列表而不是条目。 例如:
{ "list": { "pagination": { "count": 2, "hasMoreItems": false, "totalItems": 2, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { ... } }, { "entry": { ... } } ] } }
请求方式: POST
请求API :/shared-links
响应等级(状态200)
成功回应
{ "entry": { "id": "string", "expiresAt": "2021-01-08T08:52:11.643Z", "nodeId": "string", "name": "string", "title": "string", "description": "string", "modifiedAt": "2021-01-08T08:52:11.643Z", "modifiedByUser": { "displayName": "string", "id": "string" }, "sharedByUser": { "displayName": "string", "id": "string" }, "content": { "mimeType": "string", "mimeTypeName": "string", "sizeInBytes": 0, "encoding": "string" }, "allowableOperations": [ "string" ], "allowableOperationsOnTarget": [ "string" ] } }
响应内容类型 applicaiton/json
Query参数
名称 | 类型 | 是否必填 | 示例值 | 描述 |
include | Array[string] | 否 | 返回有关shared-links的其他信息,可以请求以下可选字段:allowableOperations;path | |
fields | Array[string] | 否 | field名称的list。 例如,如果您想节省整体带宽,则可以使用此参数来限制响应中返回的field。 例如,如果您想节省整体带宽,则可以使用此参数来限制响应中返回的field。 该列表适用于返回的单个实体或集合中的条目。 如果API方法也支持include参数,则除了在fields参数中指定的fields外,还返回include参数中指定的fields。 |
Body参数(sharedLinkBodyCreate)
request body示例
{ "nodeId": "string", "expiresAt": "2021-01-18T02:32:14.781Z" }
错误信息描述
状态码 | 原因 |
400 | 无效的参数:nodeId无效,或者不能标识文件,或者sharedLinkBodyCreate无效,或者指定的到期日期无效。 例如。 到期日期已经过去 |
401 | 验证失败 |
403 | 当前用户无权创建sharedId(例如,无读取权限) |
404 | nodeId不存在 |
409 | nodeId的shared-links已存在 |
501 | 系统禁用了shared-links |
default | 意外错误 |
返回结果示例
{ "error": { "errorKey": "string", "statusCode": 0, "briefSummary": "string", "stackTrace": "string", "descriptionURL": "string", "logId": "string" } }