Example API call- FullContact API

Example API CallIn this example I create an example API Call to Fullcontact API.   Hopefully y’all caught our webinar on Webservice APIs which goes very deep into API calls.

Here is the code I review in the video

;************************************************************
IniRead, API_Key   ,Auth.ini,API, Key
;~  https://portal.fullcontact.com/
;************Company Lookup************************************************
;~  EndPoint:="https://api.fullcontact.com/v2/company/lookup.xml"
;~  QueryString:=QueryString_Builder({"domain":"the-automator.com","keyPeople":"true"})
;~  MsgBox % QueryString

;***********Person Lookup*******************
EndPoint:="https://api.fullcontact.com/v2/person.xml"
;~  QueryString:=QueryString_Builder({"email":"[email protected]"})
;~  QueryString:=QueryString_Builder({"email":"[email protected]"})
QueryString:=QueryString_Builder({"phone":"+13037170414"})

;***********API Call*******************
HTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1")
HTTP.Open("GET",EndPoint . QueryString)
HTTP.SetRequestHeader("X-FullContact-APIKey", API_Key)
HTTP.Send()
Response:= HTTP.ResponseText
SciTE_Output(Response) ;Text,Clear=1,LineBreak=1,Exit=0

;************Query String builders*********
QueryString_Builder(kvp){
for key, value in kvp
  queryString.=((A_Index="1")?(url "?"):("&")) key "=" value
return queryString
}

Video demonstrating Example API Call to FullContact

Comments are closed.