php - Linkedin api oauth2.0 get user profile details -
as per new oauth 2.0 linkedin. unable user profile details. have set attributes in app still cant details.
can me code snippet user details.
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/~");
please check permissions in code when logging in linked-in. @ link-
https://developer.linkedin.com/support/developer-program-transition
Comments
Post a Comment