Full Contact API Implementation

  • Post published:July 14, 2015

Effective Contact Management with your target audience has a significant influence on the smooth functioning of any business. When due importance and focus is being fed to this aspect of the business, it open the doors of more leads prospects and better user satisfaction with your services. An online platform specially dedicated to the client management can be the most suitable option in this regard.

vteam #473 have recently implemented Full Contact API in one of their Client’s project which is basically a Lead Generation and Contact management Website. Client wanted his website to fetch full details of any person or company for its users. Full Contact API was providing this information so that is why it was implemented.

Implementation:

The API was technically built in a dynamic way so that it can support the maximum customizable options. There were various features that were incorporated in it and it gave users ample opportunity to explore them.

This API returns the required information about a company for which there was a need to search for. If there will be any need to find information about any company from Client’s user, Full Contact API provide the required parameters to get the information about that Company.

Parameters will include secret Auth keys, company search strings like: Name, URL/Domain, etc. This will return company information in JSON format.

To consume this information within Client’s Web Application, its output (in JSON format) was parsed and it saved the desired information where it was required.

For the parsing of Social profiles through the response to get Companies Facebook, Twitter, LinkedIn etc profile URLs through PHP and saving in Database, sample Code Snippet is as follows:

<?php

$apiKey = "xxxxxxxxxxxxxxxxx";
$fullContact_Company_API = "https://api.fullcontact.com/v2/company/lookup.json?domain=$domain&apiKey=" . $apiKey;
$ch = curl_init($fullContact_Company_API);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'caseysoftware/fullcontact-php-0.9.0');
$response_json = curl_exec($ch);
$full_contact_company = $response_json;
$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$company_detail = json_decode($response_json);
curl_close($ch);

if (is_object($company_detail))
       {
       if ($company_detail->status == 200)
              {
              if (isset($company_detail->socialProfiles))
                        {
                        $company_social_profiles = $company_detail->socialProfiles;
                        foreach($company_social_profiles as $company_social_profile)
                                {
                                if ($company_social_profile->typeId == 'facebook')
                                       {
                                       $company_facebook_url = $company_social_profile->url;
                                       }
                                elseif ($company_social_profile->typeId == 'twitter')
                                       {
                                       $company_twitter_url = $company_social_profile->url;
                                       }
                                elseif ($company_social_profile->typeId == 'google')
                                       {
                                       $company_google_url = $company_social_profile->url;
                                       }
                                elseif ($company_social_profile->typeId == 'linkedincompany')
                                       {
                                       $company_linkedin_url = $company_social_profile->url;
                                       }
                                elseif ($company_social_profile->typeId == 'crunchbasecompany')
                                       {
                                       $company_crunchbase_url = $company_social_profile->url;
                                       }
                                elseif ($company_social_profile->typeId == 'angellist')
                                       {
                                       $company_angellist_url = $company_social_profile->url;
                                       }
                                elseif ($company_social_profile->typeId == 'youtube')
                                       {
                                       $company_youtube_url = $company_social_profile->url;
                                       }
                                elseif ($company_social_profile->typeId == 'slideshare')
                                       {
                                       $company_slideshare_url = $company_social_profile->url;
                                       }
                                }
                        }
             }
       }

return array(
       'company_facebook_url' => $company_facebook_url,
       'company_twitter_url' => $company_twitter_url,
       'company_google_url' => $company_google_url,
       'full_contact_company' => $full_contact_company,
       'company_linkedin_url' => $company_linkedin_url,
       'company_crunchbase_url' => $company_crunchbase_url,
       'company_angellist_url' => $company_angellist_url,
       'company_youtube_url' => $company_youtube_url,
       'company_slideshare_url' => $company_slideshare_url
);

The returned array can be saved in a desired Database location.