getData.php 1.07 KB
<?php
$url = "https://api.researchmap.jp/SNI/education";
// $url = "https://api.researchmap.jp/erad_id:20724818/published_papers";
// $url = "https://api.researchmap.jp/20724818/profile";
$token = "3bd6cbdc59adfbecd96bdb759b7d32e310cfba7e";

$header = array(
  "Authorization: Bearer $token",
  "Accept: application/ld+json,application/json;q=0.1",
  "Accept-Encoding: gzip",
  "Content-Type: application/json;"
);

$curl = curl_init($url);
// curl_setopt($curl, CURLOPT_POST,            TRUE);
curl_setopt($curl, CURLOPT_HTTPHEADER,      $header);
// curl_setopt($curl, CURLOPT_POSTFIELDS,      http_build_query($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,  FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,  FALSE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,  TRUE);
curl_setopt($curl, CURLOPT_COOKIEJAR,       'cookie');
curl_setopt($curl, CURLOPT_COOKIEFILE,      'tmp');
curl_setopt($curl, CURLOPT_FOLLOWLOCATION,  TRUE);
$api_responese = curl_exec($curl);

header('Content-Type: application/json; charset=utf8');
header('Access-Control-Allow-Origin: *');
echo $api_responese;
?>