Using the LinkedIn API in a C # Application

I am creating a small Windows Forms application and want to access information from the company search API. I don’t even want to write anything in profile.

I went to open a web browser and asked my user to enter a verification code in my application.

This is so incredibly frustrating! There are tons of code for Python and Java, but .NET just has some baked working demos that aren't even built properly.

I need your help.

I have already seen the official LinkedIn Developer Toolkit , but the project does not even build!

So, I went and downloaded the LinkedIn.dll library, which supposedly acts as a shell for accessing data.

How can I access the API using it? I already have an API key and a token secret key, both stored in my App.config file, pending use.

Thanks!

+4
source share
3 answers

You can find examples related to the Libraries and Tools pages on the LinkedIn Developer Portal. A β€œC # working example,” published by one of our community members, works well ...

https://developer.linkedin.com/sites/default/files/LinkedInAuth.rar.zip

We have some more C # examples, but this should get you started - it has an example of getting an access token and request.

+1
source

Maybe you should check out the LinkedInNET lib on github . API coverage is not populated, but it is growing.

There is a NuGet package

PM> Install-Package Sparkle.LinkedInNET 

You will have a problem authenticating your user in your winforms application.

+1
source

You need to get used to the OAuth authorization mechanism. This essentially forces the user to go to the linkedin site, subscribe and allow your application to access their data from the related ones.

It is briefly described in the documentation for LinkedIn development tools . Explore the WebOAuthAuthorization class. It is very small and has two important methods:

  • BeginAuthorize(Uri callback)
  • CompleteAuthorize()

The Former method sends the user to the site for authorization. The callback parameter is used to link it to notify your site of the authorization result. At this point, you must call the CompleteAuthorization() method for your application to complete the session creation with the associated ones for that specific user.

0
source

Source: https://habr.com/ru/post/1387280/


All Articles