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

Lucas Jellema 4
0 0
Read Time:3 Minute, 20 Second

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 Post Author

    Lucas Jellema

    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, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.
    Happy
    Happy
    0 %
    Sad
    Sad
    0 %
    Excited
    Excited
    0 %
    Sleepy
    Sleepy
    0 %
    Angry
    Angry
    0 %
    Surprise
    Surprise
    0 %

    Average Rating

    5 Star
    0%
    4 Star
    0%
    3 Star
    0%
    2 Star
    0%
    1 Star
    0%

    4 thoughts on “Leveraging the Twitter Adapter in ICS – Tweeting through Oracle Integration Cloud Service

    1. Can we Tweet an image using the Twitter Adapter because Tweet Opertaion doesn’t have a field/element to send Image

    2. Thanks for the detailed explanation but wanted to know can we tweet an images along with message using ICS. Could you please explain this.

    3. 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

    Comments are closed.

    Next Post

    Using the ICS Connectivity Agent with an On-Premises Database

    In this third article about the Connectivity Agent we deep-dive into the details. We learn how to use the ICS Connectivity Agent in combination with an on-premises database. For more information about the architecture and installation of the agent I recommend to read these two articles first. This article continuous where the previous article about the […]
    %d bloggers like this: