Blobs
The Blobs API enables the creation and listing of blobs.
Get blob metadata
Get the metadata of a blob.
GET /api/blobs/{id}
Path parameters
id
integer requiredId of blob.
Response codes
200 Success
{
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"thumbnail_url": "string"
}
404 Not Found
Code sample
curl https://{WEAVY-SERVER}/api/blobs/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Upload a blob
Uploads a blob using multipart/form-data
.
After upload the blob can be used as reference when creating attachments and/or files.
POST /api/blobs
Response codes
200 Success
{
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"thumbnail_url": "string"
}
400 Bad Request
Code sample
curl https://{WEAVY-SERVER}/api/blobs
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
-F blob=@/test/image.png
Create external blob
Creates a blob that links to an external blob provider. After creation the blob can be used as reference when creating attachments and/or files.
POST /api/blobs/external
Body parameters
provider
string requiredGets or sets the provider name.
link
string requiredGets or sets an url for viewing the blob.
name
string requiredGets or sets the file name of the blob.
width
integerGets or sets the width, in pixels, of the blob (only for images).
height
integerGets or sets the height, in pixels, of the blob (only for images).
size
integer requiredGets or sets the size, in bytes, of the file.
media_type
stringGets or sets the Media Type (https://www.iana.org/assignments/media-types/media-types.xhtml) of the file, e.g. "image/png".
download
stringGets or sets an url for downloading the blob.
embed
stringGets or sets an url used for embedding the blob.
raw
Gets or sets the raw metadata from the provider.
Response codes
201 Created
{
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"thumbnail_url": "string"
}
400 Bad Request