Lavanya
Lavanya

Reputation: 3913

Linkedin integration in Android

I have a problem with linkedin integration in my app. I have created own API's to connect with linkedin.

I have used HttpConnection to get the data and post the data. All the web services are running fine when I run each web service separately but when I run all the web services at a time its showing Http errors.

The first web service is working fine but when it comes to second web service its showing Http error code 401.

Please can anyone let me know why is it not working.

Upvotes: 1

Views: 2157

Answers (2)

Thasneem
Thasneem

Reputation: 245

scribe.jar is another third party jar that you can use for linkedin integration to android application.It encapsulates all the linkedin functions like getting profile informations, posting network updates, etc and very simple to use. You can find examples here : https://github.com/fernandezpablo85/scribe-java/blob/master/src/test/java/org/scribe/examples/LinkedInExample.java

Upvotes: 0

Kirsten Jones
Kirsten Jones

Reputation: 2706

If you're not using a standard OAuth library there are various pitfalls you can encounter when trying to sign requests. There's an existing Android library linkedin-j on the LinkedIn Libraries and Tools page here: https://developer.linkedin.com/documents/libraries-and-tools

That having been said, if you want to proceed with your own OAuth implementation, there are a few things you can do to try to troubleshoot issues. A 401 error usually means that the OAuth signature is incorrect, so I suspect one of the following is happening:

  • Your code is re-using the signature from a previous request
  • Your code is making a different type of request (POST vs. GET)
  • You're adding query parameters directly via the URL

Each of these can cause the incorrect signature to be generated when the OAuth signature generation isn't being done correctly.

There's a page on common OAuth errors here: https://developer.linkedin.com/documents/common-issues-oauth-authentication

And a page on debugging API calls here: https://developer.linkedin.com/documents/debugging-api-calls

The OAuth Test Console here can be used to verify that the signature you're generating is correct for the call you're making: https://developer.linkedin.com/oauth-test-console

Good luck, and if you're still having trouble try posting your request headers/body and response headers/body so it's possible to troubleshoot.

Upvotes: 1

Related Questions