The Akeneo Webhooks is an easy way to get updates from Akeneo PIM in external systems and bear an additional value such as setting up multiple endpoints via Akeneo UI, re-trying Webhooks and defining the detail level of information to include into the Webhook.
- UI for endpoint set up - enables user easily handle integrations network with external data receivers
- Multiple endpoints - enabling user to connect all his network to single Product data source
- Re-trying webhooks - minimise risk of failed webhooks import and failed updates, as the extension gives possibility to retrigger failed webhooks for a certain amount of attempts
- With Details - enables users to see content of received webhooks by giving the possibility to send a "blank message" (an identifier value) or an "entire message" (full data)
When an event happens in Akeneo PIM, the Webhook ad-on sends it in real-time to the provided endpoints (URLs), formatting information in JSON, by using HTTP request method PUT.
Webhooks sends information about these Akeneo PIM items (created/updated/deleted):
- family (codename: family)
- family variant (codename: family_variant)
- attribute (codename: attribute)
- attribute option (codename: attribute_option)
- productmodel (code name: productmodel)
- product (code name: product)
Whenever the Akeneo item will be saved or deleted, all existing configured endpoints will be triggered and will send the item information and the event name.
Contact and Support:
We expect you to have Akeneo PIM installed. If you do not have it yet then follow the official steps to install one of the following Akeneo PIM versions:
Install extension dependencies
- Install the required PimCustomEntityBundle dependency, make sure it works.
Install extension on Pim Docker installation
Add the following line into
docker-compose.override.yml file under
services > fpm > volumes section to enable ssh key access for fpm container:
and run the following command to make config changes effective:
docker-compose up -d
Add Webhooks extension repository to
docker-compose exec fpm php -d memory_limit=3G /usr/local/bin/composer config repositories.akeneo-webhooks vcs ssh://firstname.lastname@example.org:22/emtn/akeneo-webhooks.git
Install Webhooks extension:
docker-compose exec fpm php -d memory_limit=3G /usr/local/bin/composer require emtn/akeneo-webhooks:dev-master
Register Webhooks extension bundle by adding the following lines to
registerProjectBundles() method return array:
Perform Doctrine migrations to create tables required by Webhooks extension:
cp vendor/emtn/akeneo-webhooks/Upgrade/Schema/Version_3_0_20200528075009_emotion_webooks_install.php upgrades/schema/Version_3_0_20200528075009_emotion_webooks_install.php
docker-compose exec fpm bin/console doctrine:migrations:execute _3_0_20200528075009_emotion_webooks_install --up --no-interaction
Clear the cache by running:
docker-compose exec fpm rm -rf /srv/pim/var/cache/* && rm -rf var/cache/*
That is it.
This Webhooks extension is written as a Symfony bundle which listens for Akeneo StorageEvents and triggers a call to a predefined website.
Akeneo StorageEvents: https://docs.akeneo.com/3.0/technical_architecture/events/index.html#events
Webhook endpoint setup
Extension is configurable from Akeneo UI. Click on the 'Webhooks' icon and 'Create' button and fill the fields:
- Event -
akeneo.storage.post_save- to be notified on create and update only,
akeneo.storage.post_remove- on remove only
- Endpoint - URL to where a call must be made if event happens. Additional parameters will be added to URL at the end at the moment of the actual call.
- Level of Detail -
Yes- in case you want as much info as possible to be passed to the endpoint
No- in case you want as little info on the item as possible.
After the product changes in Akeneo backend, JSON will be sent to the endpoint.
Akeneo webhook queue
Akeneo jobs' queue is used for calling endpoints - one call results to one Akeneo job created in the queue.
pim-webhooks:retrigger-failed-webhooks --time=1540857600- The command triggers failed and logged webhook requests again. Time parameter (timestamp) is to trigger webhooks starting from a particular date.
pim-webhooks:delete-logged-webhooks --time=1540857600- The command deletes resolved webhook requests from the webhooks log table. Unresolved webhook requests have a flag 0, solved - 1, outdated - 2. Time parameter (timestamp) is to delete webhooks starting from a particular date.
pim-webhooks:clean-legacy-webhooks- Removes webhook history: 1. Log records of non-existing endpoints; 2. Log records of non-existing models, products, attributes, attribute options, families, family variants.
pim-webhooks:export-listed-items --prlist=/tmp/model2export.csv- The command exports product models or products listed in a file. Utility to export product models or products en masse. Triggers 'save' action in Akeneo and therefore a webhook request.