Submit Your Site For Free!

Email Address:
* URL:
*
*Indicates Mandatory Field

Terms & Conditions

CProgramTrends
FlashNewz
DevWebPro








ZoomInfo API - ASP.NET C#

By Manoj Jasra
Expert Author
Article Date: 2008-02-21

Over the last couple of days I have been digging into the ZoomInfo API (using C# - ASP.Net) to first of all better understand the API and secondly to leverage the data provided in order to use it for things like company profiling, competitors, and key contacts at a given company.

The ZoomInfo API gives you the ability to:

•Search for any person in the ZoomInfo database by name.

•Search for any company in the ZoomInfo database by name, domain, industry, keyword, geography, or company size.

• Get detailed information such as description, industries, address, stock ticker, key people, mergers and acquisitions, and more on any company in the ZoomInfo database.

•Get a list of competitors for any company in the ZoomInfo database.

Below is a sample URL to make an XML request for the ZoomInfo data:

http://api.zoominfo.com/PartnerAPI/XmlOutput.aspx?query_type=people_search_query&pc=&firstName=Brian&lastName=Balfour&key=

The "key" has to be generated by concatenating the following parameters:

1. First 2 letters of every search term in sequential order (*** Note for the Company Competitors Query, supply the whole CompanyID)
2. Your Shared Secret
3. Today's day (not padded with zero)
4. Today's month (not padded with zero)
5. Today's year (4 digit)

Below is a method you can use to generate the MD5 code:

// Create an md5 sum string of this string
public static string ZoomEncode(String str)
{
System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] bs = System.Text.Encoding.UTF8.GetBytes(str);
bs = x.ComputeHash(bs);
System.Text.StringBuilder s = new System.Text.StringBuilder();
foreach (byte b in bs)
{
s.Append(b.ToString("x2").ToLower());
}
return s.ToString();
}


Below is a method you can use in C# to retrieve the XML provided by the ZoomInfo API. It takes into account the type of request made, for company detail or company competitors:

public static String getCompanyDetail(String companyDomain, String queryType, String companyID)
{
StringBuilder urlBuffer = null;

urlBuffer = new StringBuilder("http://api.zoominfo.com/PartnerAPI/XmlOutput.aspx");


urlBuffer.Append("?query_type=");
if (queryType == "company_detail")
{
urlBuffer.Append("company_detail");
}
if (queryType == "company_competitors")
{
urlBuffer.Append("company_competitors");
}

urlBuffer.Append("&pc=");
urlBuffer.Append(zoomInfoKey);

if (0 != companyID.Length)
{
urlBuffer.Append("&CompanyID=");
urlBuffer.Append(companyID);
}

if (queryType == "company_detail")
{
urlBuffer.Append("&CompanyDomain=");
urlBuffer.Append(companyDomain);
}

String keySeed = "";

if (0 != companyID.Length)
{
keySeed = companyID;
}
else
{
keySeed = companyDomain.Substring(1, 2);
}
keySeed += secret + DateTime.Today.Day + DateTime.Today.Month + DateTime.Today.Year;

urlBuffer.Append("&key=");
urlBuffer.Append(ZoomEncode(keySeed));

try
{

HttpWebRequest request = WebRequest.Create(urlBuffer.ToString()) as HttpWebRequest;
request.ContentType = "text/xml;charset="utf-8"";
request.Accept = "text/xml";
request.Method = "GET";
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
using (StreamReader streamReader = new StreamReader(response.GetResponseStream()))
{
String temp = streamReader.ReadToEnd();
return temp;
}
}
}
catch (Exception ex)
{
Debug.Write(ex.Message);
}
return String.Empty;

}


Comments

About the Author:
Manoj Jasra is an online marketing veteran of almost 10 years who specializes in analytics, social/search strategy and mobile marketing. Manoj is currently a Sr. Strategist at one of Canada’s largest Telecommunications Companies, Shaw Communications Inc., where he leads Social Media, SEO, PPC and Web Analytics strategies. Manoj first started in the search marketing industry with Enquiro Search Solutions, where he spearheaded web analytics, SEO Training and the development of cutting edge search marketing solutions for clients.

Manoj is a Professional Speaker having participated at events such as Emetrics, Web Analytics Xchange, WebTrends’ Engage, Internet Marketing Conference, Social Media Innovation Summit and Search Engine Strategies. He authors Web Analytics World (a top 100 Online Marketing Blog) and consults through his firm Jasra Inc.



Newsletter Archive | Article Archive | Submit Article | Advertising Information | About Us | Contact

C Programming Trends is an iEntry, Inc. ® publication - All Rights Reserved Privacy Policy and Legal