1- PHP LinkedIn Client with OAuth 2 authorization
2- ==============================================
3- [ ![ Build Status] ( https://travis-ci.org/zoonman/linkedin-client.svg )] ( https://travis-ci.org/zoonman/linkedin-client ) [ ![ Code Climate] ( https://codeclimate.com/github/zoonman/linkedin-client/badges/gpa.svg )] ( https://codeclimate.com/github/zoonman/linkedin-client ) [ ![ Packagist] ( https://img.shields.io/packagist/dt/zoonman/linkedin-client.svg )] ( ) [ ![ GitHub license] ( https://img.shields.io/github/license/zoonman/linkedin-client.svg )] ( )
1+ LinkedIn API Client with OAuth 2 authorization witten on PHP
2+ ============================================================
3+ [ ![ Build Status] ( https://travis-ci.org/zoonman/linkedin-client.svg )] ( https://travis-ci.org/zoonman/linkedin-client ) [ ![ Code Climate] ( https://codeclimate.com/github/zoonman/linkedin-client/badges/gpa.svg )] ( https://codeclimate.com/github/zoonman/linkedin-client ) [ ![ Packagist] ( https://img.shields.io/packagist/dt/zoonman/linkedin-client.svg )] ( https://packagist.org/packages/zoonman/linkedin-client ) [ ![ GitHub license] ( https://img.shields.io/github/license/zoonman/linkedin-client.svg )] ( https://github.com/zoonman/linkedin-client/LICENSE.md )
44
55
66
7- See [ complete example] ( examples/index.php ) to get started.
7+ See [ complete example] ( examples/ ) inside [ index.php ] ( examples/ index.php) to get started.
88
99
1010## Installation
@@ -17,17 +17,22 @@ composer require zoonman/linkedin-client
1717
1818Or add this package as dependency to ` composer.json ` .
1919
20+ If you have never used Composer, you should start [ here] ( http://www.phptherightway.com/#composer_and_packagist )
21+ and install composer.
22+
2023
2124## Usage
2225
2326To start working with LinkedIn API, you will need to
24- get client and secret go to
25- [ LinkedIn Developers portal] ( https://developer.linkedin.com/ )
26- and create new app there.
27+ get application client id and secret.
28+
29+ Go to [ LinkedIn Developers portal] ( https://developer.linkedin.com/ )
30+ and create new application in section My Apps.
2731
2832
2933#### Bootstrapping autoloader and instantiating a client
3034
35+
3136``` php
3237// ... please, add composer autoloader first
3338include_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
@@ -84,10 +89,50 @@ $accessToken = $client->getAccessToken($_GET['code']);
8489
8590#### Performing API calls
8691
87- To perform api call to get profile information
92+ All API calls can be called through simple method:
8893
8994``` php
9095$profile = $client->api(
96+ 'ENDPOINT',
97+ ['parameter name' => 'its value here'],
98+ 'HTTP method like GET for example'
99+ );
100+ ```
101+
102+ To perform api call to get profile information
103+
104+ ``` php
105+ $profile = $client->get(
91106 'people/~:(id,email-address,first-name,last-name)'
92107);
108+ print_r($profile);
109+ ```
110+
111+ To list companies where you an admin
112+
113+ ``` php
114+ $profile = $client->get(
115+ 'people/~:(id,email-address,first-name,last-name)'
116+ );
117+ print_r($profile);
118+ ```
119+
120+ To share content
121+
122+ ``` php
123+ $share = $client->post(
124+ 'people/~/shares',
125+ [
126+ 'comment' => 'Checkout this amazing PHP SDK for LinkedIn!',
127+ 'content' => [
128+ 'title' => 'PHP Client for LinkedIn API',
129+ 'description' => 'OAuth 2 flow, composer Package',
130+ 'submitted-url' => 'https://github.com/zoonman/linkedin-api-php-client',
131+ 'submitted-image-url' => 'https://github.com/fluidicon.png',
132+ ],
133+ 'visibility' => [
134+ 'code' => 'anyone'
135+ ]
136+ ]
137+ );
93138```
0 commit comments