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?

asked Mar 22, 2019 at 14:52
3
  • you can do it by controller and creating custom webapi endpoint Commented 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. Commented Mar 22, 2019 at 15:46
  • 1
    Thanks @magefms, can you put this in answer? I will mark it then Commented 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

answered Mar 27, 2019 at 7:34
1
  • 1
    Thanks magefms :) Commented Mar 27, 2019 at 7:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.