PHP code example of godpod / linkedin

1. Go to this page and download the library: Download godpod/linkedin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

godpod / linkedin example snippets


use LinkedIn\LinkedIn;

$li = new LinkedIn(
  array(
    'api_key' => 'yourapikey', 
    'api_secret' => 'yourapisecret', 
    'callback_url' => 'https://yourdomain.com/redirecthere'
  )
);

$url = $li->getLoginUrl(
  array(
    LinkedIn::SCOPE_BASIC_PROFILE, 
    LinkedIn::SCOPE_EMAIL_ADDRESS, 
    LinkedIn::SCOPE_NETWORK
  )
);

$token = $li->getAccessToken($_REQUEST['code']);
$token_expires = $li->getAccessTokenExpiration();

$info = $li->get('/people/~:(first-name,last-name,positions)');