Entity Image

To upload or replace an image of an entity, use the following endpoints.

Get an entity's images

To get an entity's images.

{warning} Remember that all endpoints documented here need to be prefixed with 1.0/campaigns/{campaign.id}/.

Method URI Headers
GET entities/{entity.id}/image Default

Results

{
    "image": {
        "uuid": "aaaa-bbbb-0000",
        "full": "{url}",
        "thumbnail": "{40x40 url}"
    },
    "header": {
        "uuid": "aaaa-bbbb-0000",
        "full": "{url}",
        "thumbnail": "{40x40 url}"
    }
}

Upload an image

Uploading an image to the entity will store it in the campaign's Gallery.

Method URI Headers
POST entities/{entity.id}/image Default

Body

Parameter Type Detail
file stream Stream to file uploaded to the timeline
is_header boolean If set to true, will save the image as the entity's header (premium campaign feature)

Example

curl --location --request POST 'https://api.kanka.io/1.0/campaigns/{campaign.id}/entities/{entity.id}/image' \
--header 'accept: application/json' \
-- header 'content-type: multipart/form-data' \
--header 'Authorization: Bearer {bearer-token}' \
--form 'file=@"/path/to/image.png"'

Results

{
    "image": {
        "uuid": "aaaa-bbbb-0000",
        "full": "{url}",
        "thumbnail": "{40x40 url}"
    },
    "header": {
        "uuid": "aaaa-bbbb-0000",
        "full": "{url}",
        "thumbnail": "{40x40 url}"
    }
}

Remove an image

You can unlink an entity from its image. This won't delete the image from the gallery.

Method URI Headers
DELETE entities/{entity.id}/image Default

Parameters

Parameter Type Detail
is_header boolean If set to true, will unlink the header image

Results

{success} Code 200 with JSON body containing the new path to the image and thumbnail