【发布时间】:2015-07-26 06:22:23
【问题描述】:
根据linkedin 的新oauth 2.0。 我无法获取用户个人资料详细信息。 我已经在我的应用程序中设置了属性,但仍然无法获取详细信息。
谁能帮我用代码 sn-p 来获取用户详细信息。
public function fetch($method, $resource, $body = '') {
$opts = array(
'http' => array(
'method' => $method,
'header' => "Authorization: Bearer " .
$_SESSION['oauth_access_token'] . "\r\n" .
"x-li-format: json\r\n"
)
);
$url = 'api.linkedin.com' . $resource;
if (count($this->$params)) {
$url .= '?' . http_build_query($this->$params);
}
$context = stream_context_create($opts);
$response = file_get_contents($url, false, $context);
return json_decode($response);
}
$xml_response = $LinkedInn->fetch("GET","/v1/people/~");
【问题讨论】:
-
您的回复是什么?
-
空白回复....什么都没有
标签: php api oauth-2.0 linkedin linkedin-api