title: Calling MailChimp API v3.0 with .Net
body: <p>I'm trying to access our MailChimp account via the new 3.0 REST API.  I've done the following:</p>
  
  <pre><code>using(var http = new HttpClient())
  {
      var creds = Convert.ToBase64String(Encoding.ASCII.GetBytes("username:mailchimpapikey-us1"));
      http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", creds);
      string content = await http.GetStringAsync(@"https://us1.api.mailchimp.com/3.0/lists");
      Console.WriteLine(content);
  }
  </code></pre>
  
  <p>However, when I run this code, I get a 401 error with the following json details:</p>
  
  <pre><code>{"type":"http://kb.mailchimp.com/api/error-docs/401-api-key-invalid","title":"API Key Invalid","status":401,"detail":"Your API key may be invalid, or you've attempted to access the wrong datacenter.","instance":"a9fe4028-519e-41d6-9f77-d2caee4d4683"}
  </code></pre>
  
  <p>The datacenter I'm using in my URI (us1 in this example) matches the dc on my API key.  My API key works if I use the MailChimp SDK so I know my key isn't invalid.  Also, using Fiddler, I can see that the MailChimp SDK is calling the same dc as I'm doing in my URI.</p>
  
  <p>Any Ideas as to why I am having trouble Authenticating?</p>
  
  <p><strong>EDIT</strong>
  As noted in the question, I'm asking specifically about accessing the new 3.0 REST API.  I'm trying to do this directly as opposed to using a third party wrapper.</p>
  
  <p>The new API is composed of http calls so it should be pretty straight forward.  I'm simply having trouble with the authentication piece.</p>