Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  1. Fotoware Alto
    • 11.14 Schreckhorn
    • Terminology
    • Solutions
    • User Guide - Deutsch
    • User Guide - English
    • API Changelog
  2. Fotoware Veloz
    • Managing users and groups
    • Configuring archives
    • Configuring workflows
    • Configuring site behavior
    • Navigating and searching to find your assets
    • Working with your assets
    • Editing asset metadata
    • Uploading files
    • Version Control in Fotoware
    • Albums - Creating and sharing collections
    • Placing assets in a CMS
    • Working with the Fotoware Pro interface
    • Using the Fotoware plugins
    • Consent management
    • User guide to FotoWeb for iPad (Legacy)
    • Picture conferencing with FotoWeb Screens (Legacy)
    • What's what in Fotoware
    • GDPR
    • Fotoware Veloz releases
    • Activity Exports
    • Fotoware Example Workflows
  3. Fotostation
    • Getting started with Fotostation
    • Viewing, selecting and sorting files
    • Managing your assets with archives
    • Adding metadata to assets
    • Searching for assets
    • Working with your assets
    • Version Control in Fotostation
    • Automating tasks with Actions
    • Configuring metadata fields and editors
    • Configuring Fotostation
    • Configuring Fotostation for multi-user environments
    • Troubleshooting Fotostation
  4. Fotoware Flow
    • What is Flow?
    • Getting started
    • Flow dictionary
  5. Fotoware On-Premises
    • Getting started
    • Index Manager
    • FotoWeb
    • Color Factory
    • Connect
    • Operations Center Guide
  6. Integrations and APIs
    • The Fotoware API
    • Creating integrations using embeddable widgets
    • Authorizing applications using OAuth
    • Auto-tagging
    • FotoWeb Drag and Drop export
    • Integration using webhooks
    • Optimizely and Episerver plugin documentation
    • User Interface Integrations
  7. Fotoware Mobile
    • User guide for Fotoware Mobile for iPhone and Android
    • User guide to FotoWeb for iPad (Legacy)
    • User guide to FotoWeb for iPhone and Android (Legacy)

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Support

Table of Contents

Selection Widget Handling Cancel events in the Selection Widget Enabling selection of multiple assets Event payload Export Widget Controlling user access to feature tabs in the widget Query parameters Example URL: Hiding the crop and size tab Special considerations HTTPS iframes
  • Home
  • Integrations and APIs
  • Creating integrations using embeddable widgets

Using the widgets

Learn how to implement the widgets in your custom integration.

01. April 2025

Elaine Foley

Table of Contents

Selection Widget Handling Cancel events in the Selection Widget Enabling selection of multiple assets Event payload Export Widget Controlling user access to feature tabs in the widget Query parameters Example URL: Hiding the crop and size tab Special considerations HTTPS iframes

Selection Widget

The selection widget is typically embedded into an iFrame as follows:

1 <iframe src="..."></iframe>

where src is set to the URL of the selection widget, as described in the Creating integrations using embeddable widgets. The iFrame can be shown, for example, as a modal dialog.

Once the user has selected an asset, an event is sent to the main application, which can be handled using the following JavaScript code:

01

02

03

04

05

06

07

08

09

10

function listener(event) {

if (event.origin != tenantURL)

return;

 

if (event.data.event === 'assetSelected') {

alert("An asset was selected: " + event.data.asset.href);

}

}

 

addEventListener("message", listener, false);

The tenantURL is the base URL of the FotoWeb site or tenant, e.g., https://acme.fotoware.cloud

The variable event.data.asset contains a JSON representation of the asset, as described in Asset Representation.

Having selected an asset in the Selection widget, the Export widget can now be used to modify the exported asset. If you prefer to do this programmatically, you can use the Export API to control the output.

Handling Cancel events in the Selection Widget

The Cancel button is not handled directly by the selection widget, because the selection widget cannot know what should happen if the user cancels selection. The application that embeds the selection widget can react to the user pressing cancel using the following JavaScript code:

1

2

3

4

5

