Skip to content

Commit 4360425

Browse files
authored
Merge pull request #1 from AgencyPMG/master
fix response for empty body
2 parents 5413aa6 + 66ce56b commit 4360425

File tree

9 files changed

+2721
-165
lines changed

9 files changed

+2721
-165
lines changed

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

ISSUE_TEMPLATE.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

LICENSE.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
LinkedIn API Client with OAuth 2 authorization written on PHP
22
============================================================
3-
[![Build Status](https://travis-ci.org/samoritano/linkedin-api-php-client.svg?branch=master)](https://travis-ci.org/samoritano/linkedin-api-php-client) [![Code Climate](https://codeclimate.com/github/samoritano/linkedin-api-php-client/badges/gpa.svg)](https://codeclimate.com/github/samoritano/linkedin-api-php-client) [![Packagist](https://img.shields.io/packagist/dt/samoritano/linkedin-api-php-client.svg)](https://packagist.org/packages/samoritano/linkedin-api-php-client-v2) [![GitHub license](https://img.shields.io/github/license/samoritano/linkedin-api-php-client.svg)](https://github.com/samoritano/linkedin-api-php-client/blob/master/LICENSE.md)
3+
[![Build Status](https://travis-ci.org/AgencyPMG/linkedin-api-php-client.svg?branch=master)](https://travis-ci.org/AgencyPMG/linkedin-api-php-client) [![Code Climate](https://codeclimate.com/github/AgencyPMG/linkedin-api-php-client/badges/gpa.svg)](https://codeclimate.com/github/AgencyPMG/linkedin-api-php-client) [![Packagist](https://img.shields.io/packagist/dt/AgencyPMG/linkedin-api-php-client.svg)](https://packagist.org/packages/AgencyPMG/linkedin-api-php-client-v2) [![GitHub license](https://img.shields.io/github/license/AgencyPMG/linkedin-api-php-client.svg)](https://github.com/AgencyPMG/linkedin-api-php-client/blob/master/LICENSE.md)
44

55

66
## Installation
@@ -10,7 +10,7 @@ You will need at least PHP 7.3. We match [officially supported](https://www.php.
1010
Use [composer](https://getcomposer.org/) package manager to install the lastest version of the package:
1111

1212
```bash
13-
composer require samoritano/linkedin-api-php-client-v2
13+
composer require pmg/linkedin-api-php-client
1414
```
1515

1616
Or add this package as dependency to `composer.json`.
@@ -22,10 +22,10 @@ Or add this package as dependency to `composer.json`.
2222
Before you will get started, play visit to [LinkedIn API Documentation](https://docs.microsoft.com/en-us/linkedin/marketing/getting-started).
2323
This will save you a lot of time and prevent some silly questions.
2424

25-
To start working with LinkedIn API, you will need to
26-
get application client id and secret.
25+
To start working with LinkedIn API, you will need to
26+
get application client id and secret.
2727

28-
Go to [LinkedIn Developers portal](https://www.linkedin.com/developers/)
28+
Go to [LinkedIn Developers portal](https://www.linkedin.com/developers/)
2929
and create new application in section My Apps. Once your app has been approved, you will get a ClientId and ClientSecret, that you will use later.
3030

3131

@@ -48,26 +48,26 @@ $client = new Client(
4848

4949
#### Getting local redirect URL
5050

51-
To start linking process you have to setup redirect url.
51+
To start linking process you have to setup redirect url.
5252
You can set your own or use current one.
5353
SDK provides you a `getRedirectUrl()` helper for your convenience:
5454

5555
```php
5656
$redirectUrl = $client->getRedirectUrl();
5757
```
5858

59-
We recommend you to have it stored during the linking session
59+
We recommend you to have it stored during the linking session
6060
because you will need to use it when you will be getting access token.
6161

62-
#### Setting local redirect URL
62+
#### Setting local redirect URL
6363

6464
Set a custom redirect url use:
6565

6666
```php
6767
$client->setRedirectUrl('http://your.domain.tld/path/to/script/');
6868
```
6969

70-
#### Getting LinkedIn redirect URL
70+
#### Getting LinkedIn redirect URL
7171

7272
In order of performing OAUTH 2.0 flow, you should get LinkedIn login URL.
7373
During this procedure you have to define scope of requested permissions.
@@ -82,7 +82,7 @@ use LinkedIn\Scope;
8282

8383
// define scope
8484
$scopes = [
85-
Scope::READ_LITE_PROFILE,
85+
Scope::READ_LITE_PROFILE,
8686
Scope::READ_EMAIL_ADDRESS,
8787
Scope::SHARE_AS_USER,
8888
Scope::SHARE_AS_ORGANIZATION,
@@ -92,20 +92,20 @@ $loginUrl = $client->getLoginUrl($scopes); // get url on LinkedIn to start linki
9292

9393
Now you can take user to LinkedIn. You can use link or rely on Location HTTP header.
9494

95-
#### Getting Access Token
95+
#### Getting Access Token
9696

9797
To get access token use (don't forget to set redirect url)
9898

9999
```php
100100
$accessToken = $client->getAccessToken($_GET['code']);
101101
```
102-
This method returns object of `LinkedIn\AccessToken` class.
102+
This method returns object of `LinkedIn\AccessToken` class.
103103
You can store this token in the file like this:
104104
```php
105105
file_put_contents('token.json', json_encode($accessToken));
106106
```
107-
This way of storing tokens is not recommended due to security concerns and used for demonstration purpose.
108-
Please, ensure that tokens are stored securely.
107+
This way of storing tokens is not recommended due to security concerns and used for demonstration purpose.
108+
Please, ensure that tokens are stored securely.
109109

110110
#### Setting Access Token
111111

@@ -118,7 +118,7 @@ use LinkedIn\Client;
118118

119119
// instantiate the Linkedin client
120120
$client = new Client(
121-
'LINKEDIN_APP_CLIENT_ID',
121+
'LINKEDIN_APP_CLIENT_ID',
122122
'LINKEDIN_APP_CLIENT_SECRET'
123123
);
124124

@@ -132,7 +132,7 @@ $accessToken = new AccessToken($tokenData['token'], $tokenData['expiresAt']);
132132
$client->setAccessToken($accessToken);
133133
```
134134

135-
#### Performing API calls
135+
#### Performing API calls
136136

137137
All API calls can be called through simple method:
138138

@@ -211,25 +211,3 @@ Some private API access there.
211211
```php
212212
$client->setApiRoot('https://api.linkedin.com/v2/');
213213
```
214-
215-
##### ~Image Upload~ --> OBSOLETE (This part needs an update)
216-
217-
I assume you have to be LinkedIn partner or something like that.
218-
219-
Try to upload image to LinkedIn. See [Rich Media Shares](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/rich-media-shares)
220-
221-
222-
```php
223-
$filename = '/path/to/image.jpg';
224-
$client->setApiRoot('https://api.linkedin.com/');
225-
$mp = $client->upload($filename);
226-
```
227-
228-
## Contributing
229-
230-
Please, open PR with your changes linked to an GitHub issue.
231-
You code must follow [PSR](http://www.php-fig.org/psr/) standards and have PHPUnit tests.
232-
233-
## License
234-
235-
[MIT](LICENSE.md)

composer.json

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "samoritano/linkedin-api-php-client",
2+
"name": "pmg/linkedin-api-php-client",
33
"description": "This package is an SDK for using LinkedIn V2 Marketing API. You can use it for managing Company Pages in this social network",
44
"type": "library",
55
"keywords": [
@@ -9,43 +9,17 @@
99
"social", "rest", "api", "client", "social network", "auth", "authorization",
1010
"wrapper", "integration", "platform"
1111
],
12-
"homepage": "https://github.com/samoritano/linkedin-api-php-client",
12+
"homepage": "https://github.com/AgencyPMG/linkedin-api-php-client",
1313
"require": {
14-
"php": ">=7.3",
14+
"php": "^7.4 || ^8.0",
1515
"ext-curl": "*",
16-
"guzzlehttp/guzzle": "^6.3"
16+
"guzzlehttp/guzzle": "^7.3.0"
1717
},
1818
"license": "MIT",
19-
"authors": [
20-
{
21-
"name": "Samori Bokokó",
22-
"email": "[email protected]",
23-
"homepage": "https://bokokode.com/",
24-
"role": "Developer"
25-
},
26-
{
27-
"name": "Philipp Tkachev",
28-
"email": "[email protected]",
29-
"homepage": "http://www.zoonman.com/",
30-
"role": "Developer"
31-
},
32-
{
33-
"name": "Aleksey Salnikov",
34-
"email": "[email protected]",
35-
"homepage": "http://iamsalnikov.ru/",
36-
"role": "Developer"
37-
},
38-
{
39-
"name": "Daniel J. Post",
40-
"homepage": "http://danieljpost.info/",
41-
"role": "Developer"
42-
}
43-
44-
],
4519
"support": {
46-
"docs": "https://github.com/samoritano/linkedin-api-php-client/blob/master/README.md",
47-
"source": "https://github.com/samoritano/linkedin-api-php-client",
48-
"issues": "https://github.com/samoritano/linkedin-api-php-client/issues"
20+
"docs": "https://github.com/AgencyPMG/linkedin-api-php-client/blob/master/README.md",
21+
"source": "https://github.com/AgencyPMG/linkedin-api-php-client",
22+
"issues": "https://github.com/AgencyPMG/linkedin-api-php-client/issues"
4923
},
5024
"autoload": {
5125
"psr-4": {"LinkedIn\\": "src/"}

0 commit comments

Comments
 (0)