【问题标题】:what is an api_key in linkedin javascript api developer什么是linkedin javascript api开发人员中的api_key
【发布时间】:2015-12-29 22:34:41
【问题描述】:

当我尝试使用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>

【问题讨论】:

    标签: javascript java jakarta-ee linkedin-api


    【解决方案1】:

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

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

    【讨论】:

    • 是的,我做到了,但它提供了客户端 ID 和客户端密码,但没有提供 api_key
    • 但是,请看这里 - developer.linkedin.com/docs/js-sdk 您的 LinkedIn 应用程序的 API 密钥。您可以在我的应用程序中找到您的 API 密钥值。它必须在某个地方;)
    • 是的,但我现在仍然没有收到任何错误。但调用 onLinkedInLoad 函数。
    • @Chickenturtle Client ID 被称为API key
    猜你喜欢
    • 1970-01-01
    • 2010-12-05
    • 2010-11-24
    • 1970-01-01
    • 1970-01-01
    • 2011-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多