Problem upload file for Post in LinkedIn V2 API
My function:
`function registerUpload($organization_id,$type='learning-image',$relationshipType='OWNER',$is_person=false){
$request = array( 'json' => array('registerUploadRequest' => [
'owner' => $is_person ? 'urn:li:person:'.$organization_id :'urn:li:organization:'.$organization_id,
'recipes' => [
'urn:li:digitalmediaRecipe:'.$type
],
'serviceRelationships' => [
'relationshipType'=> $relationshipType,
'identifier'=> "urn:li:userGeneratedContent"
]
]));
return $this->linkedin->post($this->version.'/assets?action=registerUpload', $request);
}`
Thank you for creating the issue! One of our team members will get back to you shortly with additional information. If this is a product issue, please close this and contact the particular product's support instead (see https://support.microsoft.com/allproducts for the list of support websites).
@tonyxu-io Can you take a look at this issue?
@chrisou Can you take a look at this issue?
@adrianlaraperez88 the request body format you're providing does not match what we have documented here: https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/share-on-linkedin?context=linkedin/consumer/context#create-a-text-share
@chrisou yes, but the problem is when need upload videos or images,
@adrianlaraperez88 is there a reason you're using the type "learning-image"?
I am reading this in the documentation
Can you share a link to the doc you're referring to?
Please follow the documentation outlined here: https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/share-on-linkedin?context=linkedin/consumer/context#create-an-image-share
Sorry for the time I waiting for LinkedIn approve APP.
/*
@comments For more inforation please read in: https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/vector-asset-api#register-an-upload
*/
function registerUpload($organization_id,$is_person=false,$type='feedshare-image',$relationshipType='OWNER'){
$request = array( 'json' => array('registerUploadRequest' => [
'owner' => $is_person ? 'urn:li:person:'.$organization_id :'urn:li:organization:'.$organization_id,
'recipes' => [
'urn:li:digitalmediaRecipe:'.$type
],
'serviceRelationships' => [
'relationshipType'=> $relationshipType,
'identifier'=> "urn:li:userGeneratedContent" ]
]));
return $this->linkedin->post($this->version.'/assets?action=registerUpload', $request);
}
Call:
print_r($linkedIn->registerUpload('39DCQ9_XIs',true));die;
Error:
Array
(
[serviceErrorCode] => 100
[message] => Field Value validation failed in REQUEST_BODY: Data Processing Exception while processing fields [/registerUploadRequest/serviceRelationships/$*]
[status] => 403
)

Array
(
[message] => com.linkedin.publishing.util.common.ResponseException: urn:li:developerApplication:40909954 does not have permission to create ugc posts
[status] => 401
)
@adrianlaraperez88 please submit a ticket to linkedin.zendesk.com
I have sent many emails but they never answer me, they have for me -5 points in support.
I send again the email now solicited permission for Video Post. Ty, I fixed the problem.
Thank you team at least here they respond. +1