接口描述
删除会话物料:按会话清空,或按物料 ID 批量删除(两者互斥)。
POST /v2/enterprises/{enterpriseId}/managedagent/artifacts/delete注意:
删除会话物料后,无法恢复,请谨慎操作。
输入参数
路径参数
参数 | 类型 | 说明 |
enterpriseId | string | WorkBuddy 企业 ID |
查询参数
无
请求体
字段 | 类型 | 说明 |
SessionId | string | SessionId 非空时删除该会话的全部物料 |
ArtifactIds | string[] | ArtifactIds 要删除的物料 ID,单次上限 MaxArtifactIdsPerRequest,按清洗后计数 |
输出参数
(
200,业务出参包装在 code / data / msg / requestId 中)DeleteSessionArtifactListResponse 对应 Action=DeleteSessionArtifactList 响应体。
字段 | 类型 | 说明 |
deletedCount | integer | DeletedCount 实际删除的物料数,已删除或不存在的 id 不计入 |
示例
输入示例
POST /v2/enterprises/{enterpriseId}/managedagent/artifacts/deleteAuthorization: Bearer pt_<YOUR_APP_KEY>Content-Type: application/json{"ArtifactIds": ["1200345678901234567"],"SessionId": "736918300000000002"}
输出示例
{"code": 0,"data": {"deletedCount": 2},"msg": "OK","requestId": "3c6d138e-1234-5678-9abc-def012345678"}
错误码
说明:
错误码 | 说明 |
InternalError.SessionArtifactOperationFailed | 会话物料操作失败 |
InvalidParameter.ArtifactIDRequired | 缺少 ArtifactId |
InvalidParameter.InvalidRequestBody | 请求体不合法 |
InvalidParameter.SessionIDRequired | 缺少 SessionId |
InvalidParameterCombination.ArtifactIdsWithDeleteAll | SessionId 与 ArtifactIds 不能同时传 |
LimitExceeded.ArtifactIdsCount | 单次请求的 ArtifactIds 数量超限(最多 100 个) |
MissingParameter.UinRequired | 公共参数中缺少 Uin |
ResourceNotFound.Session | 会话不存在 |