-
Notifications
You must be signed in to change notification settings - Fork 91
Implementation Guide
Stanislav Idolov edited this page Apr 25, 2019
·
21 revisions
To provide access to the Adobe Stock API it's required to implement authentication mechanisms:
-
API Key
should be enough for images search and preview download. How to configure -
oAuth2
for access to the licensed content. Documentation
- Server to server image upload It should be possible to upload an image from the URL (that's how's preview working)
interface UploadImagePreviewInterface
{
/**
* @param string $url
* @param ImageMetadataInterface $imageMetadata
* @return bool
*/
public function execute(string $url, ImageMetadataInterface $imageMetadata) : bool;
}
- Upload image from base64 encoded string Provide the ability to upload an image from base64 encoded string (licensed image upload)
interface UploadLicensedImageInterface
{
/**
* @param string $encodedImage
* @param ImageMetadataInterface $imageMetadata
* @return bool
*/
public function execute(string $encodedImage, ImageMetadataInterface $imageMetadata) : bool;
}
To make at least search requests Adobe integration should be created. Provided API access information should be stored in Magento via standard configuration framework.
-
x-api-key
- required field for any request (can be obtained from the Adobe integration configuration) -
x-Product
- can be obtained from the Adobe integration configuration (integration name)
In order to implement replace preview to licensed image functionality, we should store information about the uploaded image. Consider storing as much info as we can to simplify further features development.
Name | Description | Type |
---|---|---|
category{id} | information about the category assigned to the asset | int |
category{name} | information about the category assigned to the asset | string |
comp_height | Height in pixels of the asset's complementary (unlicensed) image | int |
comp_url | URL to the watermarked version of the asset | string |
comp_width | Width in pixels of the asset's complementary (unlicensed) image | int |
content_type | Mime type of the asset's content. | string |
country_name | string | |
creation_date | Date on which the asset was created | date |
creator_id | Unique identifier for the asset's creator. | int |
creator_name | Asset creator's name | string |
details_url | URL to the Adobe Stock details page for the asset. If you pass the Authorization header with the call, Adobe Stock generates an SSO jump URL. | string |
id | Asset's unique identifier. | int |
is_licensed | license applied | string |
keywords | List of localized keywords for the asset. | array |
media_type_id | Type of the asset | int |
premium_level_id | Asset's premium (pricing) level. | int |
title | Asset's title | string |
- Usage of Magento UI component is mandatory for the project.
- Adobe Stock Image Integration should be implemented as default Magento slide out panel.