|
66 | 66 | $emailInfo = $email = $client->get('emailAddress', ['q' => 'members', 'projection' => '(elements*(handle~))']);
|
67 | 67 | pp($emailInfo);
|
68 | 68 |
|
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 | + ] |
78 | 93 | ],
|
79 | 94 | 'visibility' => [
|
80 |
| - 'code' => 'anyone' |
| 95 | + 'com.linkedin.ugc.MemberNetworkVisibility' => 'CONNECTIONS' |
81 | 96 | ]
|
82 | 97 | ]
|
83 | 98 | );
|
84 | 99 | pp($share);
|
85 | 100 |
|
86 | 101 | // set sandboxed company page id to work with
|
87 | 102 | // https://www.linkedin.com/company/devtestco
|
| 103 | + /* TODO! |
88 | 104 | $companyId = '2414183';
|
89 | 105 |
|
90 | 106 | h1('Company information');
|
|
113 | 129 | ]
|
114 | 130 | );
|
115 | 131 | pp($companyShare);
|
116 |
| - |
| 132 | + */ |
117 | 133 |
|
118 | 134 | /*
|
119 | 135 | // Returns {"serviceErrorCode":100,"message":"Not enough permissions to access media resource","status":403}
|
|
0 commit comments