File related models

FileMetadata object

Holds file type-dependent information of a file stored on Effis. This can be one of four variants:

Text

Text metadata does not contain any special parameters.

FieldTypeDescription
typeStringThe type of file as a lowercase string, always "text".

Image

Image metadata contains the width and height of the image.

FieldTypeDescription
typeStringThe type of file as a lowercase string, always "image".
widthNumberThe width of the image in pixels.
heightNumberThe height of the image in pixels.

Video

Video metadata contains the width and height of the video.

FieldTypeDescription
typeStringThe type of file as a lowercase string, always "video".
widthNumberThe width of the video in pixels.
heightNumberThe height of the video in pixels.

Other

Metadata for other files only include the file type.

FieldTypeDescription
typeStringThe type of file as a lowercase string.

Examples

{
    "type": "text"
}
{
    "type": "image",
    "width": 5120,
    "height": 1440
}
{
    "type": "video",
    "width": 1920,
    "height": 1080
}
{
    "type": "other"
}

FileData object

Represents a file stored on Effis.

FieldTypeDescription
idStringThe id of the file.
nameStringThe name of the file.
bucketStringThe bucket to which the file belongs.
spoiler?BooleanWhether this file is spoiler tagged. This is not provided if false.
metadataObjectA FileMetadata object containing meta-information about the file.

Example

{
    "id": 12345678,
    "name": "kaas",
    "bucket": "attachments",
    "spoiler": true,
    "metadata": {
        "type": "image",
        "width": 7680,
        "height": 4320,
    }
}
{
    "id": 12345678,
    "name": "japanese goblin",
    "bucket": "attachments",
    "metadata": {
        "type": "other"
    }
}

Relevant Endpoints

MethodEndpoint
POSTEffis /
POSTEffis /<bucket>