Skip to main content
Documentation & User Guides | Fotoware

Notifications when assets change in Fotoware

You can use webhooks to configure the Fotoware system to send notifications when assets change in an archive.

  1. From the Tools menu (cogwheel icon), go to Site Configuration Integrations.
  2. Select Webhooks
  3. Three asset events are available for notifications:

FotoWare SaaS Asset webhooks.png

  • Asset ingested - Used to post a notification when an asset enters the system via the Fotoware API.

Note: Webhooks on asset ingestion are not supported if the upload destination is set to use a custom file system ingestion folder, since the uploaded asset may be picked up by, for example, a Color Factory server and transferred elsewhere and may not be indexed in Fotoware's asset storage folders.

  • Asset modified - Send a notification when an asset in the system changes.
  • Asset deleted - Send a notification when an asset is deleted by any means.

The asset data can be sent as Form or JSON data to the URL specified in the corresponding field.

JSON Data sent in webhook

Attribute

Type

Description

byline String The byline of the asset.
created ISO 8601 Date (String) Date when webhook was created.
data JSON object Asset representation.
description String Description of the asset.
file-size String Size of the file in bytes.
href String Original URL of the asset within the originating archive.
id String ID of the webhook.
pixel-height String A height of the image in pixels, e.g., "2560".
pixel-width String A width of the image in pixels, e.g., "1440".
preview-href String URL of the preview image.
tags String Tags (keywords) of the asset.
thumbnail-href URL (String) URL of the thumbnail.
title String Title of the asset.
type String Type of the data. In this case, "asset".

Example of the JSON data sent in webhook

Note that the data field below contains the Asset representation. Because of its size, it has been left out in the example.

JSON

{

  "pixel-width": "2976",

  "byline": "",

  "description": "Some long description line",

  "tags": "",

  "file-size": "243340",

  "title": "",

  "thumbnail-href": "https://acme.fotoware.cloud/fotoweb/cache/5473/like/IMG_20190223_135249.t5c80f612.m200.x0UnqgdCS.jpg",

  "created": "2019-03-07T11:44:27.802Z",

  "href": "https://acme.fotoware.cloud/fotoweb/archives/5473-SummitPhotos/like/IMG_20190223_135249.jpg.info",

  "data": {...},

  "preview-href": "https://acme.fotoware.cloud/fotoweb/cache/5473/like/IMG_20190223_135249.t5c80f612.m800.xYQhD8Ty-.jpg",

  "type": "asset",

  "pixel-height": "3968",

  "id": "12489453-7e9d-4604-af89-99b8f91db6a3"

}

Webhook Payload for Asset Version Changes

With versioning in Fotoware, the payload of the "asset modified" webhook has been updated to include information about how the asset was updated.

Metadata updates

{ 
... 
"operation-name" : "updateMetadata", 
"data": { 
    "asset: {<ASSET AFTER CHANGE, same as old "data">},
    "assetBefore": {...},
    "metadataDiff": {...} 
    } 
}

Rename operations

{ 
    ... 
    "operation-name" : "rename", 
    "previous-name" : "oldName" 
    "data": { 
        "asset: {<ASSET AFTER CHANGE, same as old "data">} 
    } 
}

 Restore revision

{ 
    ... 
    "operation-name" : "restoreRevision", 
    "data": { 
        "asset: {<ASSET AFTER CHANGE, same as old "data">}, 
        "revisionsDiff": {...} 
    } 
}

Upload of new local version (image data and potentially metadata) that is added to an asset's version history

{
...
"operation-name" : "upload",
"data": {
      "asset: {<ASSET AFTER CHANGE, same as old "data">},
      "assetBefore": {...},
      "metadataDiff": {...}
        }
}

URLs with limited time validity

Thumbnail and preview URLs have a limited lifetime. They are only valid for being consumed immediately, such as by downloading the rendition image immediately or by embedding it into a dynamic web page that is presented to a user agent immediately.

We do not recommend storing thumbnail and preview URLs for a longer time in external systems, as they will eventually expire. The expiration time of previews and thumbnails is unspecified, but the link should be valid for at least several seconds after it was received from an API request or webhook.

If an integration needs access to previews and thumbnails at a later time, we recommend storing the asset's API URL (data.href) and requesting thumbnails and previews through the API when needed. Alternatively, an integration can download the thumbnail or preview image and store them for later use