3

嗨,我正在使用linkedin iphone api通过电子邮件发送连接邀请

请求 xml:

<?xml version='1.0' encoding='UTF-8'?>
    <mailbox-item>
        <recipients>
            <recipient>
                <person path="/people/email=%@">
                    <first-name>%@</first-name>
                    <last-name>%@</last-name>
                </person>
            </recipient>
        </recipients>
        <subject>Invitation to Connect</subject>
        <body>Please join my professional network on LinkedIn.</body>
        <item-content>
            <invitation-request>
                <connect-type>friend</connect-type>
            </invitation-request>
        </item-content>
    </mailbox-item>

其中 %@ 表示动态值。内容类型:text/xml 请求方法:POST

响应 xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <error>
        <status>401</status>
        <timestamp>1342092385484</timestamp>
        <request-id>FX9SK3ZVG9</request-id>
        <error-code>0</error-code>
        <message>[unauthorized]. OAU:076lb67kcfe2|dc01dc46-4d78-44d2-9f9b-49053b8094db|*01|*01:1342092534:iZ/mDlOL7eo4fGv2O/rQZKe8oCA=</message>
    </error>

还验证了授权标头是否正确。我还使用 oAuth 调试控制台进行了调试,我在调试控制台中输入了相同的值,但签名密钥不同。

那么签名密钥有问题吗?我也去过论坛。但我仍然无法找到确切的问题。

任何帮助将不胜感激。

谢谢

4

1 回答 1

1

There's a sample LinkedIn iPhone client on github here: https://github.com/synedra/LinkedIn-OAuth-Sample-Client

You should be able to use that to see what the proper headers look like. As you're on a macintosh (or wouldn't be developing for the iPhone), I strongly encourage you to use HTTPScoop to watch the traffic when using the simulator and see what the differences are between what your application is doing and what the sample client does.

于 2012-07-12T17:51:56.187 回答