Teaching how to integrate LinkedIn with ICS

This section shows you how to use the LinkedIn ICS Connector that comes out of the box.

Obtain your LinkedIn Connector in ICS

In order to create a LinkedIn Connector you need to get the client id and client secret of the LinkedIn Account you want to connect to. For this:

  • Create your app by clicking on “Create Application”
  • Complete information about your app.

  • Once completed click Submit
  • Copy your Client Id and Client Secret

Copy and keep your Client ID and Secret secured.

  • Ensure that you tick the right permissions that you want to grant. Then click Update

  • Enter the OAuth 2.0 Authorized Redirect URL callback of your ICS domain. It is in the form of:

https://%5Byour_server%5D/icsapis/agent/oauth/callback

In this case:

https://soa12c.vbox.oracle.com:7002/icsapis/agent/oauth/callback

  • Then click on Update

Create a LinkedIn Connection in ICS:

In this section, we are going to create a LinkedIn Connection that will simplify the integration

  • Open ICS and go to Connections
  • Click on Create New Connection
  • Select the LinkedIn adapter

  • Enter a sensible name and Description.
  • Set the Connection Role to Invoke. Then click on Create

  • Enter a Connection Administration Email if you want
  • Click on “Configure Security

  • Enter the Client ID, Client Secret that you obtained before:

  • Then, enter the scope that you require. If you require multiple scopes, seprate them by a +

    This has to align with the privileges that you enabled/allowed in your LinkedIn application previously. In my case:

r_basicprofile+r_emailaddress+w_share

  • Then, click on Provide consent.
  • It will ask you to authenticate. Enter your ICS admin username and password

  • It will then ask you to enter you LinkedIn credentials.

  • Click “Allow Access“.
  • Congratulations, you have granted access to your LinkedIn application to access your LinkedIn Account on your behalf via the ICS Connection.

  • Go back to ICS (it will still be open in the previous browser window). Your LinkedIn Connection is configured properly.

  • Click on Save, Test and Save to complete the connection.

Create a REST connection in ICS

In this section we are going to create a very simple REST connector that will allow us to integrate into LinkedIn via the LinkedIn connector that we just created earlier.

Note: This is a generic REST connector. If you have already completed the other blogs around how to build an integration to either Facebook, LinkedIn, Google Calendar, etc. Then potentially you can simply reuse that REST connector. If not, feel free to create one and enter a different name.

  • Log into ICS and go to Connections.
  • Click on “Create New Connection” – This time select REST adapter.

  • Enter a name for your REST adapter. In my case, I’m calling it “s2v-iia-rest-msg-connector”
  • In this case, I just want it to trigger my post, so I select just Trigger.
  • Enter a description if you want. Then click on Create

  • Enter an email if you want.
  • We are not setting any security for now.
  • Click Save and then Test. Ensure you get a green 100% status. Click save again and “Exit Connection

  • Congratulations, you have created two connectors! One LinkedIn connector and one REST connector. In the next section we are going to build an integration between them.

Post a message in your LinkedIn account using a REST API via ICS

In this section we are going to create a very simple integration to Post a message to my LinkedIn account. We will expose this as a REST API using both connectors that we built previously, the LinkedIn and REST connectors respectively.

  • Log into ICS if not already there
  • Go to Integrations.
  • Click on “Create New Integration”

  • For now, let’s just create a simple mapping. Select “Basic Map Data

  • Enter a name for your Integration. In my case, I call it “s2v-iia-rest2ln-integration
  • Enter a description if you want and then click “Create

  • You will get a clean integration.

  • On the right, find the REST connector that you built earlier. If you have many, you can enter part of the name at the top and the list will be filtered.

  • Once you have your REST adapter on the list of connections, drag and drop it to the “Drag and Drop a Trigger” section
  • It will open the REST connector configuration wizard.

  • Enter the following information:
    • What do you want to call your endpoint: LinkedInPostMessage
    • What does this endpoint do? This endpoint will receive a message and send it to LinkedIn adapter, so that it creates a new post
    • What is the endpoint’s relative resource URI? /social/linkedin/message
    • What action does the endpoint perform? POST
    • Configure a request payload for this endpoint: Ticked
    • Configure CORS (Cross Origin Resource Sharing): Ticked

  • Click Next.
  • Select the Request Payload Type: JSON

  • Click on the <> link and enter a JSON format as you wish to send your POST body payload. Something like:

{“message”:”message”}

  • Then, click OK.
  • Leave the Media Type to JSON, and click Next.

  • CORS Configuration – Allowed Origins: *

  • Click Next. For the summary, review all and click Done.

  • That’s it, we have configured a REST Trigger, as part of this integration.
  • Now, search for your LinkedIn connection and drag and drop it into the “Drag and Drop an Invoke” droppable area.
  • It will show you the LinkedIn connection wizard. Enter a name and description.

  • Click Next. Select “Status Update” from the allowed Operations – This will allow update status on the user’s LinkedIn timeline. For example, when the user writes something on their timeline. Then click Next.

  • Review the Summary and click “Done“.

