Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In Optimizely we have created a new ApiControllercontroller, which is located at the following route [siteUrl]/episerver/digizuite/DigizuiteWebhook/Update. This is the endpoint that receives notifications from Digizuite. An important thing to note here is, that the endpoint should be reachable by the Digizuite server. Otherwise, the notifications won't be sent. This is usually the case for developers on local environments.

...

As a developer, you can also build your own logic around notifications from Digizuite. You can listen for the event by subscribing to the event, just like we do above.

1. Setup the endpoint

Open the Optimizely’s web.config and locate the Digizuite node. Beneath this node, there’s a node called “digizuiteIntegration”. This is the one we need to updateIn your startup class where you have added the DAMIntegrationConfiguration we add a new property DigizuiteWebhookElement. Here you see an example where it has been configured:

<digizuiteIntegration siteUrl=
Code Block
languagexml
c#
DigizuiteWebhookElement = new DigizuiteWebhookElement()
{
    SiteUrl = "http://myyour.episerverSiteoptimizely.dksite" guid="e01553bd-f66a-4fba-8b6b-884133d8ae80" subscriptions="1" deleteBlob="false"/>

...

,
    Guid = "dad72732-06f0-4468-a98a-1eb7449bf2fd"   
}

The DigizuiteWebhookElement has 2 required properties SiteUrl and Guid.

The SiteUrl is the URL to your Episerver’s Optimizely site.

In guid Guid, you input the same GUID which is found in the customHeaders field inside Media Manager → General settings → Integrations → Your Optimizely integration → Custom headers. In here - the header should be formatting something like this “Authorization:e01553bd-f66a-4fba-8b6b-884133d8ae80“, where the GUID is just a random one you generate. The GUID a new guid. The guid is the unique identifier when we create the new endpoint i Digizuite DAM. The guid will also be send with the request from Digizuite as an header like this Authorization: dad72732-06f0-4468-a98a-1eb7449bf2fd. This is used to validate that the notifications come from the correct sender.

The parameter subscriptions indicates which “change type” you want to listen for. The possible values All properites for DigizuiteWebhookElement can be found here DFO 3.0.0 - 3 Setting up Optimizely. The default value is 1 - that being the ID of the “AssetChanged” event.

The last parameter deleteBlob indicates whether we should delete blobs of the asset. In a load balanced environment, where you have multiple instances in which each of the instances contains its own local blob storage, this should be set to true. If the blob storage is shared between instances, leave it as false.

Once the change has been made, reload the site. You will now see the following log statement in the file Digizuite.log (Of course, this will only appear if Digizuite logging has been enabled):

...

if it has been setup correctly and the endpoint has been created in Digizuite DAM.

Code Block
info: Digizuite.Optimizely.DigizuiteClient[0]
      Digizuite Webhooks Initialized

2. Verify the connection

Once you have access to the Digizuite server. Open a browser from that server and access your Optimizely site. If you cannot access the site, Digizuite won't be able to send notifications to it.

If the server can access your site, the next test is to change an asset in the Digizuite DAM Center and verify that the notification has been sent to Optimizely.

...

Change the log level for the logger “Digizuite.Episerver.Helpers.Internal.Logger” to Debug or All.

...

.

  1. Go to the DAM Center and find an asset that is published to the Optimizely channel.

  2. Change some of the metadata, e.g. the title. The Digizuite DAM will notify all registered integration endpoints with the update.

  3. You should see the following log statement in the log file Digizuite.log. This indicates that Digizuite DAM has delivered the notification to the api controller inside Optimizely.

    Code Block
    2020-05-15 11:20:45,828 [20] DEBUG DigizuiteIntegrationController::Update: DigizuiteIntegrationinfo: Digizuite.Optimizely.Controllers.DigizuiteWebhookController[0]
          Update: DigizuiteWebhook Event, Type:1 ItemId:39581010647 AssetId:3247392

  4. Lastly, verify that the changed metadata is the same as in Optimizely.

...