How to use Magento2 custom APIs in VSF

Hello all, a VSF newbie here, can someone tell me how to use Magento2 custom APIs in VSF. Ex.We have a several groups for products, I need to import these group names to VSF. We have created a custom Magento api for this, which will return list of group names. How I can get these data in VSF?

@sree8637 If you have custom API endpoints that you need to consume you can extend the API in VS following the documentation here - https://docs.vuestorefront.io/guide/extensions/extending-api.html.

From there it depends - if it’s data you want to store in ElasticSearch you’ll need to pump the data accordingly - extend mage2vs to grab your data or extend the M2 vsbridge module to reindex your data. If you are going to call this endpoint directly (like VS does for things like cart/checkout actions) then you can create a module in VS to make the calls accordingly. Here is some documentation about how to get started on this part.

Hi therre please also take a look at the https://github.com/DivanteLtd/magento2-rest-client#usage - there is a doc on how to extend it to support another Magento api methods

@rain2o, @pkarw thanks for your valuable comments, I was able to pull the data to ES using mage2vs. Now I need to bring this data to VSF, so for that I need to create a custom module (/src/module/new-module)on VSF and make calls to import the ES data ?

Hi @sree8637, have you found any solution to get new data from ES?