1. Why PDF document posts outperform link posts on LinkedIn
Native swipeable PDF carousels keep readers inside the LinkedIn feed without outbound link throttling. Through the raw LinkedIn REST API, publishing one requires initializing a document upload, streaming the PDF binary to LinkedIn's upload URL, waiting for document processing, and referencing the resulting urn:li:document asset in a Posts API payload.
PubNio handles the multi-step upload automatically whenever you attach a staged application/pdf asset up to 100 MB to a LinkedIn target.
const deck = await ws.media.importUrl({
url: "https://cdn.example.com/q4-architecture-slides.pdf",
});
const draft = await ws.posts.create({
isDraft: true,
title: "Q4 Architecture Slides",
text: "Seven lessons from building idempotent multi-platform publishing.",
targets: [
{
accountId: linkedinAccountId,
placement: "document",
media: [{ mediaId: deck.mediaId }],
},
],
});
await ws.posts.publish(draft.postId, { idempotencyKey: "li-deck-q4" });
2. Avoiding silent 60-day LinkedIn token expiry
LinkedIn member OAuth access tokens expire after 60 days. PubNio tracks token expiry metadata and returns the typed account_token_expired error during preflight validation so you can prompt a one-click reconnect before a launch post misses its slot.