A Symfony bundle for Akeneo PIM that exposes reference data entities via a REST API.
- PHP >= 8.1
- Symfony ^5.4
- Doctrine DBAL ^2.13.4
- Akeneo PIM with
CustomEntityBundleinstalled
Install via Composer:
composer require inuar/reference-data-api-bundleRegister the bundle in your Akeneo application's config/bundles.php:
return [
// ...
Inuar\Bundle\ReferenceDataApiBundle\InuarReferenceDataApiBundle::class => ['all' => true],
];Import the bundle routes in your config/routes.yaml:
inuar_reference_data_api:
resource: "@InuarReferenceDataApiBundle/Resources/config/routing.yml"All endpoints are read-only and return JSON.
GET /rest/v1/reference-data/{entityName}
Returns an array of all records for the given entity, each normalised to the standard format.
Example:
GET /rest/v1/reference-data/color
[
{ "code": "red", "labels": { "en_US": "Red" } },
{ "code": "blue", "labels": { "en_US": "Blue" } }
]GET /rest/v1/reference-data/{entityName}/{code}
Returns a single record matching the given code. Responds with 404 Not Found if the entity type or the specific record does not exist.
Example:
GET /rest/v1/reference-data/color/red
{ "code": "red", "labels": { "en_US": "Red" } }The bundle resolves {entityName} against Akeneo's CustomEntityBundle configuration registry to find the corresponding entity class, then queries the database via Doctrine and serialises results using Akeneo's pim_serializer with the standard normalisation format.
This bundle is developed by Inuar Technology and released under the MIT license.