我无法通过rest/posts API 创建包含PDF 文档的帖子。我收到 201 Created 回复,但该帖子未显示在 LinkedIn 页面上。使用 LinkedIn Web 服务,我可以使用此 PDF 文档创建帖子。我该如何解决这个问题?
领英版本:202306
X-Restli协议版本:2.0.0
从 Postman > Body > Binary 选择 .pdf 文件后,将 PUT 请求发送到带有这些标头的上传 URL;
{
Authorization: <your_access_token>
X-Restli-Protocol-Version: 2.0.0
LinkedIn-Version: 202308
Content-Type: application/pdf
}
然后您可以查看其上传状态;
GET https://api.linkedin.com/rest/documents/urn%3Ali%3Adocument%3AD4D10AQEre7VgR259d4
PS:您应该像这样对 URL 进行编码
->:
%3A
有了这些标题;
{
Authorization: <your_access_token>
X-Restli-Protocol-Version: 2.0.0
LinkedIn-Version: 202308
}
您应该看到类似这样的回复;
{
"downloadUrl": "https://media.licdn.com/dms/document/media/D4D10AQEre7VgR259d4/ads-document-pdf-analyzed/0/1709787864966",
"owner": "urn:li:person:234adf34",
"id": "urn:li:document:D4D10AQEre7VgR259d4",
"downloadUrlExpiresAt": 1710396000000,
"status": "AVAILABLE"
}
如果状态为AVAILABLE,则表示您的 pdf 文件已成功上传到 LinkedIn 并且可以使用。
您现在可以将文件 ID 添加到您的帖子中。