Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Fetch Resources of a Product  (Read 8915 times)

Offline Rawinder Dhillon

  • Newbie
  • *
  • Posts: 24
  • Karma: +5/-0
    • View Profile
Fetch Resources of a Product
« on: February 18, 2021, 02:55:16 AM »
Hi,
i want to fetch all the images i uploaded on website through API of a particular product
with rt=a/product/product
it returns only Main image (one Url)
but i want all to display in android APP
i tried
a/product/resources
but it returns empty response on "Postman"

can someone plz help

output of a/product/resources (this product has 3 images)
{
    "total": 6,
    "resources": [
        {
            "type_id": "1",
            "type_name": "image",
            "default_directory": "image/",
            "default_icon": "icon_resource_image.png",
            "file_types": "/.+(jpe?g|gif|png|ico|svg|svgz|webp)$/i",
            "access_type": "0"
        },
        {
            "type_id": "2",
            "type_name": "audio",
            "default_directory": "audio/",
            "default_icon": "icon_resource_audio.png",
            "file_types": "/.+(mp3|wav)$/i",
            "access_type": "0"
        },
        {
            "type_id": "3",
            "type_name": "video",
            "default_directory": "video/",
            "default_icon": "icon_resource_video.png",
            "file_types": "/.+(avi|mpg|mov|flv)$/i",
            "access_type": "0"
        },
        {
            "type_id": "4",
            "type_name": "pdf",
            "default_directory": "pdf_document/",
            "default_icon": "icon_resource_pdf.png",
            "file_types": "/.+(pdf)$/i",
            "access_type": "0"
        },
        {
            "type_id": "5",
            "type_name": "archive",
            "default_directory": "archive/",
            "default_icon": "icon_resource_archive.png",
            "file_types": "/.+(zip|rar|gz|7z)$/i",
            "access_type": "1"
        },
        {
            "type_id": "6",
            "type_name": "download",
            "default_directory": "download/",
            "default_icon": "icon_resource_download.png",
            "file_types": "/.+$/i",
            "access_type": "1"
        }
    ]
}

Offline dvagner

  • Core/UI Developer
  • Jr. Member
  • **
  • Posts: 73
  • Karma: +28/-1
    • View Profile
Re: Fetch Resources of a Product
« Reply #1 on: February 18, 2021, 03:34:00 AM »
Abantecart not have api for return all resources of products.
You can extend api via new extension.
Please see, it can help you:
https://abantecart.atlassian.net/wiki/spaces/DOC/pages/17695186/Catalog+API+Requests+Parameters+and+Responses#CatalogAPI:Requests,ParametersandResponses-GetProductResources

Offline Rawinder Dhillon

  • Newbie
  • *
  • Posts: 24
  • Karma: +5/-0
    • View Profile
Re: Fetch Resources of a Product
« Reply #2 on: February 18, 2021, 08:40:37 AM »
ok, Thx

 

Powered by SMFPacks Social Login Mod