@@ -44,8 +44,8 @@ use LinkedIn\Client;
4444
4545// instantiate the Linkedin client
4646$client = new Client(
47- 'LINKEDIN_APP_CLIENT_ID',
48- 'LINKEDIN_APP_CLIENT_SECRET '
47+ 'YOUR_LINKEDIN_APP_CLIENT_ID',
48+ 'YOUR_LINKEDIN_APP_CLIENT_SECRET '
4949);
5050```
5151
@@ -144,19 +144,22 @@ $profile = $client->api(
144144);
145145```
146146
147- There are two helper methods:
147+ There are 3 helper methods:
148148
149149``` php
150150// get method
151151$client->get('ENDPOINT', ['param' => 'value']);
152152
153153//post
154154$client->post('ENDPOINT', ['param' => 'value']);
155+
156+ // delete
157+ $client->delete('ENDPOINT');
155158```
156159
157160#### Examples
158161
159- Perform api call to get profile information
162+ ##### Perform api call to get profile information
160163
161164``` php
162165$profile = $client->get(
@@ -165,7 +168,7 @@ $profile = $client->get(
165168print_r($profile);
166169```
167170
168- List companies where you are an admin
171+ ##### List companies where you are an admin
169172
170173``` php
171174$profile = $client->get(
@@ -175,7 +178,9 @@ $profile = $client->get(
175178print_r($profile);
176179```
177180
178- Share content on a personal profile
181+ ##### Share content on a personal profile
182+
183+ Make sure that image URL is available from the Internet (don't use localhost in the image url).
179184
180185``` php
181186$share = $client->post(
@@ -193,9 +198,18 @@ $share = $client->post(
193198 ]
194199 ]
195200);
201+ print_r($share);
202+ ```
203+
204+ ##### Get Company page profile
205+
206+ ``` php
207+ $companyId = '123'; // use id of the company where you are an admin
208+ $companyInfo = $client->get('companies/' . $companyId . ':(id,name,num-followers,description)');
209+ print_r($companyInfo);
196210```
197211
198- Share content on a LinkedIn business page
212+ ##### Share content on a LinkedIn business page
199213
200214``` php
201215// set sandboxed company page to work with
@@ -218,9 +232,12 @@ $share = $client->post(
218232 ]
219233 ]
220234);
235+ print_r($share);
221236```
222237
223- Setup custom API request headers
238+ ##### Setup custom API request headers
239+
240+ Change different headers sent to LinkedIn API.
224241
225242``` php
226243$client->setApiHeaders([
@@ -231,15 +248,20 @@ $client->setApiHeaders([
231248]);
232249```
233250
234- Change default API root
251+ ##### Change default API root
252+
253+ Some private API access there.
235254
236255``` php
237256$client->setApiRoot('https://api.linkedin.com/v2/');
238257```
239258
259+ ##### Image Upload
260+
261+ I assume you have to be LinkedIn partner or something like that.
262+
240263Try to upload image to LinkedIn. See [ Rich Media Shares] ( https://developer.linkedin.com/docs/guide/v2/shares/rich-media-shares#upload )
241264(returns "Not enough permissions to access media resource" for me).
242- I assume you have to be LinkedIn partner or something like that.
243265
244266``` php
245267$filename = '/path/to/image.jpg';
0 commit comments