Create and upload document to Clio fails but no error message is returned

127 views Asked by At

I'm having trouble creating a document and uploading it using the Clio API. My POST request appears to be successful. Here is the HTTP Response:

{
    "data": {
        "id": 8357259141,
        "latest_document_version": {
            "uuid": "74019ae8-689a-483a-8928-9916e3edeb10",
            "put_url": "https://iris-production.s3.us-east-1.amazonaws.com/uploads/document_version/file/74019ae8-689a-483a-8928-9916e3edeb10/test.pdf?X-Amz-Expires=28800&X-Amz-Date=20221213T145014Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3TF4DC3BD47PIMP5%2F20221213%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-server-side-encryption&X-Amz-Signature=0216bebdabea7f5e09b45cfd8939d01c47b18a36893bc5d162bcc8283a5d9818",
            "put_headers": [
                {
                    "name": "x-amz-server-side-encryption",
                    "value": "AES256"
                },
                {
                    "name": "Content-Type",
                    "value": "application/pdf"
                }
            ]
        }
    }
}

The curl command is successful.

The curl command:

curl -v -X PUT -T "test1.pdf" -H "Content-Type: application/pdf"  -H "x-amz-server-side-encryption: AES256" "https://iris-production.s3.us-east-1.amazonaws.com/uploads/document_version/file/74019ae8-689a-483a-8928-9916e3edeb10/test.pdf?X-Amz-Expires=28800&X-Amz-Date=20221213T145014Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3TF4DC3BD47PIMP5%2F20221213%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-server-side-encryption&X-Amz-Signature=0216bebdabea7f5e09b45cfd8939d01c47b18a36893bc5d162bcc8283a5d9818"

curl verbose output:

Note: Unnecessary use of -X or --request, PUT is already inferred.
*   Trying 52.216.222.50:443...
* Connected to iris-production.s3.us-east-1.amazonaws.com (52.216.222.50) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN: server accepted http/1.1
* Server certificate:
*  subject: CN=s3.amazonaws.com
*  start date: Apr  1 00:00:00 2022 GMT
*  expire date: Mar 30 23:59:59 2023 GMT
*  subjectAltName: host "iris-production.s3.us-east-1.amazonaws.com" matched cert's "*.s3.us-east-1.amazonaws.com"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
> PUT /uploads/document_version/file/74019ae8-689a-483a-8928-9916e3edeb10/test.pdf?X-Amz-Expires=28800&X-Amz-Date=20221213T145014Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3TF4DC3BD47PIMP5%2F20221213%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-server-side-encryption&X-Amz-Signature=0216bebdabea7f5e09b45cfd8939d01c47b18a36893bc5d162bcc8283a5d9818 HTTP/1.1
> Host: iris-production.s3.us-east-1.amazonaws.com
> User-Agent: curl/7.84.0
> Accept: */*
> Content-Type: application/pdf
> x-amz-server-side-encryption: AES256
> Content-Length: 190591
> Expect: 100-continue
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< x-amz-id-2: y/jyR3mDHlcAtDNb3QXIHKC0r9NZL6kbPAaJF9KXXD8dpN/USbecsX+XaI7t+miBkUYO/yH8Gb8=
< x-amz-request-id: 59B5KJG4TRARVRTD
< Date: Tue, 13 Dec 2022 14:51:39 GMT
< x-amz-version-id: hnxXqV_dxXhkx6v4PS7h1qIX73H0Gkkr
< x-amz-server-side-encryption: AES256
< ETag: "82822cc0e2b3b928636e5d1ff065562d"
< Server: AmazonS3
< Content-Length: 0
<
* Connection #0 to host iris-production.s3.us-east-1.amazonaws.com left intact

Despite the successful commands, no file shows up in Clio.

Since I'm not getting any error messages I do not know how to troubleshoot this.

Any help will be appreciated

1

There are 1 answers

0
Dean Householder On

I think you're just missing the final step which is marking it as "fully-uploaded" before it is available in Clio. Search the docs for "Mark the document as fully-uploaded"

Just below this link: https://app.clio.com/api/v4/documentation#section/Uploading-a-new-document