Product Attachments API Overview

Product Attachments API

Info
We have created a public API collection for Product Attachments module with all available queries and sample data that you can both test via our demo endpoints and copy to run local tests in your Magento environment. More details about using public collections can be found in the following FAQ post.

API functionality for Product Attachments is available with the API for Product Attachments Add-On only.

1. Amasty\ProductAttachmentApi\Api\FrontendAttachmentInterface - class for getting product attachments on frontend:
  1. GET /V1/amasty_product_attachment/getByProductId, method="getByProductId" - get an attachmetn by product ID;
  2. GET /V1/amasty_product_attachment/getByCategoryId, method="getByCategoryId" - get an attachment by category ID;
  3. GET /V1/amasty_product_attachment/getByFileIds, method="getByFileIds" - get an attachment by file ID.
2. Amasty\ProductAttachmentApi\Api\DownloadFileInterface - class for downloading files:
  1. GET /V1/amasty_product_attachment/download, method="download" - download a file.
3. Amasty\ProductAttachmentApi\Api\UploadFileInterface - class for uploading files (attachments):
  1. POST /V1/amasty_product_attachment/filemanage/uploadFile, method="upload" - upload a file.
4. Amasty\ProductAttachmentApi\Api\BackendAttachmentInterface - class for managed attachments in backend:
  1. GET /V1/amasty_product_attachment/filemanage/:fileId, method="getById" - get information about an attachment;
  2. POST /V1/amasty_product_attachment/filemanage, method="save" - create an attachment;
  3. PUT /V1/amasty_product_attachment/filemanage/:fileId, method="save" - edit an attachment;
  4. DELETE /V1/amasty_product_attachment/filemanage/:fileId, method="deleteById" - delete an attachment;
  5. GET /V1/amasty_product_attachment/filemanage/files, method="getList" - get a list of all attachments.

      • Related Articles

      • What Amasty extensions support API?

        Each Amasty extension that has API support, includes the etc/webapi.xml file. The webapi.xml file contains API configurations with the list of available API requests. For example, a request from the Custom Form module interface: 1 - endpoint URL; 2 - ...
      • Can I test how your modules work with API?

        Our team have created a public Postman workspace where we provide access to API collections from our modules. You can copy these API collections to test them in your own Magento installation together with our modules, and some collections can be ...
      • Product Attachments | GraphQL methods

        Queries getAmProductAttachmentSettings description: get Product Attachment module settings getAmFiles (ids: [Int]) description: get info about uploaded files
      • How to add product attachments to a CMS page?

        Product attachments can be added to CMS pages via Magento widgets, and there are two methods to do that. Method #1 Step 1. At Magento admin → Content → Widgets, create a widget of the Amasty Attachments Block type, choose Design Theme and click ...
      • Product Labels API

        We have created a public API collection for Product Labels module with all available queries and sample data that you can both test via our demo endpoints and copy to run local tests in your Magento environment. More details about using public ...