什么是linkedin javascript api开发人员的api_key

时间:2015-09-28 08:15:46

标签: javascript java java-ee linkedin-api

当我尝试使用linkedin编写登录代码时,我收到如下错误。

未捕获错误: 您必须在此密钥配置中指定有效的JavaScript API域。

以下是我的JavaScript代码

<script type="text/javascript" src="//platform.linkedin.com/in.js">
    api_key: ######//keep it secret
    authorize: true
    onLoad: onLinkedInLoad
</script>

<script type="text/javascript">

    // Setup an event listener to make an API call once auth is complete
    function onLinkedInLoad() {
        IN.Event.on(IN, "auth", getProfileData);
    }

    // Handle the successful return from the API call
    function onSuccess(data) {
        // Pre-populate your form fields here once you know the call 
        // came back successfully
    }

    // Handle an error response from the API call
    function onError(error) {
        console.log(error);
    }

    // Use the API call wrapper to request the member's basic profile data
    function getProfileData() {
        IN.API.Raw("/people/~:(firstName,lastName,emailAddress)").result(onSuccess).error(onError);
    }

</script>

1 个答案:

答案 0 :(得分:0)

我相信你正在寻找https://developer.linkedin.com/support/faq。我是对的吗?

  

单击顶部导航菜单中的“我的应用程序”链接以管理您的LinkedIn应用程序。   在这里,您可以创建一个新的应用程序,如果您还没有,或查看现有应用程序的详细信息。您将在&#34;身份验证&#34;中找到您的客户ID(也称为API密钥/ ID或客户密钥/ ID)。标题&#34;身份验证密钥&#34;。

下方的侧面导航链接