To upload or replace an image of an entity, use the following endpoints.
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 |
{
"image": {
"uuid": "aaaa-bbbb-0000",
"full": "{url}",
"thumbnail": "{40x40 url}"
},
"header": {
"uuid": "aaaa-bbbb-0000",
"full": "{url}",
"thumbnail": "{40x40 url}"
}
}
Uploading an image to the entity will store it in the campaign's Gallery.
| Method | URI | Headers |
|---|---|---|
| POST | entities/{entity.id}/image |
Default |
| 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) |
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"'
{
"image": {
"uuid": "aaaa-bbbb-0000",
"full": "{url}",
"thumbnail": "{40x40 url}"
},
"header": {
"uuid": "aaaa-bbbb-0000",
"full": "{url}",
"thumbnail": "{40x40 url}"
}
}
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 |
| Parameter | Type | Detail |
|---|---|---|
is_header |
boolean |
If set to true, will unlink the header image |
{success} Code 200 with JSON body containing the new path to the image and thumbnail