简体   繁体   中英

linkedin connect API gives error 401 - iphone

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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