title: HeyWatch API Connection Problem using .NET
body: <p>i tried a few methods but no one seems to work. 
  look at <a href="http://heywatch.com/" rel="nofollow">http://heywatch.com/</a> and to the API <a href="http://wiki.heywatch.com/API+Documentation" rel="nofollow">http://wiki.heywatch.com/API+Documentation</a></p>
  
  <blockquote>
    <p>Our API is based on REST principles, so what you just have to do is an HTTP request to the right resource and the right describing method. The URL to request is always the same: <a href="http://heywatch.com" rel="nofollow">http://heywatch.com</a> or <a href="https://heywatch.com" rel="nofollow">https://heywatch.com</a></p>
  </blockquote>
  
  <p>To use our API, you must be authenticated via Basic Auth.</p>
  
  <p>I have an account and trying to just recieve the simple account information using <a href="http://heywatch.com/account.xml" rel="nofollow">http://heywatch.com/account.xml</a>.</p>
  
  <p>But no chance. I tried following</p>
  
  <pre><code>    Dim req As WebRequest = WebRequest.Create(Url &amp; "account.xml")
      req.Headers.Add(HttpRequestHeader.Authorization, "BASIC [USER]:[pass]")
      req.Method = "GET"
  </code></pre>
  
  <p>I replaced the Headers UserPass stuff with Base64 encoded string too</p>
  
  <p>I tried also </p>
  
  <pre><code>Dim myCred As New NetworkCredential(ApiUser, ApiPass, ApiUrl)
  Dim credCache As New CredentialCache
  credCache.Add(New Uri(ApiUrl), "Basic", myCred)
  req.Credentials = credCache
  </code></pre>
  
  <p>I then later tried to change any possible property like <code>UseDefaultCredentials</code> or <code>AuthenticationLevel</code></p>
  
  <p>I always get an 401 Not Authorized Error. Please help, thanks ;-)</p>
  
  <p>BTW.: There is already a ported version to PHP, <a href="https://github.com/madewithlove/php-heywatch-class" rel="nofollow">https://github.com/madewithlove/php-heywatch-class</a></p>