DEV Community

Frederik Van Lierde
Frederik Van Lierde

Posted on • Edited on

1

How to get the AuthorID (and Type) to use with the API and poost on LinkedIn Pages

The following code explains how to post on your LinkedIn Business Page (Company pages and Showcase Pages) and how you can find the author id for your page

Many people are confused with the AuthorID in the API
When you create your access code, you do this with your personal account. But posting on LinkedIn pages doesn't use the personal ID. The API needs the Page ID and Page Type

The following code lets you find how you can find it the correct ID.

Prerequisites

Online Tool

I have created an online tool to make it easier:
Online Tool

The Code

use CodeHelper.API.LinkedIn;

LinkedInHelper _helper = new() { AccessToken = "AQWJ0..." };
List<Organisation> _orgs = await 
                _helper.GetUserOrganizationAccessControl();
foreach(var _org in _orgs)
{
   Console.WriteLine(_org.OrganizationalID + " " + 
                              _org.Localized.LocalizedName);
}
Enter fullscreen mode Exit fullscreen mode

The Author ID's

OrganizationalID return the urn:li:TYPE:ID

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay