简体   繁体   English

您必须指定一个有效的JavaScript API域

[英]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.

相关问题 您必须将有效的JavaScript API域指定为此密钥配置的一部分。 在LinkedIn - You must specify a valid JavaScript API Domain as part of this key's configuration. in LinkedIn linkedin Uncaught错误:您必须指定一个有效的JavaScript API域作为此密钥的配置的一部分 - linkedin Uncaught Error: You must specify a valid JavaScript API Domain as part of this key's configuration Linkedin SDK您必须指定一个有效的JavaScript API域作为此密钥配置的一部分 - Linkedin SDK You must specify a valid JavaScript API Domain as part of this key's configuration Javascript REST API - 您必须指定 API 密钥才能发出请求 - Javascript REST API - You must specify an API key to make request 您必须指定 &#39;to&#39; 属性 - You must specify 'to' property JavaScript重定向/域指定 - Javascript redirection / domain specify 有效的JavaScript API域,可在Chrome扩展程序中使用linkedIn - Valid JavaScript API Domain for linkedIn to use in Chrome extension React和firebase setState&#39;您必须指定“ to”属性&#39; - React and firebase setState 'you must specify the “to” property' MongoInvalidArgumentError:选择器必须是有效的 JavaScript object - MongoInvalidArgumentError: Selector must be a valid JavaScript object 用JavaScript保存cookie如何指定域? - Save cookies with javascript how to specify domain?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM