Phase 6 part 4: post as the LinkedIn company page

A second LinkedIn app (Community Management API) with its own sign-in on
Settings → Social accounts: the pages the member may post for are listed
and one chosen, new LinkedIn drafts default to the page or to you, and
each draft can switch before it's published. Schema 25.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 15:05:30 -07:00
co-authored by Claude Opus 5.5
parent 2c42857419
commit 98913971ea
20 changed files with 841 additions and 74 deletions
+23
View File
@@ -1455,6 +1455,29 @@ Tested with Node running the script on a form's data. Not done for real:
creating the Lead Capture in EspoCRM, and the pull request on the real
site.
**Part 4 built (2026-11-22; schema 25: `drafts.linkedin_as`).** From
LinkedIn's docs (Microsoft Learn, community-management): posting as a page
is the same `POST /rest/posts` with `author: urn:li:organization:<id>` and
`w_organization_social`, for members with an approved ADMINISTRATOR,
CONTENT_ADMIN(ISTRATOR) or DIRECT_SPONSORED_CONTENT_POSTER role;
`GET /rest/organizationAcls?q=roleAssignee&state=APPROVED` lists the
member's roles (the docs name the field `organizationTarget` or
`organization`: both are read), and `GET
/rest/organizationsLookup?ids=List(…)` names the pages without needing
admin. The docs don't say which scope the role list needs.
- Settings → Social accounts has a **LinkedIn page** card: the second app's
client ID and secret, its own sign-in (`/auth/linkedin-page/…`, its own
redirect URL), the scopes it asks for (default `w_organization_social
r_organization_admin`, editable to match the approved app), the pages
listed after sign-in to choose from (or a page number typed in, from its
admin address, when they can't be listed), and whether new LinkedIn
drafts default to the page. The only page is chosen automatically. Its
60-day expiry is reminded like LinkedIn's.
- Each LinkedIn draft in Posts has *Post as: You / <the page>*; the
publisher posts with the page's token and URN, or the member's, and says
which sign-in is missing or expired.
Not tried for real: it waits on LinkedIn approving the page app.
### Future enhancements
Not in any phase yet; picked up when the user asks.