Upload your file to S3¶
POST https://ali-userassets-production.s3.amazonaws.com
This API endpoint is step 2 of 3 to upload a file and attach it to an existing entity.
The endpoint uploads the file to Amazon S3 service, in which the following parameters are required:
Field | Type | Details | Default |
---|---|---|---|
key* | string | Value of "key" from response of Get signed S3 URL endpoint. | |
signature* | string | Value of "signature" from response of Get signed S3 URL endpoint. | |
success_action_status* | string | Value of "success_action_status" from response of Get signed S3 URL endpoint. | 201 |
acl* | string | Value of "acl" from response of Get signed S3 URL endpoint. | private |
AWSAccessKeyId* | string | Value of "aws_access_key_id" from response of Get signed S3 URL endpoint. | |
policy* | string | Value of "policy" from response of Get signed S3 URL endpoint. | |
file* | string | String representing the full path to file on user's local computer |
* indicates a required field
Example Requests¶
Upload your file to S3¶
curl --location --request POST "https://ali-userassets-production.s3.amazonaws.com" \
--header "X-PW-AccessToken: YOUR_TOKEN_HERE" \
--header "X-PW-Application: developer_api" \
--header "X-PW-UserEmail: YOUR_EMAIL_HERE" \
--header "Content-Type: application/json" \
--form "key=temp_uploads/f0317718-9b56-4d28-bda4-985af6b75f56/b0c5afe5-3d87-495d-ae58-760fcafbadec" \
--form "signature=mxw/zFUbSmtKFWbxcfKQZRSmax4=" \
--form "success_action_status=201" \
--form "acl=private" \
--form "AWSAccessKeyId=AKIAJ2RYRNMVJJWLRENA" \
--form "policy=eyJleHBpcmF0aW9uIjoiMjAxOS0wNi0xMFQyMjoyMTo1OC4wMDBaIiwiY29uZGl0aW9ucyI6W3siYnVja2V0IjoiYWxpLXVzZXJhc3NldHMtcHJvZHVjdGlvbiJ9LHsiYWNsIjoicHJpdmF0ZSJ9LHsia2V5IjoidGVtcF91cGxvYWRzL2YwMzE3NzE4LTliNTYtNGQyOC1iZGE0LTk4NWFmNmI3NWY1Ni9iMGM1YWZlNS0zZDg3LTQ5NWQtYWU1OC03NjBmY2FmYmFkZWMifSxbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwwLDEwNzM3NDE4MjRdLHsic3VjY2Vzc19hY3Rpb25fc3RhdHVzIjoiMjAxIn1dfQ==" \
--form "file=/Users/username/Desktop/cat.jpeg"
<?xml version="1.0" encoding="UTF-8"?>
<PostResponse>
<Location>https://ali-userassets-production.s3.amazonaws.com/temp_uploads%2Ff0317718-9b56-4d28-bda4-985af6b75f56%2Fb0c5afe5-3d87-495d-ae58-760fcafbadec</Location>
<Bucket>ali-userassets-production</Bucket>
<Key>temp_uploads/f0317718-9b56-4d28-bda4-985af6b75f56/b0c5afe5-3d87-495d-ae58-760fcafbadec</Key>
<ETag>"32ffc747a3857844479b6d21a6e5d46a"</ETag>
</PostResponse>