Yunus Aslam
Yunus Aslam

Reputation: 2466

Fetch Contact Details - Infusionsoft API

I am using Infusionsoft API to fetch the details of the contact. I have the email address and using that email address I am fetching other details. I have used,

// $app->findByEmail($email, $retrunfields);
$contact_details = $app->findByEmail("[email protected]", "Id");
var_dump($contact_details);

And also I am using the second method,

$contact_data = $app->dsQuery('Contact' , 1 , 0 , array('Email' => '[email protected]') , array('Id'));
var_dump($contact_details);

Both the scripts are working fine, but they are taking longer than usual. It takes more than 15 seconds to fetch the result and display.

Am I making any mistake or there is another better way to do this ?

Upvotes: 3

Views: 1966

Answers (3)

Jeremy
Jeremy

Reputation: 60

this is most likely due to one of three factors.

  1. Your Infusionsoft Contacts table is huge (millions of records)
  2. Your Infusionsoft app is being overtaxed (lots of Users, opt-ins, queries, etc..)
  3. Your Infusionsoft API usage is being throttled.

The best thing to do is to reach out to Infusionsoft support and ask them what the cause of the slowness might be for your app. They can look at your database size, app usage, and api throttling and let you know what's up.

Upvotes: 1

Chuck Bajax
Chuck Bajax

Reputation: 46

It's important in cases like this to rule out as many potential sources of slowness as you can. When anything in PHP takes a long time, there are any number of things that could cause it, from your server configuration, to the remote system just being slow.

Have you already tried running this query from another server, or from your own local machine? Try to find some common factors, isolate the problem and see if it doesn't help narrow down the problem.

Infusionsoft's performance has been very spotty in my experience. Sometimes it would work perfectly for months on end, but usually not. Whenever we had a problem--some code that suddenly stops working when it had worked for years before or a process that once took less than a second suddenly slowing to a crawl--more often than not we could traced it back to something on their end. And very often it was something that speaks of terrible QA-- Just this week we had an issue where queries on saved searches were returning entirely random information, and if we hadn't validated the entries before doing anything we might have ended up causing some serious issues for our clients. Your issue doesn't sound all that exceptional, sadly. You may have to consider, if the same problem occurs under different test cases that it's something on their end that you can't remedy.

Regarding the API, you are using an older, deprecated version. I'd recommend transitioning from it, since it had all kinds of problems--it would work, mind you, and should still work indefinitely barring a few easily remedied issues regarding HTTP certificates, but its code quality is poor.

Infusionsoft has provided a replacement API which they're just calling infusionsoft-php. Novak Solutions also provides an excellent object-oriented version as well, which they, confusingly enough, call infusionsoft-php-sdk. There's an option to use their XMLHTTP gateway as well,

Upvotes: 0

infusedmj
infusedmj

Reputation: 1

You are doing the API call correctly. I would suggest to use the first one if you are searching only by email.

Slowness can be either caused by Infusionsoft API or by your server. I don't think Infusionsoft's API will cause this as I've worked with a client before with hundreds of thousands of contacts but fetching contact took only few seconds.

Upvotes: 0

Related Questions