title: How to pull json data using POST method from http://www.infogroup.com/ API in VBA
body: <p>I am trying to pull data from Infogroup API, I was able to pull data through a GET query but unable to pull data which required POST method. In the Infogroup API Console [<a href="http://developer.infoconnect.com/api-console][1]" rel="nofollow">http://developer.infoconnect.com/api-console][1]</a> I am giving parameter as apikey = 4iRztNp5euNzjK3i69xlnpIMa3K6AZCv and in the body I am giving the following code: </p>
  
  <pre><code>{"Fields":
     ["Id",
     "Companyname",
     "Assets",
     "BankAsset",
     "BigBusinessSegmentation",
     "BusinessStatus",
     "CallStatus",
     "CompanyDescription",
     "CompDate",
     "CreditCardsAccepted",
     "CreditLimit",
     "FortuneRanking",
     "HoldingStatus",
     "InWealthyArea",
     "IsActiveWebAddress",
     "IsHomeBusiness",
     "IsFranchise",
     "Population",
     "ProductsSold",
     "StockExchange",
     "SquareFootage",
     "Subsidiary",
     "TeleResearchUpdateDate",
     "YearEstablished",
      "RecordStatus", 
      "Location"],
   "CompanyName":"DORAN MECHANICAL"
  }
  </code></pre>
  
  <p>It is working fine in the console but I want to pull this data in Excel. Please help!</p>
  
  <pre><code>Function Post(CompName As String) As String
  Dim companyname As String
  Dim strQuery As String
  Dim googleService As New MSXML2.XMLHTTP
  Dim rspText As String
  
  companyname = URLEncode(CompName)
  
  strQuery = "https://api.infoconnect.com/v1/companies/search?apikey=4iRztNp5euNzjK3i69xlnpIMa3K6AZCv"
  
  
  googleService.Open "POST", strQuery, False
  googleService.setRequestHeader "Content-Type", "application/json"
  googleService.setRequestBody "Fields": ["Id","Companyname","Assets","BigBusinessSegmentation","CreditRatingScore", "Location"] , "companyname": CompName
  
  rspText = googleService.responseText
  
  Creditrating = "NA"
  
  If InStr(1, rspText, """CreditRatingScore"":""") Then
      Creditrating = Split(Split(rspText, """CreditRatingScore"":""")(1), Chr(34))(0)
  End If
  End Function
  </code></pre>