I'm building a small Windows Forms application and I want to access information from the company search API. I don't even want to write anything to the profile.
I've gotten as far as opening a web browser and asking my user to type in some verification code into my application.
This is so incredibly frustrating! There's tons of sample code out there for Python and Java, but .NET just has some half baked working demos that don't even build properly.
I need your help.
I've already seen the official LinkedIn Developer Toolkit, but the project doesn't even build!
So I went ahead and downloaded the LinkedIn.dll library that supposedly acts as the wrapper for accessing the data.
How can I access the API using it? I already have an API key and a secret token key, both saved in my App.config file waiting to be used.
Thanks!
You might check out the examples linked to from the Libraries and Tools page on the LinkedIn Developer Portal. The "Working C# example" posted by one of our community members works well...
https://developer.linkedin.com/sites/default/files/LinkedInAuth.rar.zip
We have a few other C# examples as well, but this should get you started - it has an example of getting an access token and making a request.
Maybe you should check the LinkedInNET lib on github. The API coverage is not full but it's growing.
There is a NuGet package
PM> Install-Package Sparkle.LinkedInNET
You will have the challenge of authenticating your user within your winforms app though.
You need to get used to the OAuth
authorization mechanism. It essentially makes the user go to the linkedin website, signin and allow your application to access their data from linked in.
It is briefly described in the documentation for the LinkedIn Developer Toolkit. Look into the WebOAuthAuthorization
class. It's really small and has two important methods:
BeginAuthorize(Uri callback)
CompleteAuthorize()
The Former method sends the user to linkedin website for authorization. The callback parameter is used by linked in to notify your website about the result of the authorization. At that point you must call the CompleteAuthorization()
method for your application to finish establishing a session with linked in for this particular user.
来源:https://stackoverflow.com/questions/8582955/using-the-linkedin-api-in-a-c-sharp-application