title: get data from mailchip using curl where do I place the api key in the curl call
body: <p>I am tryng to get list members from a mailchimp using curl.</p>
  
  <p>This is my code.</p>
  
  <p>I cant figure where to place the api key.</p>
  
  <p>this is the code I have for now:</p>
  
  <pre><code>$apiKey = 'xxxxxxxxxxxxxxxxxx';
  $list_id = 'aaaaaaaaaa';
  $dataCenter = substr($apiKey,strpos($apiKey,'-')+1);
  
  $url = 'https://' . $dataCenter . '.api.mailchimp.com/3.0/lists/'.$list_id;
  
  $cURL = curl_init();
  
  curl_setopt($cURL, CURLOPT_URL, $url);
  curl_setopt($cURL, CURLOPT_HTTPGET, true);
  
  curl_setopt($cURL, CURLOPT_HTTPHEADER, array(
      'Content-Type: application/json',
      'Accept: application/json'
  ));
  
  $result = curl_exec($cURL);
  
  curl_close($cURL);
  
  echo '&lt;pre&gt;';
  
  var_dump($result);
  
  echo '&lt;/pre&gt;';
  </code></pre>