Last active
July 3, 2018 11:03
-
-
Save mtarnovan/33112cc9ac636f21b3ff465c7f2daf6c to your computer and use it in GitHub Desktop.
openapi php company code sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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