Skip to content
Advertisement

How can i upload and post an image to linkedin using api?

I’m trying to create an app for posting images to linkedin. Linkedin has an api which accepts an image url and a message, but it seems to be not the exact way to post an image since it is showing my image as a link instead of an image. But in the case of Buffer App, it displays full image, not the URL. Is there any way to post images to linkedin via api. Anyone please help me to sort this out.

Advertisement

Answer

Use Linkedin V2 API.Below code will upload the image.

curl -i --upload-file /Users/peter/Desktop/superneatimage.png --header "Authorization: Bearer redacted" 'https://api.linkedin.com/mediaUpload/C5522AQGTYER3k3ByHQ/feedshare-uploadedImage/0?ca=vector_feedshare&cn=uploads&m=AQJbrN86Zm265gAAAWemyz2pxPSgONtBiZdchrgG872QltnfYjnMdb2j3A&app=1953784&sync=0&v=beta&ut=2H-IhpbfXrRow1'

I suggest you to use Guzzle HTTP client to exicute this in your PHP application

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement