Clio 在将文档标记为完全上传的 API 时出现错误。

huangapple go评论77阅读模式
英文:

Clio Error while marking the document as fully-uploaded API

问题

以下是翻译好的内容:

实际上,我正在尝试将文档上传到特定的 Clio 案件中。但是在将文档标记为完全上传时出现了错误。以下是详细信息:

POST:

https://app.clio.com/api/v4/documents?fields=id%2Clatest_document_version%7Buuid%2Cput_url%2Cput_headers%7D
请求体:
{"data":
    {"name":"Sahi Clio 测试 pppppppppp.zip",
    "parent":
    {"id":1235381254,"type":"Matter"}
    }
}
响应:
{"data":{"id":2817422494,"latest_document_version":{"uuid":"f59e8f14-42fc-4ecb-889c-587dc3e75c23","put_url":"https://iris-production.s3.us-east-1.amazonaws.com/uploads/document_version/file/f59e8f14-42fc-4ecb-889c-587dc3e75c23/http%3A//dev.brightleaf.com%3A8991/bl//temp/1599305767133_1/Sahi%20Clio%20Test%20887445.zip?X-Amz-Expires=28800&X-Amz-Date=20200905T113156Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3TF4DC3BD47PIMP5/20200905/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-server-side-encryption&X-Amz-Signature=cf0f07b59b085eb45e2eb042f1f7737277c516bb8f2894cba731414c348e6243","put_headers":[{"name":"x-amz-server-side-encryption","value":"AES256"},{"name":"Content-Type","value":"application/zip"}]}}}

PATCH:

https://app.clio.com/api/v4/documents?fields=id%2Clatest_document_version%7Buuid%2Cput_url%2Cput_headers%7D&fields=id%2Clatest_document_version%7Bfully_uploaded%7D
请求体:
{"data":{"uuid":"f59e8f14-42fc-4ecb-889c-587dc3e75c23","fully_uploaded":"true"}}
响应:
HttpResponseProxy{HTTP/1.1 422 Unprocessable Entity [Cache-Control: private, no-cache, no-store, must-revalidate, Content-Type: application/json; charset=utf-8, Date: Sat, 05 Sep 2020 11:51:55 GMT, Server: nginx, Status: 422 Unprocessable Entity, Vary: Origin, X-API-VERSION: 4.0.5, X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, X-RateLimit-Limit: 600, X-RateLimit-Remaining: 598, X-RateLimit-Reset: 1599306720, X-Request-Id: ad411eb3-fd05-4824-917c-9fe2246d8a31, X-XSS-Protection: 1; mode=block, Content-Length: 234, Connection: keep-alive] ResponseEntityProxy{[Content-Type: application/json; charset=utf-8,Content-Length: 234,Chunked: false]}}

当我尝试在 POSTMAN 中进行(使用不同的文档)时,我在相同的事件上得到了以下消息:

{
    "error": {
        "type": "UploadNotFoundError",
        "message": "未找到与 UUID f65a8b4e-4aa9-4855-a088-0d3e63bad18b 的文件 C:/Users/srrepswal/Desktop/Sahi Clio 测试 pppppppppp.zip 匹配的远程文件"
    }
}

请问我做错了什么?

英文:

Actually I am trying to upload a document to Clio in a particular matter. But I am getting error while I am marking the document as fully-uploaded. Below are the details

POST:

https://app.clio.com/api/v4/documents?fields=id%2Clatest_document_version%7Buuid%2Cput_url%2Cput_headers%7D
Body: 
{"data":
    {"name":"Sahi Clio Test pppppppppp.zip",
    "parent":
    {"id":1235381254,"type":"Matter"}
    }
}
Response: 
{"data":{"id":2817422494,"latest_document_version":{"uuid":"f59e8f14-42fc-4ecb-889c-587dc3e75c23","put_url":"https://iris-production.s3.us-east-1.amazonaws.com/uploads/document_version/file/f59e8f14-42fc-4ecb-889c-587dc3e75c23/http%3A//dev.brightleaf.com%3A8991/bl//temp/1599305767133_1/Sahi%20Clio%20Test%20887445.zip?X-Amz-Expires=28800&X-Amz-Date=20200905T113156Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3TF4DC3BD47PIMP5/20200905/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-server-side-encryption&X-Amz-Signature=cf0f07b59b085eb45e2eb042f1f7737277c516bb8f2894cba731414c348e6243","put_headers":[{"name":"x-amz-server-side-encryption","value":"AES256"},{"name":"Content-Type","value":"application/zip"}]}}}

PATCH

https://app.clio.com/api/v4/documents?fields=id%2Clatest_document_version%7Buuid%2Cput_url%2Cput_headers%7D&fields=id%2Clatest_document_version%7Bfully_uploaded%7D
Body: 
{"data":{"uuid":"f59e8f14-42fc-4ecb-889c-587dc3e75c23","fully_uploaded":"true"}}
Response: 
HttpResponseProxy{HTTP/1.1 422 Unprocessable Entity [Cache-Control: private, no-cache, no-store, must-revalidate, Content-Type: application/json; charset=utf-8, Date: Sat, 05 Sep 2020 11:51:55 GMT, Server: nginx, Status: 422 Unprocessable Entity, Vary: Origin, X-API-VERSION: 4.0.5, X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, X-RateLimit-Limit: 600, X-RateLimit-Remaining: 598, X-RateLimit-Reset: 1599306720, X-Request-Id: ad411eb3-fd05-4824-917c-9fe2246d8a31, X-XSS-Protection: 1; mode=block, Content-Length: 234, Connection: keep-alive] ResponseEntityProxy{[Content-Type: application/json; charset=utf-8,Content-Length: 234,Chunked: false]}}

While I am trying it by POSTMAN(Different document), I am getting below message on same event:

{
    "error": {
        "type": "UploadNotFoundError",
        "message": "A matching remote file was not found for the file named C:/Users/srrepswal/Desktop/Sahi Clio Test pppppppppp.zip with UUID f65a8b4e-4aa9-4855-a088-0d3e63bad18b"
    }
}

Can you please let me know what I am doing wrong ?

答案1

得分: 0

实际上,对于以编程方式将文档上传到 Clio,我缺少了一个步骤。需要调用三个 REST API:

  1. 发送 POST 请求:创建文档(Create Document)
  2. 发送 PUT 请求:上传文档(Upload document)
  3. 发送 Patch 请求:标记文档为完全上传 API(Marking the document as fully-uploaded API)

所以在这里,我漏掉了第二步。在调用了第二个 API 后,对我起作用。

英文:

Actually for upload document pragmatically to Clio I was missing one Step. it need to call three Rest API

  1. POST: Create Document
  2. PUT: Upload document
  3. Patch: Marking the document as fully-uploaded API
    So here i was missing 2nd step. After calling 2nd API, it is working for me

huangapple
  • 本文由 发表于 2020年9月5日 21:36:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/63754502.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定