1

I have a table, where I am storing data for home page slider. (home_slider) I have also created a module for updating slider from backend.

Now I want to add a custom API request in existing Magento rest API to fetch active sliders for mobile APP.

If you don't want to share code then it's ok, please guide me the path how can I achieve this?

3
  • you can do it by controller and creating custom webapi endpoint
    – fmsthird
    Mar 22, 2019 at 14:58
  • why custom? why can't I use magento default API and add new request for slider? I am by doing this I don't need new authentication, and this could be a good coding practice.
    – Asim Ali
    Mar 22, 2019 at 15:46
  • 1
    Thanks @magefms, can you put this in answer? I will mark it then
    – Asim Ali
    Mar 27, 2019 at 7:30

1 Answer 1

1

Magento isn't contained REST API for banners. So I see two ways,

  1. You can create your custom Magento extension, where you will be adding banners data and provide your API endpoints to get this data via REST.

  2. you can store banner data inside cms block and fetch with default REST API like

    /V1/cmsBlock/:blockId

For web part usually used Cms Block where you can place banners with simple html/css/javascript.

Answer Reference: Here by Dmitri

1
  • 1
    Thanks magefms :)
    – Asim Ali
    Mar 27, 2019 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.