s

  • The integration should look like this:

  • Click on the Map in the middle and then click +

  • In the mapper drag the message element under “request-wrapper” into the target comment element.

Notice that the structure within “request-wrapper” is the one that you defined when creating freely the JSON payload that you are expecting as input. Pretty cool huh?

For Visibility > Code, LinkedIn allows the following codes: anyone and connections-only – In this case we are going to enter “anyone” manually, as we always want everybody to see our updates in LinkedIn.

  • For this click on the code link and enter the word anyone as shown below (No quotes):

  • Click Save. This will close the window and bring you back to the Mapping window. It should look like this:

  • Click Save on the Mapping window

  • Exit the mapper. The integration should look like this:

  • Click on “Tracking”

  • Drag and drop the campaign (id) element under “request-wrapper” into the Tracking Field

  • Save your integration.

Notice that it shows a warning because we don’t have any response and fault. In a real scenario we would configure those, but we didn’t select it in this example for simplicity purposes.

  • Exit the Integration. Notice that your integration is still to be “Activated”

  • Click on the green “Activate” label on your adapter.
  • Select to Enable tracing and click Yes.

  • Congratulations! Your integration is complete.

  • Click the “information” icon for your integration and copy the Endpoint URL

Since I am using a test environment, the Endpoint is not connected to the Public Cloud, if you click on it will open up a broken link. If you are using your own ICS account, you will not experience this situation. However, let me tell you how I fixed mine… I just removed the “ics/faces/null/” bit from the URI.

I will end up to something like this:

https://%5Bserver-location%5D/integration/flowapi/rest/S2V_IIA_REST2LN_INTEGRAT/v01/metadata?_afrRedirect=21626860551479

  • Try it in a browser and make sure you get the expected metadata:

Notice that it will show you the Metadata descriptor of your REST API endpoint, for example, the Accepted Media Type, A JSON request sample, Allowed methods, CORS configuration, etc.

  • Use POSTMAN, SOAPUI or any other REST Test client to send a REST POST command. In this case I am using SOAPUI.

  • In order to get the Endpoint URL, copy the link below and remove the last bit from “metadata”. Then just copy the API that you designed, you can copy it from the metadata page. In this case: “/social/linkedin/message”

 

The REST API will be something like this:

https://%5Bserver_endpoint%5D/integration/flowapi/rest/S2V_IIA_REST2LN_INTEGRAT/v01/social/linkedin/message

The last bit in red represents the actual URI of your API created in ICS.

  • Make sure to change the method to POST and in the body enter the POST body payload in the structure that you created as part of the ICS integration. You can also copy the entered JSON sample from the metadata page:

  • In my case I entered this:

{“message”:”Don’t miss the Speed 2 Value – Integration in Action Workshop… Soon it will come to your city. Stay tuned”}

  • Leave the Media Type as application/json

  • Click the green icon to send the request. You will receive a 202 Accepted response – See that as Raw

  • Finally, confirm that you see the update went through. A nice way to do it is by asking your LinkedIn’s accounts friends. For example, in this example I used a LinkedIn account of “Barack Dorman” and since I am a friend of his, I can see his update on my mobile:

How cool is that?

  • Congratulations! You just integrated to LinkedIn via Oracle Integration Cloud Service.

Author: Carlos Rodriguez Iturria

I am extremely passionate about people, technology and the most effective ways to connect the two by sharing my knowledge and experience. Working collaboratively with customers and partners inspires and excites me, especially when the outcome is noticeable valuable to a business and results in true innovation. I enjoy learning and teaching, as I recognise that this is a critical aspect of remaining at the forefront of technology in the modern era. Over the past 10+ years, I have developed and defined solutions that are reliable, secure and scalable, working closely with a diverse range of stakeholders. I enjoy leading engagements and am very active in the technical communities – both internal and external. I have stood out as a noticeable mentor running technology events across major cities in Australia and New Zealand, including various technology areas such as, Enterprise Integrations, API Management, Cloud Integration, IaaS and PaaS adoption, DevOps, Continuous Integration, Continuous Automation among others. In recent years, I have shaped my role and directed my capabilities towards educating and architecting benefits for customers using Oracle and AWS Cloud technologies. I get especially excited when I am able to position both as a way to exceed my customers’ expectations. I hold a bachelor degree in Computer Science and certifications in Oracle and AWS Solutions Architecture.

One thought on “Teaching how to integrate LinkedIn with ICS”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s