UGC Post Image media order not respected

Viewed 240

I'm creating an UGC post with mediaCategory IMAGE and multiple images attached uploaded with the recommended Assets Api.

I've noticed that LinkedIn does not respect the original order we are sending through.

Has anyone experienced this as well or has any idea what I'm missing?

{
    "author": "urn:li:organization:5590506",
    "lifecycleState": "PUBLISHED",
    "specificContent": {
        "com.linkedin.ugc.ShareContent": {
            "media": [
                {
                    "media": "urn:li:digitalmediaAsset:ID1",
                    "status": "READY",
                    "title": {
                        "attributes": [],
                        "text": "Asset 1"
                    }
                },
                {
                    "media": "urn:li:digitalmediaAsset:ID2",
                    "status": "READY",
                    "title": {
                        "attributes": [],
                        "text": "Asset 2"
                    }
                },
                {
                    "media": "urn:li:digitalmediaAsset:ID3",
                    "status": "READY",
                    "title": {
                        "attributes": [],
                        "text": "Asset 3"
                    }
                },
                {
                    "media": "urn:li:digitalmediaAsset:ID4",
                    "status": "READY",
                    "title": {
                        "attributes": [],
                        "text": "Asset 4"
                    }
                },
                {
                    "media": "urn:li:digitalmediaAsset:ID5",
                    "status": "READY",
                    "title": {
                        "attributes": [],
                        "text": "Asset 5"
                    }
                }
            ],
            "shareCommentary": {
                "attributes": [],
                "text": "Some share text"
            },
            "shareMediaCategory": "IMAGE"
        }
    },
    "visibility": {
        "com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
    }
}

Result

1 Answers

POST https://api.linkedin.com/v2/ugcPosts

I think you want to maintain the order of media in single post. But I see same media ID "media": "urn:li:digitalmediaAsset:C5500AQG7r2u00ByWjw", 5 times. May be it is just a dummy message.

I think you should try get on it GET https://api.linkedin.com/v2/ugcPosts/{encoded ugcPostUrn|shareUrn}?viewContext=AUTHOR

and you can see media order. I think media order stays same. It is just how LinkedIn is displaying it.

{
    "author": "urn:li:organization:5590506",
    "lifecycleState": "PUBLISHED",
    "specificContent": {
        "com.linkedin.ugc.ShareContent": {
            "media": [
                {
                    "media": "urn:li:digitalmediaAsset:C5500AQG7r2u00ByWjw",
                    "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"
    }
}
Related