简体   繁体   中英

what is an api_key in linkedin javascript api developer

when i am trying to write code for login with linkedin i am getting error like the below.

Uncaught Error: You must specify a valid JavaScript API Domain as part of this key's configuration.

Below is my JavaScript code

<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>

I believe that you looking for https://developer.linkedin.com/support/faq . Am I right?

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".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM