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?
-
you can do it by controller and creating custom webapi endpointfmsthird– fmsthird2019年03月22日 14:58:30 +00:00Commented 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– Asim Ali2019年03月22日 15:46:26 +00:00Commented Mar 22, 2019 at 15:46
-
1Thanks @magefms, can you put this in answer? I will mark it thenAsim Ali– Asim Ali2019年03月27日 07:30:41 +00:00Commented Mar 27, 2019 at 7:30
1 Answer 1
Magento isn't contained REST API for banners. So I see two ways,
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.
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