用途:该技能用于通过 Paperless-ngx 的 REST API 管理文档,适合需要检索、上传、下载文档以及整理标签、通信方和文档类型的场景。
配置:需设置环境变量 PAPERLESS_URL(如 https://paperless.example.com)与 PAPERLESS_TOKEN(取自 Paperless-ngx 设置中的 API 令牌)。所有请求需携带请求头 Authorization: Token $PAPERLESS_TOKEN。
主要能力:搜索文档(query 参数),并可按 correspondent__id、document_type__id、tags__id__in、created__date__gte、created__date__lte、added__date__gte 过滤;获取单篇文档详情;下载原始文件或 OCR 归档版本(加 ?original=false);上传文档(post_document 端点,字段含 title、created、correspondent、document_type、storage_path、tags(可重复)、archive_serial_number、custom_fields);用 PATCH 更新元数据;用 DELETE 删除文档。还可列出与创建标签、通信方、文档类型,并通过 bulk_edit 执行批量操作(set_correspondent、set_document_type、add_tag、remove_tag、delete、reprocess)。上传后可用 /api/tasks/?task_id={uuid} 查询任务状态。
响应处理:列表端点返回带分页的 {"count": N, "results": [...]},单对象直接返回;分页用 ?page=2,排序用 ?ordering=-created(前缀 - 表示降序)。
限制:资料未提供关于权限范围、速率限制、错误码或版本兼容性的更多细节。