简体   繁体   English

通过LinkedIn Button申请,错误400错误请求

[英]Apply by LinkedIn Button, 400 error bad request

I'm trying to add an 'Apply by LinkedIn' button to an expressionengine site. 我正在尝试将一个“通过LinkedIn申请”按钮添加到expressionengine网站。 I've created my app on LinkedIn and am using the JS SDK and have followed the guide in order to do so. 我已经在LinkedIn上创建了我的应用,并且正在使用JS SDK,并已按照指南进行操作。 My code is below: 我的代码如下:

<script type="text/javascript" src="//platform.linkedin.com/in.js">
            api_key: MY CLIENT ID
        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) {
            console.log(data);
        }

        // Handle an error response from the API call
        function onError(error) {
            console.log(error);
        }

        // Use the API call wrapper to request the member's profile data
        function getProfileData() {
            IN.API.Raw("/people/~:(id, first-name, skills, educations, languages, twitter-accounts)")
            .result(onSuccess).error(onError);
        }
    </script>

I've added the button markup as suggested: 我已经按照建议添加了按钮标记:

<script type="in/Login"></script>

SO the button is displayed and upon click I'm presented with my account to authorise the app, however, upon authenticating, the button disappears and I get the following error: 这样就会显示该按钮,并且在单击时会向我提供我的帐户以授权该应用程序,但是,通过身份验证后,该按钮消失了,并且出现以下错误:

Failed to load resource: the server responded with a status of 400 (Bad Request)
ObjecterrorCode: 0message: "Unknown field {_first-name} in resource {Person}"requestId: "LT59BVDVU2"status: 400timestamp: 1436259208629__proto__: Object

Thanks! 谢谢!

使用驼峰而不是破折号:IN.API.Raw(“ / people /〜:(id,名字,技能,教育,语言,推特帐户)”)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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