1

I am developing service contact in Magento 2 for Mobile Application purpose.

And i am getting data for specific APIs in POSTMAN like

  • Customer Account Data
  • Register | create Account
  • Add product in Cart
  • Get CMS pages data
  • Fetch Categories

And in response i am fetching precise data (POSTMAN using url)

Now my concern is How to merge all this REST APIs for mobile Application.

Like example for Mobile Application Home page.

I need to merge 5-6 APIs to give mobile developer.

Like an example for Home page

I need to give APIs like for Home page

  1. Category [http://magento.host/rest/V1/categories/61]
  2. Banners [http://magento.host/rest//V1/cmsPage/:pageId]
  3. Recently viewed products
  4. Top Brands (Custome module)

So, how i can manage all this API in to one ?

Do i need to merge all these APIs ?

Or mobile developer will manage it by individual ?

Please help me out from this, Thanks in advance.

  • 3
    Why do you need to merge all apis in to one. You can give the individual apis to mob developer. They will consume one by one. This is the best practice, when you have to change one content type)(ex:banner), they just need to update that particular api. If underlying data resides in one single table, your idea make sense. I don't think that's your case. – Rinto George Jul 16 '18 at 7:57
  • 1
    @RintoGeorge - I am also looking for the solution on this. For getting performance at mobile side we have to merge all APIs into one and response will be handled by mob developer by accessing through only 1 API call. – Bijal Bhavsar Jul 16 '18 at 8:21
  • 1
    @BijalBhavsar Combining all services to one not all that significant, rather ensure the request loaded in parallell without blocking one another. REST apis has the ability to cache. When we combine to one api, the smallest update may need to download the whole chunk of data. – Rinto George Jul 16 '18 at 8:33
  • 1
    @RintoGeorge - Yes, but we cannot compromise the performance of the APP. – Bijal Bhavsar Jul 16 '18 at 9:01
  • 1
    @RintoGeorge But every single rest API has a Authorization Bearer <token> so on every rest API will pass through Oauth. so if home page have 5 APIs then it will check Authorization Bearer 5 times, so wouldn't it take long time ? – Aditya Shah Jul 16 '18 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.