当我尝试通过LinkedIn API在我自己的LinkedIn个人资料上发布链接时,我收到此错误:
Request Error: Invalid arguments: {S_412_PRECONDITION_FAILED=Invalid arguments}
我的要求:
$li = new LinkedIn([
'api_key' => env('LINKEDIN_KEY'),
'api_secret' => env('LINKEDIN_SECRET'),
'callback_url' => env('LINKEDIN_REDIRECT_URI')
]);
$li->setAccessToken('my_token');
return $li->post('/people/~/shares', [
'content' => [
'title' => 'This is an example of title',
'description' => 'This is a text with less 256 caracters.',
'submitted-url' => 'https://www.google.fr/',
],
'comment' => 'This is comment with less 700 caracters.',
'visibility' => [
'code' => 'anyone'
]
]);
我使用LinkedIn的官方API(linkedinapi / linkedin)。