window.addEventListener('message', function(event) {

if (event.data.event === 'selectionWidgetCancel') {

// Do something when the user clicks "Cancel"

}

});

Enabling selection of multiple assets

To enable selection of multiple assets in the Selection Widget, add ms=trueto the query string when calling up the widget. 

When using this query string parameter to enable the selection of multiple assets, instead of sending a single json object, the data is sent in an array of assets - see Event Payload below. This is the case even if only one asset is selected when multi-select is enabled.

01

02

03

04

05

06

07

08

09

10

11

12

13

14

15

16

17

18

function listener(event) {

if (event.origin != tenantURL)

return;

if (event.data.event === 'assetSelected') {

if (Array.isArray(event.data.asset)) {

// here you work with event.data.asset as an array of assets:

var assets = event.data.asset;

for (var i = 0, l = assets.length; i < l; i++) {

var asset = assets[i];

alert("This asset was selected: " + asset.href);

}

} else {

// single selection is in place

alert("An asset was selected: " + event.data.asset.href);

}

}

}

addEventListener("message", listener, false);

Event payload

The variable event.data.asset contains a JSON representation of the asset. When the data from several assets is returned, it is delivered as an array.
For the complete payload of the asset data, see Asset Representation.

01

02

03

04

05

06

07

08

09

10

11

12

13

14

15

16

17

18

event.data === {

event: 'assetSelected',

asset: [

{

href: 'assetHref1',

...

},

{

href: 'assetHref2',

...

},

{

href: 'assetHref3',

...

},

...

]

}

Export Widget

The export widget is typically embedded into an iFrame as follows:

1 <iframe src="https://acme.fotoware.cloud/fotoweb/widgets/publish?access_token=ACCESS_TOKEN&i=ASSET_URL&PARAMETERS"></iframe>

where ACCESS_TOKEN is the access token obtained in the authorization step, and ASSET_URL is the asset URL, which was obtained from the selection widget in the previous step. The iFrame can be shown, for example, as a modal dialog.

Note: The asset URL must be encoded using the JavaScript function encodeURIComponent.

Other Parameters:

Parameter Description
w A set width of the export
h A set height of the export
p A predefined preset
pub Publication text (used for easier identification of the export)

Once the user has exported the asset, an event is sent to the main application, which can be handled using the following JavaScript code:

01

02

03

04

05

06

07

08

09

10

11

function listener(event) {

if (event.origin != tenantURL)

return;

 

if (event.data.event == 'assetExported') {

var imageURL = evt.data.export.export.image.normal;

// Do something with the image URL

}

}

 

addEventListener("message", listener, false)

 The event data has the following format:

01

02

03

04

05

06

07

08

09

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

{

"export": {

"source": "...",

"json": "...",

"image": {

"normal": "...",

"highCompression": "...",

"doubleResolution": "..."

},

"widget": "...",

"size": {

"w": 921,

"h": 627

}

},

"caption": {

"label": "...",

"tooltip": "..."

},

"publication": {

"text": "..."

},

"metadata":{

"FIELD": "VALUE" | ["VALUE1", "VALUE2", ...],

...

}

}

where

Attribute Type Value
export.source URL (Asset)

URL of the exported asset.

Can be used to access the details of the asset using the API or to display the details in a browser.

export.json URL (object)

JSON representation of the export.

Identical to this JSON representation

export.image URL (JPEG image) Processed and exported asset (normal version)
export.highCompression URL (JPEG image) Processed and exported asset (smaller file size and potentially reduced quality)
export.doubleResolution URL (JPEG image) Processed and exported asset (doubled resolution, for Retina and similar displays)
export.widget URL (HTML)

An HTML widget containing the processed and exported asset with a tooltip and caption and optional additional behavior, if enabled during export

Can be embedded using an iFrame.

export.size.w Integer Width of the exported image (normal version) in pixels
export.size.h Integer Height of the exported image (normal version) in pixels
caption.label String Caption string, if specified during export
caption.tooltip String Tooltip string, if specified during export
publication.text String Name of publication (free-form string), if specified during export
metadata Dictionary

