How to pull infusionsoft product data into MySQL database PHP with PHP 7.x?

How can I pull InfusionSoft product data into MySQL database using PHP with PHP 7.x ?

Years ago I set up a PHP script that pulls the following data from the following InfusionSoft (IS) tables via queries using the PHP isdk and the API “Encrypted Key” found in the IS Admin Application Settings:

  • Product table (‘Id’, ‘ProductName’, ‘ProductPrice’, ‘Sku’, ‘ShortDescription’,‘Taxable’,‘CountryTaxable’,‘StateTaxable’,‘CityTaxable’,‘Weight’,‘IsPackage’, ‘NeedsDigitalDelivery’,‘Description’, ‘HideInStore’,‘Status’, ‘TopHTML’,‘BottomHTML’,‘ShippingTime’,‘InventoryNotifiee’,‘InventoryLimit’,‘Shippable’)

  • ProductCategory table (‘Id’, ‘CategoryDisplayName’, ‘CategoryOrder’, ‘ParentId’)

  • ProductOption table (‘Id’, ‘ProductId’, ‘Label’, ‘IsRequired’,‘Order’,‘Name’,‘MaxChars’,‘CanEndWith’,‘MinChars’,‘AllowSpaces’,‘TextMessage’,‘OptionType’,‘CanContain’,‘CanStartWith’)

  • ProductOptValue table (‘Id’, ‘ProductOptionId’, ‘Label’, ‘Sku’,‘IsDefault’,‘OptionIndex’,‘PriceAdjustment’)

  • ProductCategoryAssign table (‘Id’, ‘ProductCategoryId’, ‘ProductId’)

  • SubscriptionPlan table (‘Id’, ‘Active’, ‘Cycle’, ‘Frequency’, ‘PlanPrice’, ‘PreAuthorizeAmount’, ‘ProductId’, ‘Prorate’)

Then I put/update the selected data in/to a MySQL database on the website. The code still works if you have a compatible PHP version. That isdk is apparently legacy now, as is the table schema.

We would like to use a more current PHP version (7+), which has deleted and deprecated some of the PHP code used in the isdk and related files. I have no problem updating the code I’ve created for using the website’s database etc with the new PHP version, I do need help with the IS API code it seems, as I seem to be striking out using Keap/IS API documentation.

I’m thinking it would be best to use what the current IS API uses instead of updating the “legacy” isdk code. The thing is, I’m not seeing how to do these sort of product queries with the current IS PHP SDK… or any way to retrieve or query product data of all products.

It seems the only API code that isn’t legacy is the REST API … but that doesn’t seem to be able to get anywhere near the amount of data as what I have been getting with the legacy API. Please tell me I’m wrong, and how to get that data.

All I need to do is get the InfusionSoft data into the website database, and don’t want to send or change any of the IS data from the website.

We just want to use IS UI to update the products in IS, then manually run the PHP script I made (and can adjust for new API once I understand how) on the website server to update the website’s database with the current IS data. We only run that script when we have changed something with one of the products. We don’t track inventory, so it’s fairly infrequent, and calls to the IS API are rare. The website’s database is used for all the visits to the store by customers, etc and the IS product links are used to place purchases and/or order in the IS cart, which is used for checkout.

Thanks!

@JJonIS,

What version of the iSDK are you using (look at the remarked header)? I use the iSDK every day with PHP 7.1+ and no issues.

You also have the option of using REST but then you will be required to use OAuth for authentication. Still, it provides some options BUT it does NOT provide the access to the tables that the iSDK does.

REST does, however, provide webhooks for you to respond in real time to so maybe even a combination of the two :wink:

@John_Borelli Good to know you aren’t having issues with PHP 7.1+ and the iSDK. What version are you using? I was using iSDKVersion 1.8.5, which includes the xmlrpc-3.0 library.

Yeah, I don’t need the webhooks, as I don’t need interactivity, just need to get the data when we make changes (no watching needed, we can just manually call a script to pull current data). The script also updates the current data on the webserver which works with that.

I was thinking if everything but the REST API is considered legacy it may be a good idea to update to that, as it seems to me that when something is labeled legacy that means it is slated to be discontinued… at least before the non-legacy would be.

If I’m going to update, I figured it would make the most sense to update to the most current non-legacy version. Now I’m not so sure, as I do need the data that those tables provide. Also, it seems they’re migrating the API proxy from Mashery to Apigee, which may change things further…

@JJonIS,

The iSDK and tables etc have been talked about being sunset for about seven years now. It’s not going to happen. Not without a way to keep all the integrations from breaking if they did. It was considered back when IS was thinking about only going with Keap and dropping IBK. When they decided to keep them both as separate products that talk quieted down and there still wasn’t any plan for how to keep peoples integrations from breaking.

Still, REST has some advantages and it wouldn’t hurt but you’ll find that there are limitations that only the iSDK can cover. Accessing the tables with the data object is one of them.

I’m using version 2.1.4 :wink:

They are moving api providers but that has nothing to do with the api versions. It’s to increase performance, reliability and limits.

1 Like

@John_Borelli, the latest iSDK version I’ve been able to find is 1.8.6. Am I missing something?

If you have an email address to send it to I can provide you with the same version I’m using. It allows for use of both the isdk and a REST method wrapper and either the api key or oauth methods so it’s a bit of a hybrid but it has the advantage of working with any iSDK methods used while providing the additional functions in the form of methods from REST.

1 Like

@John_Borelli Thanks! I private messaged you. :slight_smile:

Hi, @JJonIS,

You can download it from this Git repo I setup.

1 Like

Awesome @John_Borelli! Thanks so much! Will be trying that out this week.