[英]You must specify a valid JavaScript API Domain
I need some help with the LinkedIn API. 我需要有关LinkedIn API的帮助。 I'm getting the following error:
我收到以下错误:
Uncaught Error: You must specify a valid JavaScript API Domain as part of this key's configuration. 未捕获的错误:您必须指定一个有效的JavaScript API域作为此密钥的配置的一部分。
But I already add my domain to the Javascript SDK Domains. 但是我已经将我的域添加到Javascript SDK域中。 My domain is the next one:
我的域是下一个域:
http://is01.inthegra-app.com.ar:8083/apex/ http://is01.inthegra-app.com.ar:8083/apex/
LinkedIn take it as a valid one but I still having the same error. LinkedIn认为它是有效的,但我仍然遇到相同的错误。 The code in my page is this one:
我页面中的代码是这样的:
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: API_KEY_HERE;
onLoad: onLinkedInLoad;
authorize: true;
</script>
<script type="text/javascript">
function mandoMensaje(){
onLinkedInLoad();
}
function onLinkedInLoad() {
IN.Event.on(IN, "auth", shareContent);
}
function onSuccess(data) {
console.log(data);
}
function onError(error) {
console.log(error);
}
function shareContent() {
var payload = {
"Content-Type": "application/json",
"x-li-format": "json",
"comment": "Hello world...",
"content": {
"title": "LinkedIn API Test",
"description": "Publish in LinkedIn from HTML and JavaScript",
"submitted-url": "http://www.inthegra.com.ar",
"submitted-image-url": "http://www.inthegra.com.ar/img/logo-inthegra-blanco.png"
},
"visibility": {
"code": "anyone"
}
};
IN.API.Raw("/people/~/shares?format=json")
.method("POST")
.body(JSON.stringify(payload))
.result(onSuccess)
.error(onError);
}
</script>
/apex/
is not part of the hostname/domain and port that your Javascript is being executed from. /apex/
不是执行Javascript的主机名/域和端口的一部分。 Try removing that portion of the value in your application's configuration. 尝试在应用程序的配置中删除该部分值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.