The comments linkedIn api is not working like I would expect:
My code:
$res = Http::withHeaders([
"LinkedIn-Version" => "202301",
"X-Restli-Protocol-Version" => "2.0.0",
])
->withToken($post->account->bearer_token)
->post(
sprintf(
env("LINKEDIN_API") . "socialActions/%s/comments",
$postId
),
[
"actor" => $post->account->account_id,
"object" => $postId,
"message" => [
"text" => $post->linkedin_first_comment,
],
]
);
The url is this:
https://api.linkedin.com/rest/socialActions/urn:li:share:7037368272257712128/comments
Object id:
urn:li:share:7037368272257712128
But I keep receiving:
Syntax exception in path variables
What can be wrong here? Went through the docs lots of times.
Use link:
https://api.linkedin.com/rest/socialActions/urn:li:share:CODE/comments
add header:
Remove:
X-Restli-Protocol-VersionHope this helps.