fork download
  1. <?php
  2. $access_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogImFub24iLAogICJpc3MiOiAic3VwYWJhc2UiLAogICJpYXQiOiAxNzI2MTY1ODAwLAogICJleHAiOiAxODgzOTMyMjAwCn0.U57VXIpQoAdfRoq7MbhzIazxojW27VjcOPVj1bvigbU";
  3.  
  4. $url = "https://b...content-available-to-author-only...g.org/rest/v1/country_config?select=hour_format_type,thousands_separator,decimal_delimiter,tenant!inner(code)&tenant.code=eq.CA";
  5. $config_details = [];
  6.  
  7. try {
  8. $curl = curl_init($url);
  9. curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
  10. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  11. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  12. //$authorization = "Authorization: apiKey " . $access_token;
  13.  
  14. curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  15. 'Content-Type:application/json',
  16. 'apiKey:'.$access_token,
  17. ));
  18. $output = json_decode(curl_exec($curl));
  19. $httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  20. print_r($httpcode);
  21. if (curl_errno($curl)) {
  22. $result = array("response_code" => curl_getinfo($curl, CURLINFO_HTTP_CODE), "status" => "error", "is_api_error" => 0, "response_message" => curl_error($curl));
  23. echo 'HTTP code: ' . $httpcode;
  24. print_r($result);
  25. // print("===================================================================================");
  26. } else {
  27. print($output[0]);
  28.  
  29.  
  30. }
  31. curl_close($curl);
  32.  
  33. } catch (Exception $e) {
  34. echo $e;
  35. exit(0);
  36. }
  37.  
  38.  
  39.  
  40.  
  41.  
Success #stdin #stdout 0.03s 26244KB
stdin
Standard input is empty
stdout
0HTTP code: 0Array
(
    [response_code] => 0
    [status] => error
    [is_api_error] => 0
    [response_message] => Could not resolve host: bx.artofliving.org
)