You must specify a valid JavaScript API Domain as part of this key's configuration. in LinkedIn
Asked Answered
T

4

7

I try to create a MVC4 application with LinkedIn share option with callback option.

i refer my script in my Layout.cshtml with my app id.

  <script type="text/javascript" src="//platform.linkedin.com/in.js">
        api_key: APIkeyGOEShere
    </script>
    <script type="text/javascript">
        function testme(count) {
            alert("That document has been shared: " + count + " times");
        }
    </script>

But the firebug shows a message like below image

enter image description here

But i am sure my AppID is correct. I don't know what is the reason to appear this error.

Edits

I place the api_key inside the single quote

 <script type="text/javascript" src="//platform.linkedin.com/in.js">
        api_key: 'APIkeyGOEShere'
    </script>

But i get a different in firebug

Error: API Key is invalid throw new Error("API Key is invalid");

Any format need to place API key inside of the javascript.

Please help.

Trim answered 24/1, 2014 at 6:21 Comment(0)
M
10

Your API key looks a bit short...

Did you just register your API key? According to Eugene O'Neill on this forum:

After registering an API key and specifying a valid domain, it may take up to 30 minutes for the changes to take affect, so if it doesn't work immediately, go grab a coffee and check back in a few.

Also, make sure you specified your API Domain.

He outlines the full series of steps as follows:

To register an API key:

head over to https://www.linkedin.com/secure/developer

log in and click the link to Add New Application

fill out the following info:

  • Company (choose from the dropdown)

  • Application Name (e.g. My Company Jobs)

  • Description (e.g. For receiving applications from job applicants)

  • JavaScript API Domain (this is an important step. this is the website the button will go on e.g. http://www.mycompany.com)

  • Application Use (select one from the list, if nothing matches your needs, choose "other")

  • Developer Contact Email (your email address)

  • Phone (a phone number you can be reached at if there are issues with the account)

check "I agree" Security text (enter the characters you see just above it)

Musician answered 24/1, 2014 at 7:31 Comment(4)
Thank you very much sir for your valuable answer... I have an API key it's created on last month. I delete my existing key and create a new application for my web application. I follow your instruction thank you very much.Trim
Hi Sir, did you use any javascript api for sharing content in linkedIn with success call back option. please let me know when you see this. Thanks.Trim
I have not, but I'd imagine there is. This article from 2010 is probably out of date, but it might be a good start: lockergnome.com/social/2010/12/01/…Musician
Thanks for adding the steps, I was missing to add "Valid SDK Domains:",Fuqua
T
13

Remove the quotes around apikey. That is the problem.

Terreverte answered 5/9, 2014 at 9:7 Comment(0)
M
10

Your API key looks a bit short...

Did you just register your API key? According to Eugene O'Neill on this forum:

After registering an API key and specifying a valid domain, it may take up to 30 minutes for the changes to take affect, so if it doesn't work immediately, go grab a coffee and check back in a few.

Also, make sure you specified your API Domain.

He outlines the full series of steps as follows:

To register an API key:

head over to https://www.linkedin.com/secure/developer

log in and click the link to Add New Application

fill out the following info:

  • Company (choose from the dropdown)

  • Application Name (e.g. My Company Jobs)

  • Description (e.g. For receiving applications from job applicants)

  • JavaScript API Domain (this is an important step. this is the website the button will go on e.g. http://www.mycompany.com)

  • Application Use (select one from the list, if nothing matches your needs, choose "other")

  • Developer Contact Email (your email address)

  • Phone (a phone number you can be reached at if there are issues with the account)

check "I agree" Security text (enter the characters you see just above it)

Musician answered 24/1, 2014 at 7:31 Comment(4)
Thank you very much sir for your valuable answer... I have an API key it's created on last month. I delete my existing key and create a new application for my web application. I follow your instruction thank you very much.Trim
Hi Sir, did you use any javascript api for sharing content in linkedIn with success call back option. please let me know when you see this. Thanks.Trim
I have not, but I'd imagine there is. This article from 2010 is probably out of date, but it might be a good start: lockergnome.com/social/2010/12/01/…Musician
Thanks for adding the steps, I was missing to add "Valid SDK Domains:",Fuqua
D
10

In this form:

JavaScript Settings

You have to enter your domain, click Add, and confirm by clicking Update button.

I didn't do that for the first time. And even though my domains appeared in the screen, they weren't submitted.

I run into this problem as well.

I was debugging the problem for an hour when I realized that LinkedIn doesn't save my "Valid SDK Domain" in the first place.

Diaper answered 3/7, 2015 at 9:10 Comment(3)
Trailing slash? Must or must not be present? Because for Twitter trailing slash is cause of error.Couturier
Your answer solved the issue for me. My url is with a trailing slash.Couturier
for the first-timers, click "Add", then click "Update" button.Spector
C
0

To add up to Paul Nowak correct answer that helped to solve my issue.

Don't forget to set correct url here, too.

Menu option

enter image description here

And URL here

enter image description here

Couturier answered 6/10, 2017 at 9:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.