Upload file
POSThttps://planefs-uploads.s3.amazonaws.com/
Upload the file using the credentials generated by the Get upload credentials endpoint.
Body Parameters
Content-Type:requiredstringThe MIME type of the file
key:requiredstringThe target path/filename in S3
x-amz-algorithm:requiredstringAWS signature algorithm (AWS4-HMAC-SHA256)
x-amz-credential:requiredstringAWS signature algorithm (AWS4-HMAC-SHA256)
x-amz-date:requiredstringRequest timestamp
policy:requiredstringBase64-encoded policy document
x-amz-signature:requiredstringRequest signature
file:requiredfileThe file to be uploaded
Upload file
bash
curl -X POST \
"https://api.plane.sohttps://planefs-uploads.s3.amazonaws.com/" \
-H "X-API-Key: $PLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"Content-Type": "example-Content-Type",
"key": "example-key",
"x-amz-algorithm": "example-x-amz-algorithm",
"x-amz-credential": "example-x-amz-credential",
"x-amz-date": "example-x-amz-date",
"policy": "example-policy",
"x-amz-signature": "example-x-amz-signature",
"file": "example-file"
}'python
import requests
response = requests.post(
"https://api.plane.sohttps://planefs-uploads.s3.amazonaws.com/",
headers={"X-API-Key": "your-api-key"},
json={
'Content-Type': 'example-Content-Type',
'key': 'example-key',
'x-amz-algorithm': 'example-x-amz-algorithm',
'x-amz-credential': 'example-x-amz-credential',
'x-amz-date': 'example-x-amz-date',
'policy': 'example-policy',
'x-amz-signature': 'example-x-amz-signature',
'file': 'example-file'
}
)
print(response.json())javascript
const response = await fetch('https://api.plane.sohttps://planefs-uploads.s3.amazonaws.com/', {
method: 'POST',
headers: {
'X-API-Key': 'your-api-key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
'Content-Type': 'example-Content-Type',
key: 'example-key',
'x-amz-algorithm': 'example-x-amz-algorithm',
'x-amz-credential': 'example-x-amz-credential',
'x-amz-date': 'example-x-amz-date',
policy: 'example-policy',
'x-amz-signature': 'example-x-amz-signature',
file: 'example-file',
}),
});
const data = await response.json();Response201
json
{
"id": "resource-uuid",
"created_at": "2024-01-01T00:00:00Z"
}
