Skip to content

Instantly share code, notes, and snippets.

@aphilippi
Last active May 12, 2016 12:20
Show Gist options
  • Save aphilippi/921e1884856d1350caeade41c60682ba to your computer and use it in GitHub Desktop.
Save aphilippi/921e1884856d1350caeade41c60682ba to your computer and use it in GitHub Desktop.
<?php
//set BASE_URL to https://factureaza.ro/api/ for production
define('BASE_URL', 'https://sandbox.factureaza.ro/api/');
//replace with the api key provided in the backend
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$url = BASE_URL . 'invoices/search.xml?field=created_at&value=2014.06.06';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
curl_close($ch);
echo '<pre>' . htmlentities($result) . '</pre>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment