2015-09-28 75 views
2

當我嘗試使用linkedin編寫登錄代碼時,出現如下所示的錯誤。什麼是linkedin中的api_key javascript api開發人員

未捕獲錯誤:您必須指定一個有效的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> 

回答

0

我相信你在尋找https://developer.linkedin.com/support/faq。我對嗎?

Click on the My Apps link in the top navigation menu to manage your LinkedIn applications. From here, you can create a new application if you don't already have one, or view the details of your existing applications. You will find your Client ID (otherwise known as API Key/ID or Consumer Key/ID) listed in the "Authentication" side nav link, underneath the header "Authentication Keys".

+3

是的,我做到了,但它給客戶端ID和客戶端密鑰,但不API_KEY – Chickenturtle

+0

但儘管如此,看這裏 - https://developer.linkedin.com/docs/js-sdk 你的LinkedIn應用的API密鑰。您可以在我的應用程序中找到您的API密鑰值。 它必須在某個地方;) – Luzgan

+0

並嘗試遵循,以及http://support.heateor.com/how-to-get-linkedin-api-key/ – Luzgan

相關問題