title: api integration php curl
body: <p>I am trying to integrate an API, and in the API integration instructions it shows the following:</p>
  
  <pre><code>GET /offers.json or /offers.xml
  Headers: API-KEY={your_key}, API-LOGIN={your_login}
  </code></pre>
  
  <p><strong>CURL Example:</strong></p>
  
  <pre><code>curl https://api.thewebsite.com/v1/offers.json -H 'API-KEY:
  1a2b3c4d5e6f7g8h9i' -H 'API-LOGIN: 1a2b3c4d5e6f7g8h9i'
  </code></pre>
  
  <p>I've tried using the cURL code below without success. As for the GET method, I'm not sure how to pass the API KEY &amp; API LOGIN as headers.</p>
  
  <pre><code>$header = array('Content-Type: application/xml', 'API-KEY=1a2b3c4d5e6f7g8h9i', 'API-LOGIN=1a2b3c4d5e6f7g8h9i');
  $url = "https://api.thewebsite.com/v1/offers.xml";
  
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
  $xml = curl_exec($curl);
  curl_close($curl);
  
  print $xml;
  </code></pre>