Zen Cart Logo
Forums / Code Collaboration / Connecting to external APIs to pass product information

Connecting to external APIs to pass product information

Views: 14,328

Results 1 to 7 of 7
5 Nov 2019, 2:22 AM
#1
icecold avatar

icecold

Zen Follower

Join Date:
Jul 2008
Posts:
360
Plugin Contributions:
0

Connecting to external APIs to pass product information

I started to learn about the QueryBuilder, because I need to pass product info, just basic, name, description, stock and price to an API in a CRM, but so far I couldn't find more information on the subject of using APIs to connect to external applications, I will probably use a curl method and json to send the data, to the recipient's database, as I already have an automated inventory system, the only thing I need is to pull the data and connect to the other app's API, to pass it, probably using automation as well.

This process will be in the background, initially for connecting to my CRM, then probably using it to pass data to marketplaces, it's a nightmare to manually fix thousands of products, even using spreadsheets, on a daily basis, so uploading an updated, current, accurate inventory is a must, as I couldn't find any current solutions to do this, I will write my own, just looking for some hints and common practices, about where to look to get the info I need to build the apps.

Please don't suggest to hire someone, because I am in a dire economic situation, just using my brains and my knowledge to accomplish something by myself.

[Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

5 Nov 2019, 9:34 AM
#2
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,866
Plugin Contributions:
7

Re: Connecting to external APIs to pass product information

Well, I keep banging on about this...Pentaho Data Integration Community.
In short it is a method to get data from A, manipulate it in multiple simple steps, then send it to B. A and B can be any database or filetype.
I use it to extract product data from a dBase legacy system to a csv, then use my own script to get that into my shop db. Pentaho could do it all but I have a lot of oddities that need special treatment and I did that in the script.
Pentaho can produce a job file that can be run automatically.

5 Nov 2019, 9:54 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Connecting to external APIs to pass product information

EasyPopulate V4 has a cron task that can import a file to the database. Haven't incorporated export directly into a cron task yet. Hadn't really been asked and I haven't had a reason to have it yet.

6 Nov 2019, 1:51 AM
#4
icecold avatar

icecold

Zen Follower

Join Date:
Jul 2008
Posts:
360
Plugin Contributions:
0

Re: Connecting to external APIs to pass product information

torvista:

Well, I keep banging on about this...Pentaho Data Integration Community.
In short it is a method to get data from A, manipulate it in multiple simple steps, then send it to B. A and B can be any database or filetype.
I use it to extract product data from a dBase legacy system to a csv, then use my own script to get that into my shop db. Pentaho could do it all but I have a lot of oddities that need special treatment and I did that in the script.
Pentaho can produce a job file that can be run automatically.

Well Torvista! Thanks for the tip! I'll look into Pentaho, I was looking at some solutions, my idea was to query the db, and then with the data stored somewhere create a csv and then use js to generate a JSON file. As there's no API for zencart to connect to other platforms I was planning to do something custom, but wasn't sure if I would run into conflicts, if I used the Zen Cart Query suite just to retrieve information directly from products instead of doing joins to achieve the same result using plain SQL.

BTW I noticed you ported Apsona to PHP 7, is it still working? I do have an old ID, it was pretty good to check prices and inventories, although I made my own custom auto inventory system, my problem is I can't find a way to prevent the system from using the default images directory for product images, instead of my cloud URL, it does work sometimes, but not with Zoomed
images, I use a jQuery plugin to navigate the zooomed ones the problem is the template adds ```
https://www.mydomain.com/shop/images/https://www.mycloud.com

7 Aug 2020, 2:18 PM
#5
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,866
Plugin Contributions:
7

Re: Connecting to external APIs to pass product information

I use DBIO instead of Apsona, so should everyone. Makes no sense to use long-unsupported code when there is an alternative.

Pentaho can do anything. Often it is not intuitive and frustrating, lots of trial and error but it is worth the effort.

7 Aug 2020, 3:01 PM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Connecting to external APIs to pass product information

Steve, is Pentaho something you'd be willing to write up in the documentation for the community?

7 Aug 2020, 4:13 PM
#7
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,866
Plugin Contributions:
7

Re: Connecting to external APIs to pass product information

To be honest I can't add anything more...it's a Swiss Army Knife of data manipulation. I used it x years ago to set up the data extraction process, and have not used it for anything else since, not hardly touched the "job" that does the extraction. It's just worth knowing that such an open source tool exists.