LinkedIn People Profile API 未返回 publication/publisher 的出版物字段

LinkedIn People Profile API not returning publication/publisher for the publications field

根据 https://developer.linkedin.com/documents/code-samples 中的 PHP 示例,我正在使用 LinkedIn 人员资料 API 来 return 从用户授予权限后的资料中得出的结果。

基本上可以用,我正在成功检索结果,可以使用它们。

但是,https://developer.linkedin.com/documents/profile-fields#publications 中描述的出版物字段并未 return 包含所有信息。

我的请求代码如下:

$user = fetch('GET', '/v1/people/~:(first-name,last-name,location:(name,country:(code)),num-connections,headline,industry,specialties,summary,public-profile-url,email-address,interests,publications,languages,skills,three-current-positions,phone-numbers,main-address,twitter-accounts,primary-twitter-account,educations,num-recommenders)');

所有字段 return 结果。出版物字段还 return 出版物标题和日期,但没有 return 任何 publication/publisher 信息,即使个人资料清楚地包含个人资料中的信息。

为了调试,我使用了以下代码行:

print "<br /><br />publications: " . print_r(json_encode($user->publications), true);

这就是我用于所有其他 returned collections 的内容。我发现 JSON 格式便于以后编写脚本。

所有其他 collections 我 return 似乎有完整的信息(只要在配置文件中输入),但对于出版物,结果只是:

publications: {"_total":2,"values":[{"date":{"day":1,"month":7,"year":2010},"id":91608681,"title":"\"Universe 2 - Echoes of the Sun\" at Osaka Expo '90 (Part 2 of 4)"},{"date":{"day":1,"month":6,"year":1992},"id":91608683,"title":"\u201cAn Expositional Virtual Environment\u201d"}]}

如您所见,它 returned 了关于 2 个出版物的信息,但只有日期和标题(和 ID)。没有 publication/publisher 信息 returned。然而,对于这两种出版物,都输入了日期、标题和 publication/profile。

有人可以提示我可能遇到的问题吗?

谢谢,

道格

我已经弄明白了。文档没有指出这一点,但默认情况下不会返回 publication 字段的所有值。令人惊讶的是,默认情况下不返回 publication/publisher 值。

我将对出版物的请求 属性 更改为:

publications:(id,title,publisher,date,summary)

现在我得到返回的发布者信息:

publications: {"_total":2,"values":[{"date":{"day":1,"month":7,"year":2010},"id":91608681,"publisher":{"name":"Journal of the Japan Society for Computational Engineering and Science (JSCES)"},"title":"\"Universe 2 - Echoes of the Sun\" at Osaka Expo '90 (Part 2 of 4)"},{"date":{"day":1,"month":6,"year":1992},"id":91608683,"publisher":{"name":"Computer Images & Hi-Vision (Nippon Image Society Journal)"},"title":"\u201cAn Expositional Virtual Environment\u201d"}]}

我希望这对遇到类似问题的其他人有所帮助。

道格