Search code examples
linkedin-api

Linkedin Post created through the API is not available on the platform


We have been using the LinkedIn Posts API to post on LinkedIn from our web application. This is the endpoint we use:

POST https://api.linkedin.com/rest/posts

This was working fine.

Recently, however, we've been experiencing an issue: some of our POST requests return a 200 status and a postURN, but the corresponding post doesn't appear on LinkedIn.

Our initial hypothesis was that these posts may have been disapproved for some reason. According to the LinkedIn API documentation, we should be able to retrieve the lifecycleStatusInfo of the post using the following endpoint:

GET https://api.linkedin.com/rest/posts/{encoded ugcPostUrn|shareUrn}

However, when trying to access this resource, we receive the following error response:

ACCESS_DENIED: Not enough permissions to access: partnerApiPostsExternal.GET.20230201

Given that the posting process is asynchronous and an ID is returned with each post, how can we check the status of a post?

Note that the LinkedIn account where the post has been posted did not receive any notification with feedback.

EDIT: Through LinkedIn technical support I have been noticed of an issue on their side regarding the posts not available on the platform. They didn't give me the reason neither timeframe for the fix.


Solution

  • I just heard back from LinkedIn support and they said that this happens if assets are uploaded but they're not done processing when you use them to actually make the post and you have to check the status of the upload

    and ensure that the status is "AVAILABLE" before posting

    This is what they said

    Thank you for writing in!

    I checked the backend logs and found that the reported UGC "urn:li:ugcPost:7125874324170764290" has not been published yet instead it landed with error "Processing failed" and currently the Post with the respective UGC id does not exists.

    Can you try to make the POST again and check if the UGC URL is working for you?

    In case not there can be below cause :

    Cause 1 :

    This might happen sometimes if the Post is made with content like image/video etc and the content id (image/video etc) which is active but has not been uploaded correctly before posting the same OR the respective ad (image /video etc) expiry date has crossed.

    You can also verify from your end by executing the GET call below to check if the status of the ad is "Available" which has been used in the content of the POST while making the POST.

    For Image : "https://api.linkedin.com/rest/images/urn:li:image:xxxxxxxx" (give the image id you received while Initializing the image) For Video : "https://api.linkedin.com/rest/images/urn:li:video:xxxxxxxxx" (give the image id you received while Initializing the video)

    If the status is not in "Available" state then please start the steps again by initializing the image or video (as per the requirement ) which will provide you a id for that ad and then refer to "https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/vector-asset-api?view=li-lms-2023-10&tabs=http#upload-the-image" OR "https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/vector-asset-api?view=li-lms-2023-10&tabs=http#upload-the-video" as per your requirement and upload the ads correctly before making the POST

    Once uploaded , you can run the above mentioned GET call to check if the status is available ? if yes then you can make the POST with the respective image/video id.