Skip to content

Service Contracts

Stanislav Idolov edited this page May 6, 2019 · 11 revisions

Search API

The search API endpoint is the main source of Adobe Stock assets and should be configurable and extensible. We encourage the re-usage of Magento framework interfaces is such cases.

Image List Interface

interface GetImageListInterface
{
    /**
     * @param SearchCriteriaInterface $searchCriteria
     * @return SearchResultsInterface
     */
    public function execute(SearchCriteriaInterface $searchCriteria) : SearchResultsInterface;
}

The interface accepts search criteria object that implements generic framework interface: \Magento\Framework\Api\SearchCriteriaInterface. The returned object will implement \Magento\Framework\Api\SearchResultsInterface interface that also defined in Magento framework.

Save Image Preview API

interface SaveImagePreviewInterface
{
    /**
     * @param int $mediaId
     * @return bool
     */
    public function execute(int $mediaId): bool;
}

Save Licensed Image API

interface SaveLicensedImageInterface
{
    /**
     * @param int $mediaId
     * @return bool
     */
    public function execute(int $mediaId): bool;
}
Clone this wiki locally