segunda-feira, 17 de dezembro de 2018

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


Source: https://blogs.sap.com/2018/12/13/openconnectors-linkedin-integration-made-simple-with-sap-cpi-open-connectors/

Nenhum comentário:

Postar um comentário