Receiving MailChimp error "Your request did not include an API key." even though the API key is included using Alamofire
<p>I am using Alamofire to send a request to MailChimp to add a user to a list</p>

<p>MailChimp's docs say:</p>

<blockquote>
  <p>There are 2 authentication methods for the API: HTTP Basic authentication and OAuth2. The easiest way to authenticate is using HTTP Basic authentication. Enter any string as your username and supply your API Key as the password.</p>
</blockquote>

<p>The request I wrote for Alamofire:</p>

<pre><code>let params: [String : AnyObject] = ["email_address": email, "status": "subscribed", "merge_fields": [ "FNAME": name]]

guard let url = "https://us10.api.mailchimp.com/3.0/lists/&lt;listID&gt;/members/".stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding) else { return }

Alamofire.request(.POST, url, parameters: params, encoding: .URL)
    .authenticate(user: "apiKey", password: "&lt;apikey&gt;")
    .responseJSON { response in

        if response.result.isFailure {

        }
        else if let responseJSON = response.result.value as? [String: AnyObject] {

        }
    }
</code></pre>

<p>I checked that the API key is correct by using it to access their playground:
<a href="https://us1.api.mailchimp.com/playground/" rel="nofollow">https://us1.api.mailchimp.com/playground/</a></p>

<p>The response I get back states that the API key was not included: </p>

<blockquote>
  <p>Your request did not include an API key.</p>
</blockquote>

<p>Where have I gone wrong?</p>