title: How to add a tag to a list member on Mailchimp?
body: <p>I want to add a tag to a specific user on a mailchimp list</p>
  
  <pre><code>$email = "toto@example.com";
  $tag="test";
  $userid = md5( strtolower( $email ) );
  
  
  $data = array(
      'apikey'        =&gt; $mailchimp_api_key,
      'email_address' =&gt; $email,
      'tags' =&gt; array(
          'name' =&gt; $tag,
          'status' =&gt; 'active'
          )
      );
  
  $json_data = json_encode($data);
  
  $url = 'https://'.$mailchimp_datacenter.'api.mailchimp.com/3.0/lists/'.$mailchimp_list_id.'/members/' . $userid . '/tags';
  
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json',
      'Authorization: Basic '.$auth));
  curl_setopt($ch, CURLOPT_USERAGENT, 'PHP-MCAPI/2.0');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  if ($displaytaglist!="") {
      curl_setopt($ch, CURLOPT_POST, true);   
      curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
  }
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  $result = curl_exec($ch);
  </code></pre>
  
  <p>Do you know what is the issue ?
  I have this return :</p>
  
  <pre><code>stdClass Object
  (
      [type] =&gt; http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/
      [title] =&gt; Invalid Resource
      [status] =&gt; 400
      [detail] =&gt; Expected argument of type "array or Traversable and ArrayAccess", "string" given
      [instance] =&gt; XXXXX-XXXXX-XXXXX
  )
  </code></pre>