akeneo_api_client 1.0.4 copy "akeneo_api_client: ^1.0.4" to clipboard
akeneo_api_client: ^1.0.4 copied to clipboard

A Dart library for Akeneo PIM API integration, simplifying product management tasks and interactions with Akeneo systems.

Akeneo API Client for Flutter #

A Flutter library for consuming Akeneo PIM's RESTful API. This library provides a convenient way to interact with the Akeneo API to manage attributes, attribute options, families, categories, and products.

Features #

  • Authenticate with the Akeneo API using OAuth2 credentials.
  • Handle token refreshing automatically for extended sessions.
  • Convenient methods for creating, retrieving, updating, and deleting various entities.

Usage #

Importing #

import 'package:akeneo_api_client/akeneo_api_client.dart';

Initializing the Client #

var apiClient = AkeneoApiClient(
  endpoint: Uri.parse("http://localhost:8080"),
  clientId: "your-client-id",
  clientSecret: "your-client-secret",
  userName: "your-username",
  password: "your-password",
);

CRUD Operations #

// Create an attribute
var attribute = Attribute(
        code: 'test_attr',
        type: AttributeType.text.value,
        group: 'test_group',
      );
await apiClient.createAttribute(attribute);

// Get an attribute
var attributeCode = 'color';
var retrievedAttribute = await apiClient.getAttribute(attributeCode);

// Update an attribute
var updatedAttribute = retrievedAttribute.copyWith(labels: {
        'en_US': 'Color',
      });
await apiClient.updateAttribute(updatedAttribute);

Handling Other Entities #

Likewise, you can utilize the createEntity, getEntity, and updateEntity methods for various aspects such as attribute options, families, categories, and products. Just replace "entity" with the specific name of the element you are working with.

Getting Images with Authentication #

To get an image with authentication:

var url = apiClient.getMediaFileUrl(attribute.value.data);
var authHeader = {'Authorization': apiClient.bearerToken};

Contributing #

Contributions are welcome! If you encounter bugs or have suggestions for improvements, please open an issue or create a pull request.

License #

This project is licensed under the MIT License - see the LICENSE file for details.

2
likes
160
points
38
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart library for Akeneo PIM API integration, simplifying product management tasks and interactions with Akeneo systems.

Repository (GitHub)

Topics

#akeneo #api #client

Documentation

API reference

License

MIT (license)

Dependencies

http

More

Packages that depend on akeneo_api_client