{"id":22313712,"url":"https://github.com/suxrobgm/linkedin-api","last_synced_at":"2025-07-29T10:32:36.584Z","repository":{"id":38073670,"uuid":"191027000","full_name":"suxrobGM/linkedin-api","owner":"suxrobGM","description":".NET wrapper of the LinkedIn API v2","archived":false,"fork":false,"pushed_at":"2022-06-22T21:15:43.000Z","size":45,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T11:11:31.785Z","etag":null,"topics":["api-client","api-wrapper","linkedin","linkedin-api","unit-test"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suxrobGM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-09T16:02:49.000Z","updated_at":"2023-09-04T09:18:34.000Z","dependencies_parsed_at":"2022-09-17T03:00:28.764Z","dependency_job_id":null,"html_url":"https://github.com/suxrobGM/linkedin-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suxrobGM/linkedin-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suxrobGM%2Flinkedin-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suxrobGM%2Flinkedin-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suxrobGM%2Flinkedin-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suxrobGM%2Flinkedin-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suxrobGM","download_url":"https://codeload.github.com/suxrobGM/linkedin-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suxrobGM%2Flinkedin-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267670360,"owners_count":24125130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","api-wrapper","linkedin","linkedin-api","unit-test"],"created_at":"2024-12-03T22:07:59.380Z","updated_at":"2025-07-29T10:32:36.220Z","avatar_url":"https://github.com/suxrobGM.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LinkedIn API v2\n.NET wrapper of LinkedIn API v2\n\n## Quick start\nFor fully using all profile and organization APIs you app should be have following permissions:\n- w_member_social - Post, comment and like posts on behalf of an authenticated member.\n- r_member_social - Retrieve posts, comments, and likes on behalf of an authenticated member. This permission is granted to select developers only.\n- w_organization_social - Post, comment and like posts on behalf of an organization. Restricted to organizations in which the authenticated member has one of the following company page roles: ADMINISTRATOR, DIRECT_SPONSORED_CONTENT_POSTER, RECRUITING_POSTER\n- r_organization_social - Retrieve organizations' posts, comments, and likes. Restricted to organizations in which the authenticated member has one of the following company page roles: ADMINISTRATOR, DIRECT_SPONSORED_CONTENT_POSTER\n\n\nYou can use api client by using class `LinkedIn.Api.Client`\n\n### Example\n````csharp\nClient client = new Client(\"YOUR_APP_ID\", \"YOUR_APP_SECRET\", new Uri(\"https://your-app-redirect-url.com\"));\nstring[] permissions = new string[] { \"r_liteprofile\", \"r_emailaddress\", \"w_member_social\" };\n\n// To get 3-legged authorization url use GetAuthorizationUrl method\nstring authUrl = client.GetAuthorizationUrl(permissions);\n\n// To get access token use GetAccessTokenAsync method\nAccessToken token = await client.GetAccessTokenAsync(\"AUTHORIZATION_CODE\");\n\n// Or you can use existing access token by setting Token property\nclient.AccessToken = \"YOUR_ACCESS_TOKEN\";\n\n// Get data information about authorized user, if your access token invalid you will get ApiException error\nProfile user = await client.GetOwnProfileAsync();\n\n// Get list of companies which authorized user have approved ADMINISTRATOR role on these companies, required r_organization permission\nOrganization[] organizations = await client.GetCompaniesAsync();\n\n// Get list of shares in authorized user, required r_member_social permission\nEntityElements\u003cShare\u003e shares = await client.GetPostsOnOwnProfileAsync();\n\n// Get list of posts in company page, required r_organization_social permission\nEntityElements\u003cShare\u003e companyShares = await client.GetPostsOnCompanyProfileAsync(\"COMPANY_ID\");\n````\n\n### How to post shares in own profile?\nTo post share on own profile you need w_member_social permission.\nAlso you can see full details on [Microsoft documentation](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api?context=linkedin/compliance/context#post-shares)\n\nMethod 1: post share with existing json data.\n\nFor example we have followed json data for request:\n````json\n{\n    \"content\": {\n        \"contentEntities\": [\n            {\n                \"entityLocation\": \"https://www.example.com/content.html\",\n                \"thumbnails\": [\n                    {\n                        \"resolvedUrl\": \"https://www.example.com/image.jpg\"\n                    }\n                ]\n            }\n        ],\n        \"title\": \"Test Share with Content\"\n    },\n    \"distribution\": {\n        \"linkedInDistributionTarget\": {}\n    },\n    \"subject\": \"Test Share Subject\",\n    \"text\": {\n        \"text\": \"Test Share!\"\n    }\n}\n````\n\n````csharp\n// Post share in authorized user profile, required w_member_social permission\nShare share = Share.FromJson(jsonData); \nShare postedShare = await client.PostOnOwnProfileAsync(share);\n````\n\nMethod 2: post with `LinkedIn.Api.SocialActions.Share` class\n\nWe can programatically create share then will post on LinkedIn\n\nFor example:\n````csharp\nvar contentEntity = new ContentEntity(); //share content\ncontentEntity.EntityLocation = new Uri(\"https://www.example.com/content.html\");\ncontentEntity.Thumbnails.Add(new ShareThumbnails() { ResolvedUrl = new Uri(\"https://www.example.com/image.jpg\") });\n\nvar share = new Share();\nshare.Content.ContentEntities.Add(contentEntity);\nshare.Content.Title = \"Test Share with Content\";\nshare.Subject = \"Test Share Subject\";\nshare.Text.Content = \"Test Share!\";\n\nvar postedShare = await client.PostOnOwnProfileAsync(share);\n````\n\nPosting on company it similar like posting on own profile. But required w_organization_social permission\n\nFor example:\n````csharp\n// Post share in organiztion page, required w_organization_social permission also user should be have one of the following company page roles: ADMINISTRATOR, DIRECT_SPONSORED_CONTENT_POSTER, RECRUITING_POSTER\nShare newPost = Share.FromJson(jsonData);\nShare postedShare = await client.PostOnCompanyProfileAsync(newPost, \"COMPANY_ID\");\n````\n\n### How to post rich media share?\nThe Rich Media Share API allows you to upload images to reference in a personal or organization share. With this API, you can create rich and engaging personal or organization shares that appear on various feeds within the LinkedIn ecosystem. You must be a company administrator to create an organization share.\n\nTo create a rich media share:\n1. Upload the media to LinkedIn's media platform.\n2. Make a personal or organization share referencing that media.\n\nExample:\n````csharp\nvar uploadedMedia = await client.UploadRichMediaAsync(\"path/to/media/file/example.jpeg\");\n\nvar contentEntity = new ContentEntity(useThumbnails: false); //share content\ncontentEntity.EntityUrn = uploadedMedia.LocationUrn; //add rich media urn to content entity\n\nvar share = new Share();\nshare.Content.ContentEntities.Add(contentEntity);\nshare.Content.Description = \"Content description\";\nshare.Content.Title = \"Test Share with Content\";\nshare.Subject = \"Test Share Subject\";\nshare.Text.Content = \"Test Share!\";\n\nvar postedShare = await client.PostOnOwnProfileAsync(share);\n````\n**Note:** Rich media is deleted when a member deletes all shares referencing the media. Attempting to post a share referencing deleted media results in an error.\n\nTo post a multi-image share, upload multiple images to be specified in `ContentEntities` property","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuxrobgm%2Flinkedin-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuxrobgm%2Flinkedin-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuxrobgm%2Flinkedin-api/lists"}