linkedin connect API gives error 401 - iphone

≯℡__Kan透↙ 提交于 2019-12-07 14:48:13

问题


hi i am sending connect invitation by email using linkedin iphone api

Request 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>

where %@ indicates dynamic value. Content Type: text/xml Request Method: POST

Response 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>

Also verified that authorization header is proper. I have also debugged with oAuth debug console, i have enter same values in debug console, but signature key are different.

So is it a problem with signature key ?? I have also gone through forums. But still i am not able to find an exact problem.

Any help will be appreciated.

Thanks


回答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.



来源:https://stackoverflow.com/questions/11452212/linkedin-connect-api-gives-error-401-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!