Test social media post sharing via LinkedIn for an organization page
gutsytechster opened this issue · comments
Currently, sharing social media posts through LinkedIn has been tested manually for a user profile. It could not be tested for an organization LinkedIn page due to lack of permissions to do so.
The code is written, keeping in mind, the organization page.
Hence, the piece of code needs to be tested for an organization page when LinkedIn allows us to have those permissions.
Reference to the API endpoint which is used is provided here https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/ugc-post-api#create-ugc-posts
The post data needed to be sent with UGC(User Generated Content) API is similar to
post_data = {
'author': 'urn:li:organization:5590506',
'lifecycleState': 'PUBLISHED',
'specificContent': {
'com.linkedin.ugc.ShareContent': {
'shareCommentary': {
'text': post.text
},
'shareMediaCategory': 'NONE'
},
},
'visibility': {
'com.linkedin.ugc.MemberNetworkVisibility': 'PUBLIC'
},
}
However it is tested for author
value as urn:li:person:Yk8347
i.e. for a person and not for an organization.
The line within code that corresponds to this code change is https://github.com/CuriousLearner/nexus/pull/26/files#diff-7c07be7ecf752ba7bae9810c4d28c85cR80
The line within code corresponding to the master branch is https://github.com/CuriousLearner/nexus/blob/master/nexus/social_media/services.py#L80