Metadata of the asset when it was exported.

The keys in this dictionary are the field numbers (as strings).

The values are either strings (for regular fields) or arrays of strings (for bag fields).

Controlling user access to feature tabs in the widget

After choosing an image with the selection widget, FotoWeb displays the Export widget to let the user adjust the image size as well as crop and style the exported image. The options available here can be managed in two ways:

  • By enabling/disabling features in the FotoWeb site configuration in the Site Configuration. 
  • By sending parameters to the export widget in the URL. This can only be used to hide tabs. These parameters cannot be used to showtabs that are disabled in the site configuration settings described above.

Query parameters

Parameter Description
crop=false Image crop, size and rotate
enhance=false Enhancement filters
caption=false Image caption
action=false Click action behavior
behaviour=false Embed behavior (Ken Burns effect)
publication=false Publication information

Example URL: Hiding the crop and size tab

1 http://fwserver/fotoweb/widgets/publish?i=%2Ffotoweb%2Farchives%2F5003-Trip%2520pictures%2FPrivate%2FDSC00697jpg.info&crop=false

Special considerations

HTTPS

If FotoWeb widgets are to be embedded into web applications using HTTPS, then content security policy may require FotoWeb to use HTTPS as well. Otherwise, loading the widget may be blocked, and only a blank page, dialog, or iframe may be shown.

Note:It is generally strongly recommended to run FotoWeb, as well as any other web application, web service, or web page, on HTTPS only.

iframes

Generally, FotoWeb cannot be embedded into iframes on domains that are not of the same origin. However, the embeddable widgets (Selection Widgets and Export Widget) are exempt from this rule. These widgets work in an iframe because they are designed to be embedded into other applications as part of integrations.

The following rules apply:

  1. Internal iframes (Fotoweb pages embedding other FotoWeb pages) are allowed.
  2. Same origin iframes (third-party page on the same host embeds FotoWeb) are allowed.
  3. Cross-origin iframes (third-party page on a different host embeds FotoWeb) are blocked.
  4. Cross-origin iframes embedding the widgets are allowed.

You can embed an application using the FotoWeb widgets into an HTML <iframe> on some other web page or web application. For security reasons, the FotoWeb login form cannot be loaded into an iframe. Therefore, some extra work is required in such scenarios.

As an example, consider the following setup:

  • A FotoWeb site, e.g., acme.fotoware.cloud.
  • A CMS system, e.g., blog.coyote.com.
  • A CMS plugin from a third party, apps.acme.com.

In this example, the CMS system embeds the plugin in an iframe. The plugin is an application using embeddable FotoWeb widgets that connect to the FotoWeb site.

When the user authorizes the plugin to connect to FotoWeb, the iframe displays a blank page instead of a FotoWeb login form because of a content security policy. The following approach can be used to work around this limitation:

  1. Instead of navigating to the authorization URL (https://acme.fotoware.cloud/fotoweb/oauth2/authorize/...) directly, open it in a new browser tab or window (authorization tab).
  2. Use browser local storage and storage events for communication between the main application (in the iframe) and the authorization tab.

This authorization flow SHOULD be triggered by a user action (the user selecting Log in, for example), so the browser will not block the authorization tab as a potentially unwanted popup.

application aids utilizing tools

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Uploading files from the Selection widget
  • Upload Files
  • Upload Folders
  • How to create a Selection Widget integration with the Fotoware API
eco-lighthouse-miljøfyrtårn

Company

  • About us
  • Resellers
  • Careers
  • Contact us

Help & support

  • Support center
  • Consultancy
  • Tech partners
  • Fotostation
  • System status

Trust Center

  • Legal
  • Security
  • Sustainability & ESG

Locations

Fotoware AS (HQ)
Tollbugata 35
0157 OSLO
Norway
FotoWare Switzerland AG
Industriestrasse 25
5033 Buchs (AG)
Switzerland

Copyright 2025 Fotoware All rights reserved.

  • Terms of service
  • Privacy policy
  • Cookie policy

Knowledge Base Software powered by Helpjuice

Expand