尝试通过类型为VIDEO的API创建UGC帖子时出现权限问题。所有其他ugc帖子类型均按预期工作。得到以下问题:
{ "message": "com.linkedin.publishing.util.common.ResponseException: urn:li:developerApplication:7242213 does not have permission to create ugc posts",
"status": 401 }
Request:
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linkedin.com/v2/ugcPosts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"author\":\"urn:li:person:<person ID>\",\n \n \"lifecycleState\": \"PUBLISHED\",\n \"specificContent\": {\n \"com.linkedin.ugc.ShareContent\": {\n \"media\": [\n {\n \"description\": {\n \"attributes\": [],\n \"text\": \"Sample Description\"\n },\n \"media\": \"urn:li:digitalmediaAsset:C4D05AQEulqRDlCUbSA\",\n \"status\": \"READY\",\n \"originalUrl\": \"https://seosamba.com\",\n \"title\": {\n \"text\": \"Official LinkedIn Blog\"\n }\n }\n ],\n \"primaryLandingPageUrl\": \"https://seosamba.com\",\n \"shareCommentary\": {\n \"attributes\": [],\n \"text\": \"Some share text\"\n },\n \"shareMediaCategory\": \"VIDEO\"\n }\n },\n \n \"visibility\": {\n \"com.linkedin.ugc.MemberNetworkVisibility\": \"PUBLIC\"\n }\n}\n",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer AUTH TOKEN",
"cache-control: no-cache",
"content-type: application/json",
"postman-token: 1abac8b6-bbc1-0acd-b469-f83715faeea2",
"x-restli-protocol-version: 2.0.0"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
答案 0 :(得分:0)
我向LI Support发送了请求,然后我得到了返回(两周前):
“你好,阿列克谢,
创建视频UGC帖子目前是列入白名单的功能。有 目前正在将新的视频应用列入白名单。
您可以继续创建不是视频的UGC帖子。
我将暂时搁置它,直到我有更多关于何时可以使用的信息为止。 再次将应用列入白名单。
最好,迈克”
无论如何,我都尝试过此测试,现在不需要VIDEO。 建议您与支持人员联系以重新检查。