3

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

Atulkumar V. Jain
  • 5,102
  • 9
  • 44
  • 61
Matrix
  • 7,477
  • 14
  • 66
  • 97

1 Answers1

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.

Kirsten Jones
  • 2,681
  • 1
  • 17
  • 20
  • hi @kirsten, Many Thanks for response. actually i am experimenting with same client as you mentioned, i just added search user code and invitation request code to existing code, and also my app consumer and secret key. – Matrix Jul 12 '12 at 18:23
  • there is some problem with authorization because i am able to send request (invitation request) using linkedin developer console. – Matrix Jul 12 '12 at 18:25
  • i have also check authorization header field, it is also proper, all required fields are present and valid. but still trying to figure out problem.....! – Matrix Jul 12 '12 at 18:28
  • @Kirsten Jones I am facing the same problem while working with Linkedin Invitation API. Here is the link: http://stackoverflow.com/questions/13066297/linkedin-invitation-api-error-401-unauthorized-iphone-sdk Please help me out. – Apple Oct 25 '12 at 10:15