Skip to Content
Technical Articles
Author's profile photo Sriprasad S Bhat

OpenConnectors-LinkedIn Integration made simple with SAP CPI & Open Connectors

Introduction:

Hope in SAP TechEd#2018 most of us heard about Open Connectors and In below blog will try to show an end to end scenario of LinkedIn Share by leveraging SAP CP -Open Connectors.

Scenario:

Create a new post in LinkedIn by sending the message from POSTMAN.

 

Create an App in LinkedIn:

Login to https://www.linkedin.com/developers/ and follow below steps

Step 1:

Click on Create new app and fill all the required details like shown below

Click on Create app by accepting legal terms then you are successfully created with app which should look like below

Step 2:

Configure the authentication with open connectors redirect url [ https://auth.cloudelements.io/oauth ]

Open Connector Configuration:

Step 1:

Login to Open Connectors and click on Connectors & search for LinkedIn Connector.Click on Authenticate.

Step 2: 

Use the API Key & Secret from LinkedIn Application and click on Create instance which will trigger below screens to login & allow your application from LinkedIn perspective.

Step 3:

This will redirect to Open Connector Instance page with status connection result and then click on Test API Docs.

Step 4:

Navigate to share API and click on try out.

Step 5:

Add below payload in body which will create a post with some content in LinkedIn once you hit execute button.

Step 6:

Navigate to curl once you get response body with code 200 and copy the below highlighted parts which will be used in SAP CPI HTTP receiver adapter.

Step 7:

Its time to see the result of post created directly from Open Connector API Docs.

SAP CPI IFlow creation:

Lets create an iflow to push the data from POSTMAN tool and get it posted in LinkedIn.

Step 1:

Add HTTP channel with address /create_share.

Step 2:

Add content modifier to delete all the headers( just make sure any unwanted headers will not be sent further to Step#4.

Step 3:

Add content modifier to set the header Authorization with the value highlighted in Step#6 of open connectors.

Step 4:

Add Request-Reply step with HTTP receiver adapter to have end point url captured from Step#6 of open connector.

Now are you are done with all the required configuration and good to go with deployment.

Testing:

Copy the end point url from SAP CPI monitoring like below

Configure the Postman and pass below payload as body

{
  "comment": "Check out developer.linkedin.com!",
  "content": {
    "title": "LinkedIn Developers Resources",
    "description": "Leverage LinkedIn's APIs to maximize engagement",
    "submitted-url": "https://developer.linkedin.com",  
    "submitted-image-url": "https://example.com/logo.png"
  },
  "visibility": {
    "code": "anyone"
  }  
}

Lets see the result.

Conclusion:

Open Connectors really reduce the development effort of Integration Developer by solving most of the complexities from connection perspective.

Reference:

[ 1 ] – LinkedIn Share API

[ 2 ] – Open Connector Blog series

 

Hope this help our developers of community..!

Regards,

Sriprasad Shivaram Bhat

Assigned Tags

      17 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Praveen Tirumareddy
      Praveen Tirumareddy

      Good one Sri 🙂

      thanks for the detailed blog.

      regards,

      Praveen T

      Author's profile photo Sidharth VR
      Sidharth VR

      Hi Sriprasad,

      A very beautiful blog explaining how the open connector works!!

      A few points that is stopping here.

      When I send the JSON payload, I'm not able to post it. I get a response like below

       

      {

      "requestId": "5c1a6358e4b0b792d1984a94",

      "message": "Request failed",

      "providerMessage": "errorCode - 0, message - Access to posting shares denied, requestId - 6LAR1DSAZ6, status - 403, timestamp - 1545233240705"

      }

       

      Referring to few blogs I found that in app Permissions, we have to keep w_share enabled. I did that too. but no luck. My guess is that, LinkedIn is restricting the APIs to access due to data security Policy. Any methods to resolve this issue ?

       

      Thanks,

      Sidharth VR

      Author's profile photo Sriprasad S Bhat
      Sriprasad S Bhat
      Blog Post Author

      Hello Siddharth,

      Please follow the below then you should be able to resolve the issue.

      Once you are done with first time configuration of LinkedIn Instance( save it ),go back to home page and follow below.

      Hover on LinkedIn Icon and click on instance.

      Click on edit

      Click on re-authenticate which will redirect to LinkedIn sign on or if already session alive it will get re-authenticated.Then try to post it should work.

      Regards,

      Sriprasad Shivaram Bhat

       

      Author's profile photo Sidharth VR
      Sidharth VR

      Hi Sriprasad,

       

      That was quick. And it works !!

      Thanks,

      Sidharth VR

      Author's profile photo Harshal Narkhede
      Harshal Narkhede

      Great Blog Sriprasad !!

      Author's profile photo Rashmi Joshi
      Rashmi Joshi

      Great Blog, I was able to replicate it.

      Thanks for sharing it!!!

      Could you please share business requirement where this can be used?

      Please correct me if my understanding is wrong here, if we want to connect to any 3rd party cloud application system then they will provide us URL and authorization details to communicate.

       

      How this openConnector going to help me in designing my IFlows in CPI?

       

      BR,

      Rashmi

      Author's profile photo Sriprasad S Bhat
      Sriprasad S Bhat
      Blog Post Author

      From LinkedIn integration perspective you might use it in SF RCM/RKM while dealing with recruitment.

      Apart from SAP CPI this can be used with other SAP CP services like SAP Cloud Platform API Management,SAP Mobile Services,SAP Workflow Services.

      From Integration Developer perspective, Yes url will be given by 3rd party systems and type of authentication they support.In above blog just to give clear picture, shown end to end process.

      From SAP CPI perspective it reduces the complexity of connectivity part.If you take above example only first you need to get the OAuth2.0 credentials and then you need to pull the token which leads you to make multiple calls to other system & you need to design above connectivity part in your IFlow.

      Other Example I can give is usage of SOAP Axis adapter to connect to SuccessFactors and usage of SucessFactors Adapter in CPI.Usually customer landscape comprises of multiple 3rd party systems instead of creating Adapters inside SAP CPI,Open Connectors are rolled out [ which can be used across multiple SAP CP services ]

      Suggest you to go through blog series written by Divya Mary

      Hope this clear your doubts.

      Regards,

      Sriprasad Shivaram Bhat

      Author's profile photo Vijay Kapuganti Kumar
      Vijay Kapuganti Kumar

      Hi Sri,

       

      Nice blog, successfully executed the test . but i have one question , how did you get the structure for posting the Json payload. please post that as well , which is more helpful.

      Thanks and Regards,

      Vijay.

      Author's profile photo Sriprasad S Bhat
      Sriprasad S Bhat
      Blog Post Author

      Hello Vijay,

      Its already available and go through the link provided in Reference section.

      Regards,

      Sriprasad Shivaram Bhat

      Author's profile photo Vijay Kapuganti Kumar
      Vijay Kapuganti Kumar

      Hi Sri,

       

      Thanks 🙂

       

      Regards,

      Vijay

      Author's profile photo SUBBA MEKALA
      SUBBA MEKALA

      Hi

      What did you use for authorization in the postman?

      I get this error:

      X-message-code →PWD_WRONG
      WWW-Authenticate →Basic realm="SAP HANA Cloud Platform"
      Transfer-Encoding →chunked

      Thanks and pls reply

      Author's profile photo Dale Byrne
      Dale Byrne

      Hi,

       

      Great blog but i have one issue.

      i am getting the following error when using the " try it out" feature -

      {
        "requestId": "5cab0e85e4b0b942749c9d08",
        "message": "Request failed",
        "providerMessage": "errorCode - 0, message - This resource is no longer available under v1 APIs, requestId - CNYZGNDSSL, status - 410, timestamp - 1554714247263"
      }
      
      Have you seen this before? 
      
      Thanks 
      
      Dale
      Author's profile photo Sriprasad S Bhat
      Sriprasad S Bhat
      Blog Post Author

      Hello Dale,

      There was a change at LinkedIn side for these APIs and we are working with OpenConnectors development team to get this fixed.

      Will update the blog once fix made by them.

      Regards,

      Sriprasad Shivaram Bhat

      Author's profile photo Shweta Kulkarni
      Shweta Kulkarni

      Dear Sriprasad Shivaram Bhat

      Could you please confirm ,if Open connectors has pre-built "Linkedin" Connector as i couldn't locate the same in trial account atleast.

      Please find snapshot for reference

      Thank you

      Author's profile photo Sangam Ludhani
      Sangam Ludhani

      Hi Shweta and Sriprasad,

      @Shweta Kulkarni, I am also not able to see LinkedIn connector on SCP Neo Open Connectors platform.

      @ Sriprasad Shivaram Bhat, did you use this connector on SCP Cloud Foundry Open Connectors platform?

      Thanks and Regards,

      Sangam Ludhani

      Author's profile photo Souvik Sinha
      Souvik Sinha

      I believe Linkedin open connector  is removed from catalogue. I also did not see same in open connector catalogue.

       

      Regards,

      Souvik

      Author's profile photo Mostafa Keshtari
      Mostafa Keshtari

      Hi Sriprasad,

       

      Thank you for sharing it,

      I have question please , is it applicable to use OpenConnectors to integrate LinkedIn with SAP SuccessFactors Recruiting Management RCM, I want to integrate when the candidate apply from their LinkedIn profile the candidate profile will be automatically created in Recruiting Management career site and to the job requisition that they apply, using API in OpenConnectors , Is this doable ?

      Thank you in advance,

      Mostafa Keshtari