Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@ To get access token use (don't forget to set redirect url)
$accessToken = $client->getAccessToken($_GET['code']);
```

#### Setting Access Token

You can use method `LinkedIn\Client::setAccessToken()` for setting token. You have to pass
instance of `LinkedIn\AccessToken` to this method.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zoonman, please, check grammar if this PR is acceptable :)


```php
use LinkedIn\AccessToken;
use LinkedIn\Client;

// instantiate the Linkedin client
$client = new Client(
'LINKEDIN_APP_CLIENT_ID',
'LINKEDIN_APP_CLIENT_SECRET'
);

// set access token
$accessToken = new AccessToken($token);
$client->setAccessToken($accessToken);
```

#### Performing API calls

All API calls can be called through simple method:
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ protected static function responseToArray($response)
*
* @return Client
*/
public function setAccessToken($accessToken)
public function setAccessToken(AccessToken $accessToken)
{
$this->accessToken = $accessToken;
return $this;
Expand Down