I'm using Linkedin API from https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/vector-asset-api?tabs=http#upload-the-image and I get the uploadUrl after registering the image. But I receive null when I want to upload the image. this is my code with php:
$body = file_get_contents('C:/Users/HH/Desktop/test.jpg');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.linkedin.com/mediaUpload/C4D22AQFyt9bYpBuRcw/feedshare-uploadedImage/0?ca=vector_feedshare&cn=uploads&m=AQIUeWqFh419_gAAAXyYlBzYF8LNZVjHdjGaH103jP998K1bpxeJPGGJtw&app=82730583&sync=1&v=beta&ut=1ccVodv_trJFY1" );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $body );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain','Authorization: Bearer ' . $token));
$result=curl_exec ($ch);
var_dump($result);