Skip to content

Commit e19fd4e

Browse files
authored
Update index.php
1 parent e71112c commit e19fd4e

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

examples/index.php

+27-11
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,41 @@
6666
$emailInfo = $email = $client->get('emailAddress', ['q' => 'members', 'projection' => '(elements*(handle~))']);
6767
pp($emailInfo);
6868

69-
$share = $client->post(
70-
'people/~/shares',
71-
[
72-
'comment' => 'Checkout this amazing PHP SDK for LinkedIn!',
73-
'content' => [
74-
'title' => 'PHP Client for LinkedIn API',
75-
'description' => 'OAuth 2 flow, composer Package',
76-
'submitted-url' => 'https://github.com/zoonman/linkedin-api-php-client',
77-
'submitted-image-url' => 'https://github.com/fluidicon.png',
69+
$share = $client->post(
70+
'ugcPosts',
71+
[
72+
'author' => 'urn:li:person:' . $profile['id'],
73+
'lifecycleState' => 'PUBLISHED',
74+
'specificContent' => [
75+
'com.linkedin.ugc.ShareContent' => [
76+
'shareCommentary' => [
77+
'text' => 'Checkout this amazing PHP SDK for LinkedIn!'
78+
],
79+
'shareMediaCategory' => 'ARTICLE',
80+
'media' => [
81+
[
82+
'status' => 'READY',
83+
'description' => [
84+
'text' => 'OAuth 2 flow, composer Package.'
85+
],
86+
'originalUrl' => 'https://github.com/zoonman/linkedin-api-php-client',
87+
'title' => [
88+
'text' => 'PHP Client for LinkedIn API'
89+
]
90+
]
91+
]
92+
]
7893
],
7994
'visibility' => [
80-
'code' => 'anyone'
95+
'com.linkedin.ugc.MemberNetworkVisibility' => 'CONNECTIONS'
8196
]
8297
]
8398
);
8499
pp($share);
85100

86101
// set sandboxed company page id to work with
87102
// https://www.linkedin.com/company/devtestco
103+
/* TODO!
88104
$companyId = '2414183';
89105
90106
h1('Company information');
@@ -113,7 +129,7 @@
113129
]
114130
);
115131
pp($companyShare);
116-
132+
*/
117133

118134
/*
119135
// Returns {"serviceErrorCode":100,"message":"Not enough permissions to access media resource","status":403}

0 commit comments

Comments
 (0)