Akeneo Group Attribute Family Advanced API: Some of the rest of API’s default endpoints are now unavailable in Akeneo.
With this in mind, we’ve developed this module to help you in extending the Akeneo rest API to incorporate data.
However, the API provides a number of options for expanding and customizing the services that are accessible.
Similarly, extensions to the resource service GET, POST, PATCH, and DELETE methods are used to visit your own endpoints.
Basic Requirements
- This module works with Akeneo 4.0.x and as well as 5.0.x. Download Akeneo from here
- Node and as well as Yarn packages need to be installed.
- However, this module is compatible with the Akeneo community and Enterprise(Flexibility) edition.
- If you want to use this extension on Akeneo EE Serenity mode, then please contact us.
- For the Akeneo installation, your Akeneo server should meet these system requirements.
Features
- Create Group Types using the API using this module.
- This module allows you to fetch all group types API.
- This module allows you to fetch, update, and as well as delete specific group types API.
- However, you can use this module to get, update, and remove specified groups’ API.
- You can use this module to get a list of the group API.
- Similarly, using this module you can delete specific attributes as well as attribute options API.
- However, you can delete a certain attribute group API with the help of this module.
- However, you can delete specific families and family variants API with this module.
Manual Installation
Please follow these steps for installing the Akeneo API Extends module in your Akeneo PIM platform.
1 – Unzip the respective extension zip then merge the “src” folder into the akeneo project root directory.
2 – After that goto config/Bundles.php then add the line:
Webkul\AkeneoApiExtendsBundle\AkeneoApiExtendsBundle::class => ['all' => true],
in return array.
3 – Then copy the “config” folder into the akeneo project root directory for routing.
4 – After that, run this command after ssh to your akeneo server by the terminal
php bin/console ca:cl --env=prod;php bin/console wk-extendapi:setup:install --env=prod;
5. Then if you are using php-fpm. Then you need to restart the php-fpm services and apache web server.
For Akeneo 5
After that, for Akeneo 5 run the below command –
sudo service php-fpm7.4 restart
For Akeneo 4
Then for Akeneo 4 run the below command –
sudo service php-fpm7.3 restart
Docker Installation Command :
For Akeneo 5
After that, for Akeneo 5 run the below command for docker installation –
alias docker_php='docker-compose run -u www-data --rm php php'; alias docker_yarn='docker-compose run -u node --rm node yarn'; docker_php bin/console cache:clear --env=prod; docker_php bin/console pim:installer:assets --symlink --clean --env=prod; docker_php bin/console d:s:u --force; docker_yarn run webpack; docker_yarn run update-extensions; docker_yarn run less;
For Akeneo 4
Then for Akeneo 4 run the below command for docker installation –
alias docker_php='docker-compose run -u www-data --rm php php'; alias docker_yarn='docker-compose run -u node --rm node yarn'; docker_php bin/console cache:clear --env=prod; docker_php bin/console pim:installer:assets --symlink --clean --env=prod; docker_php bin/console d:s:u --force; docker_yarn run webpack; docker_yarn run less;
How To Use – API
After that, use the unavailable Akeneo PIM API check below are some of the rest of API’s default endpoints that are now unavailable in Akeneo.
1 – Description: Delete Attribute
API resource :{{url}}/api/configuration/attribute/{code}
However, to delete an attribute that is created using attribute code
Method: DELETE
NOTE – Similarly, you can delete certain attribute groups, specific family/family variants, and specific attribute/attribute option
Following that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
{ "message": "Attribute deleted successfully" }
2 – Delete Attribute Group
API resource :{{url}}/api/configuration/attribute-group/{identifier}
However, to delete an attribute group that is created using attribute group code
Method: DELETE
Following that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
{ "message": "Attribute Group deleted successfully" }
3 – Description: Delete Attribute Option
API resource :{{url}}/api/configuration/attribute-option/{attributeId}/{attributeOptionId}
For Example –
22/30{{url}}/api/configuration/attribute-option/
However, to delete an attribute option that is created using attribute id and attribute option code
Method: DELETE
Following that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
{ "message": "Attribute Option deleted successfully" }
4 – Description: Delete Family
API resource :{{url}}/api/configuration/rest/family/{code}
However, to delete a family that is created using family code
Method: DELETE
Following that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
{ "message": "Family deleted successfully" }
5 – Description: Delete Family Variant
API resource :{{url}}/api/configuration/rest/family-variant/{familyVariantCode}
However, to delete a family variant that is created using family variant code
Method: DELETE
Following that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
{ "message": "Family Variant deleted successfully" }
6 – Description: Search Group
API resource :{{url}}/api/enrich/group/rest/search
Method: GET
Following that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
{ "results": [ { "id": "Manufacture", "text": "[Manufacture]" } ] }
7- Description: Specific Group Get
API resource :{{url}}/api/enrich/group/rest/{identifier}
Method: GET
Following that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
{ "code": "Manufacture", "type": "RELATED", "labels": { "de_DE": "Manufacture German ", "en_US": "Manufacture", "fr_FR": "Manufacture French" }, "products": [], "meta": { "id": 2, "form": "pim-group-edit-form", "structure_version": 1649413105, "model_type": "group", "created": { "id": 2079, "author": "Demo Webkul", "resource_id": "2", "snapshot": { "code": "Manufacture", "type": "RELATED" }, "changeset": { "code": { "old": "", "new": "Manufacture" }, "type": { "old": "", "new": "RELATED" } }, "context": null, "version": 1, "logged_at": "4/8/2022, 10:50 AM", "pending": false }, "updated": { "id": 2080, "author": "Demo Webkul", "resource_id": "2", "snapshot": { "code": "Manufacture", "type": "RELATED", "label-de_DE": "Manufacture German ", "label-en_US": "Manufacture", "label-fr_FR": "Manufacture French" }, "changeset": { "label-de_DE": { "old": "", "new": "Manufacture German " }, "label-en_US": { "old": "", "new": "Manufacture" }, "label-fr_FR": { "old": "", "new": "Manufacture French" } }, "context": null, "version": 2, "logged_at": "4/8/2022, 10:54 AM", "pending": false } } }
8 -Description: Create Group
API resource : {{url}}/api/enrich/group/rest/{code}
Method: POST
Following that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Content-Type – application/json
Body Raw :
{ "code": "promotion12345", "type": "RELATED", "labels": { "de_DE": "promotion12345 German", "en_US": "promotion12345 English", "fr_FR": "promotion12345 French" }, "products": [ "1111111171", "1111111130" ] }
Response:
{ "code": "promotion12345", "type": "RELATED", "labels": { "de_DE": "promotion12345 German", "en_US": "promotion12345 English", "fr_FR": "promotion12345 French" }, "products": [ "1111111171", "1111111130" ], "meta": { "id": 3, "form": "pim-group-edit-form", "structure_version": 1649418335, "model_type": "group", "created": { "id": 2120, "author": "John Doe", "resource_id": "3", "snapshot": { "code": "promotion12345", "type": "RELATED", "label-de_DE": "promotion12345 German", "label-en_US": "promotion12345 English", "label-fr_FR": "promotion12345 French" }
9. Description: Update Specific Group
However, to update the group which is created using group code
API resource : {{url}}/api/enrich/group/rest/{code}
Method: PATCH
Following that, you must check the headers after you’ve added the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Content-Type – application/json
Body Raw :
{ "code": "promotion12345", "type": "RELATED", "labels": { "de_DE": "promotion12345 G", "en_US": "promotion12345 E", "fr_FR": "promotion12345 F" }, "products": [ "1111111171", "1111111130" ] }
Response:
{ "code": "promotion12345", "type": "RELATED", "labels": { "de_DE": "promotion12345 G", "en_US": "promotion12345 E", "fr_FR": "promotion12345 F" }, "products": [ "1111111171", "1111111130" ], "meta": { "id": 3, "form": "pim-group-edit-form", "structure_version": 1649418335, "model_type": "group", "created": { "id": 2120, "author": "John Doe", "resource_id": "3", "snapshot": { "code": "promotion12345", "type": "RELATED", "label-de_DE": "promotion12345 German", "label-en_US": "promotion12345 English", "label-fr_FR": "promotion12345 French" }, "changeset": { "code": { "old": "", "new": "promotion12345" }, "type": { "old": "", "new": "RELATED" }, "label-de_DE": { "old": "", "new": "promotion12345 German" }, "label-en_US": { "old": "", "new": "promotion12345 English" }, "label-fr_FR": { "old": "", "new": "promotion12345 French" } }, "context": null, "version": 1, "logged_at": "4/8/2022, 12:05 PM", "pending": false }, "updated": { "id": 2121, "author": "John Doe", "resource_id": "3", "snapshot": { "code": "promotion12345", "type": "RELATED", "label-de_DE": "promotion12345 G", "label-en_US": "promotion12345 E", "label-fr_FR": "promotion12345 F" } }
10 – Description: Get Group List
API resource :{{url}}/api/enrich/group/rest/{identifier}/products
However, to get a group list that is you will get using identifier of the group list
Method: GET
After that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
{ "products": [ { "identifier": "1111111171", "family": "accessories", "parent": null, "groups": [ "promotion" ], "categories": [ "master_accessories_bags", "print_accessories", "supplier_zaro" ], "enabled": true, "values": { "sku": [ { "scope": null, "locale": null, "data": "1111111171" } ], "name": [ { "scope": null, "locale": null, "data": "Bag" }
11 – Description: Delete Group
API resource :{{url}}/api/enrich/group/rest/{code}
However, to delete a group that is created using group code
Method: DELETE
After that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
{ "message": "Group deleted successfully" }
12.Description: Update Specific GroupType
However, to update the group type which is created using group type code
API resource : {{url}}/api/configuration/group-type/{identifier}
Method: PATCH
Following that, you must check the headers after you’ve added the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Content-Type – application/json
Body Raw :
{ "code": "manufacture_group", "labels": { "de_DE": "Manufacture Group German", "en_US": "Manufacture Group", "fr_FR": "Manufacture Group French" } }
Response:
{ "code": "manufacture_group", "labels": { "de_DE": "Manufacture Group German", "en_US": "Manufacture Group", "fr_FR": "Manufacture Group French" }, "meta": { "structure_version": 1643003776, "id": 7, "model_type": "group_type" } }
13 – Description: Fetch All GroupType
API resource :{{url}}/api/configuration/group-type/
However, to fetch a group type that is created using
Method: GET
After that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
[ { "code": "RELATED", "labels": [], "meta": { "structure_version": 1643003776, "id": 1, "model_type": "group_type" } } ]
14 -Description: Create GroupType
API resource : {{url}}/api/configuration/group-type/
Method: POST
However, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Content-Type – application/json
Body Raw :
{ "code": "manufacture_group", "labels": { "de_DE": "Manufacture Group German", "en_US": "Manufacture Group English", "fr_FR": "Manufacture Group French" } }
Response:
{ "code": "manufacture_group", "labels": { "de_DE": "Manufacture Group German", "en_US": "Manufacture Group English", "fr_FR": "Manufacture Group French" }, "meta": { "structure_version": 1643003776, "id": 7, "model_type": "group_type" }
15 -Description: Specific Group type Get
API resource :{{url}}/api/configuration/group-type/{identifier}
Method: GET
After that, you must check the headers after you’ve added the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
[ { "code": "RELATED", "labels": [], "meta": { "structure_version": 1643003776, "id": 1, "model_type": "group_type" } } ]
16 – Description: Delete Group Type
API resource :{{url}}/api/configuration/group-type/{code}
However, to delete a group type that is created using group type code
Method: DELETE
After that, you must check the headers after adding the API resources and method.
HEADERS
Authorization - Bearer {{token}}
Response:
{ "message": "Group Type deleted successfully" }
Support
Thank you for reading this documentation. So, that was much about the User Guide of Akeneo API Extends for any queries or doubts reach out to us at [email protected]. However, you can also raise a ticket at our HelpDesk System
Please explore our Akeneo Development Services and as well as Quality Akeneo Extensions.
Current Product Version - 1.0.0
Supported Framework Version - 4.x.x & 5.x.x
Be the first to comment.