當我嘗試使用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>
是的,我做到了,但它給客戶端ID和客戶端密鑰,但不API_KEY – Chickenturtle
但儘管如此,看這裏 - https://developer.linkedin.com/docs/js-sdk 你的LinkedIn應用的API密鑰。您可以在我的應用程序中找到您的API密鑰值。 它必須在某個地方;) – Luzgan
並嘗試遵循,以及http://support.heateor.com/how-to-get-linkedin-api-key/ – Luzgan