I'm using LinkedIn API to create posts. I also use the LinkedIn Mentions to create posts with mentions.
I can successfully create a post with mention except if I add in the message emojis or accents. Without mentions feature, I'm able to create any post with success.
Posts that work:
- Hello Stackoverflow
- Hello 😄 Stackoverflow
- Hellóó Stackoverflow
- Hello Stackoverflow (with mention to the linkedin page)
Posts that do not work:
- Hello 🤣 Stackoverflow (with mention to the linkedin page)
- Hellóó Stackoverflow (with mention to the linkedin page)
I receive the following error:
com.linkedin.content.common.ResponseException: share commentary is invalid
I send the following data to LinkedIn:
array (
'author' => 'urn:li:organization:X',
'lifecycleState' => 'PUBLISHED',
'visibility' =>
array (
'com.linkedin.ugc.MemberNetworkVisibility' => 'PUBLIC',
),
'specificContent' =>
array (
'com.linkedin.ugc.ShareContent' =>
array (
'shareCommentary' =>
array (
'text' => 'Hellóó Stackoverflow',
'attributes' =>
array (
0 =>
array (
'length' => 13,
'start' => 8,
'value' =>
array (
'com.linkedin.common.CompanyAttributedEntity' =>
array (
'company' => 'urn:li:organization:X',
),
),
),
),
),
'shareMediaCategory' => 'NONE',
),
),
)
source https://stackoverflow.com/questions/69381494/linkedin-api-ugc-post-mention-share-commentary-is-invalid
Comments
Post a Comment