Click here to Skip to main content
15,936,758 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have to post image to the linkedin from my mvc applicaiton.

What I have tried:

<blockquote class="quote"><div class="op">Quote:</div> function ShareLinkedIn() {
            var Array = $('#VacancyGrid [name=id]:checked').map(function() {
                return $(this).val();

            if (Array == "") {
                showAlertMessage("Alert", "Please select vacancy."); // alert();
            } else {

                    url: '@Url.Action("LinkedINAuth", "Vacancy")',
                    data: { vacancyIds: Array.toString() },
                    async: true,
                    type: 'POST',
                    cache: false,
                    success: function(datas) {
                        var html = datas.split(',')[0].toString();
                        var image = datas.split(',')[1].toString();
                        //txp2rKYpuKZXaaYC5kB-m13KnVE Initialize with your app public key  QdDTUvqmt2uX6kg4M5Fonvyn7c4
                        // $('#auth').show();
                        OAuth.popup('linkedin2').then(linkedin => {
                            console.log('linkedin:', linkedin);
                        // Get your linkedin profile id:
               => {
                            let id =;
                            url: "/v2/shares",
                            data: JSON.stringify({
                                "content": {
                                    "contentEntities": [
                                            "description": "We are hiring Deserving candidate for Dubai Location",
                                            "entityLocation": html,
                                            "thumbnails": [
                                                    "imageSpecificContent": {
                                                        "width": 1200,
                                                        "height": 628
                                                    "resolvedUrl": image
                                    "title": "Current Hiring"
                                "distribution": {
                                    "linkedInDistributionTarget": {}
                                "owner": `urn:li:person:${id}`,
                                "subject": "Current Hiring",
                                "text": {
                                    "text": "Current Hiring!"
                headers: {
                    "x-li-format": "json",
                    "X-Restli-Protocol-Version": "2.0.0",
                    "Content-Type": "application/json"
            }).then(data => {
                console.log("success:", data);
        }).fail(err => { console.log("err:", err) });

Updated 21-Sep-22 2:08am
Richard MacCutchan 15-Nov-19 3:14am    
Most likely by using linkedin's published interface.
prakash00060 15-Nov-19 4:08am    
have you any solution
prakash00060 15-Nov-19 8:41am    
have you any other options in mvc

I would look into using the LinkedIn API, which is well documented by MicroSoft:
Share on LinkedIn - LinkedIn | Microsoft Docs[^]
Share this answer
prakash00060 15-Nov-19 8:41am    
have you any other options in mvc
There is a great NuGet Packages available + find code samples here

Super Easy Way to Automate Posting on LinkedIn with .Net - CodeHelper[^]

Quick explanation
1. You create your LinkedInHelper by giving your access token
2. Execute the ShareImage Method

LinkedInHelper _helper = new() { AccessToken = "AQVjgglPI-......" };
var _id = await _helper.GetAuthorID();
_helper.AuthorType = AuthorTypes.Company;
byte[] _image = File.ReadAllBytes(@"c.\...\LinkedIntestImage.jpeg");
await _helper.ShareImage("Welcome LinkedIn Image Share", _image, VisibilityTypes.Public, "My Image Title", "MyImage Description");
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900