title: Token authentication for CURL in EXCEL VBA
body: <p>A client requested that I put together a tool to take a company domain name and somehow come up with the account name. I found an API that I can work with, but I'm not as familiar with doing this in VBA.</p>
  
  <p>Here is the CURL procedure that the site documentation gives to push through a Domain Name, and receive the company name as a response:</p>
  
  <pre><code>curl 'https://company.clearbit.com/v2/companies/find?domain=segment.com' \
          -u sk_b3b05a8924c4f3df86248b4e38421cfa:
  </code></pre>
  
  <p>After several attempts of receiving the "Please authenticate your request", I've finally gotten to the point where I am receiving an error from the API, I think indicating that I am now correctly calling the API in some way.</p>
  
  <p>Here is my current code. Any idea why I may be receiving this error?</p>
  
  <pre><code>{"error":{"type":"api_error","message":"Sorry, something went wrong. We have been notified."}}
  </code></pre>
  
  <pre><code>Public Function CallRestAPI2(strUrl1 As String)
      TargetURL = "https://company.clearbit.com/v2/companies/find?domain=toplinegroup.com"
      Set HTTPReq = CreateObject("WinHttp.WinHttpRequest.5.1")
      'HTTPReq.Option(4) = 13056 '
      HTTPReq.Open "GET", TargetURL, False
      HTTPReq.SetRequestHeader "Content-Type", "application/json"
      HTTPReq.SetRequestHeader "Accept", "application/json"
      HTTPReq.Send "-u sk_b3b05a8924c4f3df86248b4e38421cfa"
      Debug.Print HTTPReq.responseText
  End Function
  </code></pre>
  
  <p>Any idea what I am doing wrong?</p>