0

I am working on integrating a 3rd Party API into Magento. I'd like to use an Admin Grid with a Data Source that comes from a 3rd party API. So Essentially the Flow work like this... User Loads into admin page with grid -> grid has data source specified to resource model -> resource model calls 3rd party api to get data -> data is returned to resource model(not sure if its supposed to be resource model or collection or factory in this scenario) -> data is bind through the resource model to the grid.

If there's any additional information needed please let me know. I'm not sure what all information might be helpful.

1
  • There is a simple way and imho, a better way to do this. You create a cron to constantly pull data into your database and then make use of that data as normal grid
    – Jimmy
    Apr 17, 2021 at 3:41

1 Answer 1

0

I have never implemented a kind of complex integration like that, but I think you can base your code to the ElasticSearch connection. I know that you are working on Magento 2.3, and I do not remember which version of Magento require ES as default service, but even if you do not have the ES library you can analyze how it works here:

https://github.com/Smile-SA/elasticsuite/blob/2.10.x/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php

But firstly, you can try to check it locally:

vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php

That collection extends Magento catalog collection but reimplement part of the code to access the ES API.

Collections have a bunch of methods that you will have to implement. It will not be an easy task.

Good Luck

1
  • would you have any recommendations on how to get data into a Magento grid from a 3rd party API? Just curious if I’m over complicating this or not!
    – jtaylo13
    Apr 17, 2021 at 3:30

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.