File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -76,12 +76,14 @@ Use `Scope` enum class to get scope names.
7676To get redirect url to LinkedIn, use the following approach:
7777
7878``` php
79+ use LinkedIn\Scope;
80+
7981// define scope
8082$scopes = [
81- 'r_basicprofile',
82- 'r_emailaddress' ,
83- 'rw_company_admin' ,
84- 'w_share' ,
83+ Scope::READ_BASIC_PROFILE,
84+ Scope::READ_EMAIL_ADDRESS ,
85+ Scope::MANAGE_COMPANY ,
86+ Scope::SHARING ,
8587];
8688$loginUrl = $client->getLoginUrl($scopes); // get url on LinkedIn to start linking
8789```
Original file line number Diff line number Diff line change 11# How to run examples
22
3- First, clone repository.
3+ First, [ clone] ( https://help.github.com/articles/cloning-a-repository/ ) repository.
4+
5+ ``` bash
6+ git clone https://github.com/zoonman/linkedin-api-php-client
7+ ```
8+ Change dir to the repo
9+ ``` bash
10+ cd linkedin-api-php-client
11+ ```
412
513Install dependencies:
614
715``` bash
816composer install [-d /path/to/repository/root]
917```
18+ If you don't have composer, you can get it [ here] ( https://getcomposer.org/doc/00-intro.md ) .
19+ Parameters in brackets are optional.
1020
1121Create ` .env ` file with linkedin credentials in the parent catalog (in the repository root) like this
1222
1323``` ini
14- LINKEDIN_CLIENT_ID =111ClinetId111
24+ LINKEDIN_CLIENT_ID =111ClientId111
1525LINKEDIN_CLIENT_SECRET =222ClientSecret
1626```
1727
28+ The simplest way to do that to run the following commands:
29+ ``` bash
30+ echo ' LINKEDIN_CLIENT_ID=111ClientId111' >> .env
31+ echo ' LINKEDIN_CLIENT_SECRET=222ClientSecret' >> .env
32+ ```
33+
1834To get client and secret go to [ LinkedIn Developers portal] ( https://developer.linkedin.com/ ) and create new app there.
1935
2036After add to OAuth 2.0 Authorized Redirect URLs:
You can’t perform that action at this time.
0 commit comments