Blobs

The Blobs API enables the uploading of blobs. Blobs are used as references when creating files and attachments and files.

Get blob metadata

Get the metadata of a blob.

GET /api/blobs/{id}
Path parameters
id integer required

Id 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.

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 required

Gets or sets the provider name.

link string required

Gets or sets an url for viewing the blob.

name string required

Gets or sets the file name of the blob.

width integer

Gets or sets the width, in pixels, of the blob (only for images).

height integer

Gets or sets the height, in pixels, of the blob (only for images).

size integer required

Gets or sets the size, in bytes, of the file.

media_type string

Gets or sets the Media Type (https://www.iana.org/assignments/media-types/media-types.xhtml) of the file, e.g. "image/png".

download string

Gets or sets an url for downloading the blob.

embed string

Gets 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

Weavy Docs