Leveraging the Twitter Adapter in ICS – Tweeting through Oracle Integration Cloud Service

2

The Oracle Integration Cloud Service – ICS – comes loaded with a rich collection of Cloud Adapters. These adapters facilitate the integration with SaaS applications and internet services of various natures. These include Oracle SaaS applications (such as RightNow, Eloqua, ECommerce Cloud, ERP Cloud, HCM Cloud), on premises ERP applications (SAP, EBusiness Suite, Siebel) and assorted third party applications such as SalesForce, Facebook, Google Mail and Task, LinkedIn and Evernote. Through these adapters, interacting with said applications and services becomes a simple, declarative operation instead of a custom programming effort.

imageIn this article, I will use the Twitter Adapter to create a connection to a Twitter Account (leveraging the Twitter API under the covers). The Twitter Adapters exposes over a dozen operations. I will use just the operation to publish a message (aka Tweet) in this example. From ICS, I will expose an integration through a simple REST connection. This allows trusted consumers to publish Tweets in a very easy way – leaving the authorization details and the API intricacies to ICS.

The steps I went through:

  • Grant access to [ICS Connection] app in the Twitter developer page and generate API Key and Consumer Key
  • Create a new ICS Connection based on Twitter Adapter; set up the API Key and Consumer Key
  • Create an ICS REST Connection (to expose)
  • Create an integration – between REST Connection as inbound (source) to Twitter Connection (as outbound destination); configure the endpoint (inbound) and operation (inbound and outbound)
  • Create the mappings for request and response
  • Define the tracking – business identifiers
  • Activate the integration
  • Test the exposed REST connection from any REST client, for example SoapUI, to Tweet a message through a simple REST POST call

Most of these steps are explained by the screenshots you will find below.

One step I did not have to through because the certificate already had been set up on my ICS instance is uploading Twitter’s security certificate (see in ICS docs: Uploading the SSL certificate and on Twitter: https://dev.twitter.com/overview/api/tls ). At the end of the article, you will find what I believe the steps should be in cases where this certificate is not already set up.

 

Grant access to [ICS Connection] app in the Twitter developer page and generate API Key and Consumer Key

Go to the Twitter developer page at https://dev.twitter.com and follow the instructions in the ICS documentation.

SNAGHTML9d78f9

image

image

image

SNAGHTML9f2963

SNAGHTML9fa64f

 

Create a new ICS Connection based on Twitter Adapter; set up the API Key and Consumer Key

image

image

image

image

 

Create an ICS REST Connection (to expose)

image

image

 

Create an integration – between REST Connection as inbound (source) to Twitter Connection (as outbound destination)

image

image

image

image

image

And the destination:

image

image

Pick the operation in the Twitter API that is to be invoked:

image

image

 

Create the mappings for request and response

image

And the response mapping:

SNAGHTMLa5696f

 

Define the tracking – business identifiers

image

Activate the integration

image

Find the exposed endpoint:

image

image

Test the exposed REST connection

from any REST client, for example SoapUI, to Tweet a message through a simple REST POST call

    image

    Note: basic authorization has to be provided using valid ICS credentials

    And verify in the Twitter web client:

    image

    image

    image

    Verify the monitoring in ICS:

    image

    image

    image

    Uploading an SSL Certificate

    Certificates are used to validate outbound SSL connections. If you make an SSL connection in which the root certificate does not exist in Oracle Integration Cloud Service, an exception is thrown. In that case, you must upload the appropriate certificate. A certificate enables Oracle Integration Cloud Service to connect with external services. If the external endpoint requires a specific certificate, request the certificate and then upload it into Integration Cloud Service.

    One way to get hold of the certificate is through the browser – for example Google Chrome:

    image

     

    SNAGHTML982934

    SNAGHTML9901a8

    Download certificate:

    image

    And upload in ICS:

    image

    image

    image

    image

     

    See in ICS docs: Uploading the SSL certificate and on Twitter: https://dev.twitter.com/overview/api/tls

    Resources

    ICS Documentation on Twitter Adapter: https://docs.oracle.com/cloud/latest/intcs_gs/ICSTW/toc.htm

    Twitter developer page at https://dev.twitter.com.

    About Author

    Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press books: Oracle SOA Suite 11g Handbook and Oracle SOA Suite 12c Handbook. Frequent presenter on community events and conferences such as JavaOne, Oracle Code and Oracle OpenWorld.

    2 Comments

    1. Hi LUCAS JELLEMA,

      Thanks for the detailed explanation. I have tried this example in ICS, But the exposed rest service is not being called when I trigger from SOAP UI. There are no instances in tracking. I have uploaded Cert to ICS. Could you please help me on this.\

      Thanks
      Subbu

    Leave a Reply