POST /blobs Create Blob
create_blob
Create Blob creates a blob instance with specified extension and returns presigned url for content upload.
Note: This will NOT upload your file to the blob instance. To upload a document, you will need to issue a PUT request to the presigned URL returned by the response body. See example, code snippet below:
import requests
# Create Blob endpoint returns blob_id and upload presigned url
# For example, the presigned_url might look like this:
presigned_url = ""
# Set the path to the file you want to upload
filepath = "document.pdf"
# Set the headers appropriately
headers = {
'Content-Type': 'application/pdf'
}
# Read the file data and make the PUT request
with open(filepath, 'rb') as file:
payload = file.read
response = requests.put(url=upload_presigned_url, headers=headers, data=payload)
Request
{
"extension": ".pdf",
"presign_url_ttl": 30
} {
"extension": ".jpg",
"blob_name": "image.jpg"
} Response
Blob has been created
{
"blob_id": "8c561841-6671-412e-a356-523460ba0d8d",
"extension": ".pdf",
"presigned_urls": {
"upload": {
"url": "https://api-data-manager-blobs-bucket.s3.amazonaws.com/8c561841-6671-412e-a356-523460ba0d8d"
}
}
} Request data failed validation
{
"message": "{'data': ['Missing data for required field.']}"
} Request bodyapplication/json
3 fields
application/json| Field | Type | Description |
|---|---|---|
extensionrequired | string | Extension of file, that blob is persistingExample .pdf |
presign_url_ttl | integer | TTL of presigned url in seconds, default is 3600 |
blob_name | string | Name for blob |
Response 201application/json
6 fields
201application/jsonBlob has been created
| Field | Type | Description |
|---|---|---|
blob_id | string (ulid) | Blob idExample 01EZQ32PJQGKRA6HR8D72Q9FFF |
extension | string | Extension of file, that blob is persistingExample .pdf |
presigned_urls | object | Presigned urls for uploading or downloading file |
upload | object | Presigned url |
url | string (uri) | Presigned urlExample https://api-data-manager-blobs-bucket.s3.amazonaws.com/00c8c9e5-dfdd-44c5-a57e-8de7a2672e2e |
page_count | integer | Number of pages present, if the file persisted is a PDF. |
content_length | integer | Size of the file being persisted. |
blob_name | string | Blob name |
Response 400application/json
1 fields
400application/jsonRequest data failed validation
| Field | Type | Description |
|---|---|---|
message | one of | Message |
Response 403application/json
1 fields
403application/jsonMissing API key
| Field | Type | Description |
|---|---|---|
message | string | Message |
Response 429application/json
1 fields
429application/jsonThe user has sent too many requests in a given amount of time ("rate limiting")
| Field | Type | Description |
|---|---|---|
message | string | Message |