trilix / akeneo-events-api-bundle
Akeneo PIM Events API Bundle
Installs: 1 805
Dependents: 1
Suggesters: 0
Security: 0
Stars: 20
Watchers: 5
Forks: 9
Open Issues: 3
Type:symfony-bundle
Requires
- akeneo/pim-community-dev: ^5.0
- beberlei/assert: ^3.3
- guzzlehttp/guzzle: ~6.0
- psr/http-client: ^1
Requires (Dev)
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-11-10 23:11:02 UTC
README
The Events API is a smooth and easy way to build integrations that respond to activities in Akeneo PIM. All you need is PIM Events API Bundle and an endpoint where to send Akeneo PIM events.
Table of contents
Getting Started
Requirements
- Akeneo PIM >= 5.0 (CE & EE)
Installation
Install via composer:
php composer.phar require trilix/akeneo-events-api-bundle:^0.7.0
To enable the bundle add to the config/bundles.php file:
return [ // ... Trilix\EventsApiBundle\TrilixEventsApiBundle::class => ['all' => true] ]
Add the following line at the end of env file:
EVENTS_API_REQUEST_URL=your_request_url
where your_request_url
is a target location where all the events (see event types) will be delivered.
Create file config/packages/trilix_events_api.yml with the following:
trilix_events_api: transport: factory: "pim_events_api.transport_factory.http" options: request_url: "%env(EVENTS_API_REQUEST_URL)%"
Clear cache:
php bin/console cache:clear --env=prod
Run the following command to create a job to deliver events to consumer:
php bin/console akeneo:batch:create-job 'Deliver outer event to consumer' deliver_outer_event_to_consumer internal deliver_outer_event_to_consumer
Make sure Akeneo job queue daemon is running. For more information read Setting up the job queue daemon.
Functionality
How it works
Some event(s) happens in Akeneo PIM. This triggers a mechanism to send those event(s) as HTTP POST request to your Request URL. Each request contains event, with correspondent event type presented in JSON format (see example).
Events API sends one request per one event, and sending of requests happens in real-time.
Event types delivered over Events API
Example of category_updated event
{ "event_type": "category_updated", "payload": { "code": "cameras", "labels": { "de_DE": "Cameras", "en_US": "Cameras new name", "fr_FR": "Caméras" }, "parent": "master" }, "event_time": 1565021907 }
Example of product_model_removed event
{ "event_type": "product_model_removed", "payload": { "code": "derby" }, "event_time": 1579792377 }
Event Type Structure
Attention ❗
If Akeneo family contains variants, then during family update (or it's variants as well), Akeneo will re-save related products. It will trigger sending product_updated events.
License
This project is licensed under the MIT License - see the LICENSE file for details