1. Go to this page and download the library: Download phillipsdata/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/ */
phillipsdata / linkedin example snippets
$linkedin = new LinkedIn(
'LINKEDIN_API_KEY',
'LINKEDIN_API_SECRET',
'LINKEDIN_CALLBACK_URL'
);
$tokenResponse = $linkedin->getAccessToken($_GET['code']);
if ($tokenResponse->status() == 200) {
// Record $tokenResponse->response() in some way
} else {
echo $tokenResponse->errors();
}
$shareResponse->headers(); // An array of header fields and their values
$shareResponse->raw(); // Exactly what was returned by LinkedIn, including headers
$shareResponse->response(); // An object containing the data returned by LinkedIn
$shareResponse->errors(); // Any errors given in the response
$shareResponse->status(); // The status code returned by the request
$shareResponse = $linkedin->share('Leverage LinkedIn's APIs to maximize engagement');
$shareResponse = $linkedin->share(
'Leverage LinkedIn's APIs to maximize engagement',
[
'urn' => 'urn:li:digitalmediaAsset:C5422AQEbc381YmIuvg',
'type' => 'IMAGE',
'title' => 'LinkedIn API',
'description' => 'Shows how great the LinkedIn API is.'
],
'CONNECTIONS'
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.