Reputation: 354
Basically I'm trying to post as organisation using the token of the administrator user but I got 403 error:
data: {
serviceErrorCode: 100,
message: 'Field Value validation failed in REQUEST_BODY: Data Processing Exception while processing fields [/author]',
status: 403
}
Here is the request
{
method: 'post',
url: 'https://api.linkedin.com/v2/ugcPosts',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer '+ organisationAdminToken,
'cache-control': 'no-cache',
'x-li-format': 'json',
'X-Restli-Protocol-Version': '2.0.0'
},
data: {
author: 'urn:li:organisation:xxxxxxxx',
lifecycleState: 'PUBLISHED',
specificContent: { 'com.linkedin.ugc.ShareContent': {
'com.linkedin.ugc.ShareContent': {
shareCommentary: { text: 'Testing Linkedin Page Publishing' },
},
visibility: { 'com.linkedin.ugc.MemberNetworkVisibility': 'PUBLIC' }
}
}
Here is the result of the token inspection for the admin token:
{
active: true,
client_id: 'xxxxx',
authorized_at: 1653396511,
created_at: 1653396511,
status: 'active',
expires_at: 1658580512,
scope: 'r_basicprofile,r_emailaddress,r_member_social,r_organization_social,rw_organization_admin,w_member_social,w_organization_social',
auth_type: '3L'
}
Upvotes: 1
Views: 84
Reputation: 354
Solved! The problem is here
author: 'urn:li:organisation:xxxxxxxx',
It should be organization not organisation :)
Upvotes: 1