Tutorial: Post Update on LinkedIn via Scribe using Scala

Table of contents
Reading Time: 3 minutes

To post an Update on LinkedIn via your application, that is being built with Play 2.3.x, follow these steps ( this post summarizes the work done step by step).

1) Create a LinkedIn app (if you do not have one already)

Click here – LinkedIn’s Developer Quick Start Guide and create an app. Enter all the details including Site URL. The Site URL could be something like http://www.example.com (but it should be a valid site URL). Also, select the rw_nus setting under the OAuth User Agreement section (otherwise you wont be able to post updates on LinkedIn).

Once you have saved this app, you will get API Key & Secret Key. Take a note of this API Key & Secret Key. We would use them in our code.

2) If you are using Play, then add the API Key, Secret Key & Context URL(Callback URL) in application.conf file.

3) Download a LinkedIn login image from linkedin.png & save it in “public/images” folder of app

4) Add following dependency in build.sbt (or Build.scala for Play 2.1.x or older versions)

5) Add following to routes file in conf folder

6) Let us now create LinkedInAPIController.scala to configure API Key, Secret Key and Callback URL . We would also use this scala file to request access token from LinkedIn & post an update on LinkedIn.

7) Now let us create a template redirectMain.scala.html which would show status of clicking “Share on LinkedIn” link.

So, this is how we can post updates on LinkedIn via Scribe using Scala & Play.

Written by 

Himanshu Gupta is a software architect having more than 9 years of experience. He is always keen to learn new technologies. He not only likes programming languages but Data Analytics too. He has sound knowledge of "Machine Learning" and "Pattern Recognition". He believes that best result comes when everyone works as a team. He likes listening to Coding ,music, watch movies, and read science fiction books in his free time.

2 thoughts on “Tutorial: Post Update on LinkedIn via Scribe using Scala4 min read

Comments are closed.