Hans Guth
Hans Guth

Reputation: 101

LinkedIn API likes/shares/comments

We have been trying to pull in like/comments for LinkedInposts that have been made by our application but it seems we are getting an error message. I am posting this on behalf of my developer. We have these products enabled.

Share on LinkedIn, Sign in with LinkedIn and Marketing Developer Platform

We have these permissions:

r_organization_social
r_1st_connections_size
r_ads_reporting
r_emailaddress
rw_organization_admin
r_liteprofile
r_basicprofile
r_ads
rw_ads
w_member_social

In trying to determine what might be happening my developer seems to think we must have r_member_social but seems to be a restricted permission per the LI faq.

"How do I get access to r_member_social? r_member_social is a closed permission, and we are not accepting access requests this time due to resource constraints. Learn more about available Marketing APIs and permissions."

But in looking into this my thinking is that we should be able to get any likes/comments from posts that WE have made on behalf of an authenticated user via r_organization_social.

Upvotes: 1

Views: 1024

Answers (3)

Edin Jašarević
Edin Jašarević

Reputation: 1

As colleagues stated in their posts that the permission "r_member_social" is temporarily withdrawn.

One trick way: How to get analytic for post when you have r_member_social scope

When you create a post, you get response 201 and empty content.
However, in the header at the key location you have that post id.
You extract it and save it, later you can use it to get analytics on it.

    var client = new HttpClient();

    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", {YOUR_ACCESS_TOKEN});
    client.DefaultRequestHeaders.Add("Linkedin-Version", "202308");
    client.DefaultRequestHeaders.Add("X-Restli-Protocol-Version", "2.0.0");
    
    var response = await client.PostAsync("https://api.linkedin.com/rest/posts", content, cancellationToken);

    var postId = response.Headers.Location?.OriginalString;        
    postId = postId?.Replace("/", "").Replace("posts", "").Replace("%3A", ":");
    // urn:li:share:7122594746383953921

Upvotes: 0

Sohaib Siddique Butt
Sohaib Siddique Butt

Reputation: 164

The r_organization_social permission is used to Retrieve the organization's posts, comments, reactions, and other engagement data of the authenticated user.

It is something, that suppose your authenticated member has a page on LinkedIn and then This permission is used to get the data of the post that are from the organization page. It does not allow you to the data of the simple post that you post as the user.

More detail about the permissions can be found here.

r_member_social is needed for it, and currently, it is restricted by LinkedIn. There are just providing w_member_social access. You can check that as well by selecting your app from My Apps, navigating to the Products tab, going to the Marketing Developer Platform product, and clicking on view endpoints. then you will be able to see the permissions available. enter image description here

Alternatively, you can explore this marketing documentation more.

Upvotes: 0

Musfira Zia
Musfira Zia

Reputation: 11

You don't have enough permissions to access the post as r_member_social is needed for it, and currently it is restricted by linkedIn.

Upvotes: 0

Related Questions