Pergunta

How to manage Banner module for Web and Mobile Application as per service contact standards and REST API ?

  • Should i make different modules for mobile and web ?
  • Or it can be manageable by common ?
Foi útil?

Solução

As I know 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.

Outras dicas

It returns image ULR that can only be used on a PHTML file. We can't use that in mobile app. What's the point of giving such image src in rest api. See the content filed returned from the REST API rest/V1/cmsBlock/:{blockId}

"content": "<p><img src=\"{{media url=&quot;banner1.jpg&quot;}}\" alt=\"\"></p>"
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top