Islem Boussetta
Islem Boussetta

Reputation: 41

The LinkedIn Assets API don't show my upload in the linkedin newfeed

I'm using LinkedIn API to upload media to my Linkedin personal profile. I start with registring my image and I get a successful response.

REQUEST

 {
   "registerUploadRequest":{
      "owner":"urn:li:person:xxx",
      "recipes":[
         "urn:li:digitalmediaRecipe:feedshare-image"
      ],
      "serviceRelationships":[
         {
            "identifier":"urn:li:userGeneratedContent",
            "relationshipType":"OWNER"
         }
      ],
      "supportedUploadMechanism":[
         "SYNCHRONOUS_UPLOAD"
      ]
   }
}

RESPONSE

    {
    "value": {
        "uploadMechanism": {
            "com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest": {
                "headers": {
                    "media-type-family": "STILLIMAGE"
                },
                "uploadUrl": "xxxx"
            }
        },
        "mediaArtifact": "urn:li:digitalmediaMediaArtifact:(urn:li:digitalmediaAsset:xxx,urn:li:digitalmediaMediaArtifactClass:feedshare-uploadedImage)",
        "asset": "urn:li:digitalmediaAsset:xxx"
    }
}

Next step I uploaded my image using curl with a valid access token and the uploadUrl I get a 201 HTTP response but I see nothing in my LinkedIn profile. also when I check the status of my upload it shows me a success message.

{"recipes":[{"recipe":"urn:li:digitalmediaRecipe:feedshare-image","status":"AVAILABLE"}],"serviceRelationships":[{"relationshipType":"OWNER","identifier":"urn:li:userGeneratedContent"}],"mediaTypeFamily":"STILLIMAGE","created":1606729082880,"id":"C4D22AQE6h5xe3HYYiQ","lastModified":1606729322981,"status":"ALLOWED"}

So why I can't see my upload in the Linkedin timeline, please? I tried with both image and video but nothing is shown in my newsfeed. Also, I checked my access token and it contains necessary permission: r_liteprofile, w_member_social

Upvotes: 1

Views: 1618

Answers (1)

Rishi Dua
Rishi Dua

Reputation: 2334

Uploading an asset does not make it available on your profile.

Assets API only uploads the image/video and stores it on LinkedIn platform. You can however use this asset to create a UGC Post to see it on your personal/company profile.

To do that, you'll have to use the ugcPosts API. ie call POST https://api.linkedin.com/v2/ugcPosts with "media": "urn:li:digitalmediaAsset:XXX", from the Assets API response in the payload.

Example:

{
    "author": "urn:li:organization:5590506",
    "lifecycleState": "PUBLISHED",
    "specificContent": {
        "com.linkedin.ugc.ShareContent": {
            "media": [
                {
                    "media": "urn:li:digitalmediaAsset:XXX", // from the Assets API response
                    "status": "READY",
                    "title": {
                        "attributes": [],
                        "text": "Sample Video Create"
                    }
                }
            ],
            "shareCommentary": {
                "attributes": [],
                "text": "Some share text"
            },
            "shareMediaCategory": "VIDEO"
        }
    },
    "targetAudience": {
        "targetedEntities": [
            {
                "locations": [
                    "urn:li:country:us",
                    "urn:li:country:gb"
                ],
                "seniorities": [
                    "urn:li:seniority:3"
                ]
            }
        ]
    },
    "visibility": {
        "com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
    }
}

Reference: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/ugc-post-api#sample-request

Upvotes: 3

Related Questions