Quantcast
Channel: e-conomic Global API Forum
Viewing all articles
Browse latest Browse all 2527

Answered: Connect example for the REST api and PHP

$
0
0

I had success with this example:

 

<?
       $curl = curl_init($service_url);
       //$curl_post_data = array(
       curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'X-AppSecretToken:MySecretToken',
            'X-AgreementGrantToken:MyGrantToken',
'Content-Type:application/json'
            ));
       curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
       curl_setopt($curl, CURLOPT_GET, true);
       //curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
       $curl_response = curl_exec($curl);
       curl_close($curl);
 
       $json = json_decode($curl_response);
  
  print "<pre>";
  print_r($json);
  print "</pre>";
?>

Viewing all articles
Browse latest Browse all 2527

Trending Articles