Skip to content

Instantly share code, notes, and snippets.

@mtarnovan
Last active July 3, 2018 11:03
Show Gist options
  • Save mtarnovan/33112cc9ac636f21b3ff465c7f2daf6c to your computer and use it in GitHub Desktop.
Save mtarnovan/33112cc9ac636f21b3ff465c7f2daf6c to your computer and use it in GitHub Desktop.
openapi php company code sample
<?php
$ch = curl_init();
$api_key = getenv('OPENAPI_KEY');
$sample_cif = '13548146';
curl_setopt($ch, CURLOPT_URL, "https://api.openapi.ro/api/companies/$sample_cif");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"x-api-key: $api_key"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump(json_decode($response));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment