PHP API to Add / Update Contacts with Just API Key Instead of OAuth

(Anoop Pete) #1


I am new to Infusionsoft. I have already build a Ecommerce Portal using PHP & Trying infusionsoft to Automate Marketing Process.

I am trying to find information about PHP API that can allow me to add / update contact without oAuth mechanism as Some logical part needs to be calculated via CronJobs.

Any help / suggestion would be helpful.

Anoop Pete

(Tom Scott) #2

You can generate a token manually if necessary, and then set the cron job to refresh it intermittently. So long as it doesn’t expire and you store it locally, you should never have an issue.

OAuth provides several significant security enhancements, and we intend to eventually sunset Legacy API Keys. I would not suggest building new functionality around them at this time.

(John Borelli) #3


This is the crossroad that many developers are facing. That where what we desire in simplicity meets with the requirements of what we have to work with. It would not be good to get stuck on avoiding OAuth because, eventually, it will leave you in a position of having to work it out in a much shorter period of time. As mentioned, managing a database entry for updating active access tokens and refresh tokens is the primary recommendation. I have a video that covers some of the specifics and it might be helpful in overcoming that hurdle:

(Javan Joel) #4

This is LAME! OAuth is supposed to be used only for direct user interaction. We need to be able to call the api anytime we need via our own member interaction without an Infusionsoft user needing to be there.

Refreshing OAuth token on an interval is NOT a great solution and is very prone to issues. Also it’s just giving us more work!

(John Borelli) #5

Why do you believe it is prone to issues and not a good solution?

(Tom Scott) #6

At Infusionsoft we are expected to provide secure storage for confidential data to our end users, while also providing third-party access to data at an end-user’s explicit request. When you build an integration with the Infusionsoft API, you are acting at the behest of a user to access that user’s application data, and the OAuth token represents that authority. You only need to be granted it once; you can refresh it as needed within the window to prevent it from becoming stale, via cron, via session initialization or any number of other methods. The window for refreshing is currently six months, although we recommend you do so to protect your users on a much more frequent basis.

Does it require a few extra steps to implement? Definitely. We’re working to minimize the impact of that, and have plans for ways to improve authentication to ease consumers through it. Recent changes to Account Central have already made it much, much easier to get a token for personal use if required. Things like refreshing can be a hassle to set up, but it also prevents third-parties who gain access to the token from having unlimited lifetime access to the user’s data.

Does it provide benefits and security that far outweigh it’s costs? Absolutely. We are dedicated to making the platform reliable and secure so that your clients data is protected.

OAuth enables this by allowing an explicit, individually revokable grant to a particular API consumer for a particular user’s application data, whereas a single token for each application is neither secure (since it is shared among all consumers), individually revokable (since resetting it prevents all integrations from accessing data to that application) or tracable (since all consumers access via the same key).