Integrating Axway Application Integration and Twitter

Integrating Axway Application Integration and Twitter

This blog entry is part of a two-part series where we will ultimately build a Cloud to Cloud (C2C) integration between Twitter and Slack, utilizing a Scheduled trigger to execute an automated orchestration Flow.

In this blog entry, I will cover how to:

  1. Create a Twitter developer account and configure an OAuth application for integration.
  2. Use the Axway Integration Builder (IB) iPaaS to integrate and manage your Twitter instance.
  3. Do some basic initial testing of the integration against the Twitter REST APIs.

What is Twitter?

Twitter is a Social Media platform where users post short messages called “Tweets” and interact. Twitter is used both for general social interaction, but also leveraged frequently by “Twitterbots” to automate posts, often for social networking or marketing. Twitter is also a huge repository of real-time information and can be used as a data source for AI/ML type solutions.

Configure Twitter

Create a Twitter Developer Account and OAuth Application

Twitter provides developer accounts, which you will need to sign up for in order to use their REST APIs. You can sign up for an account here. The sign-up processes is not standardized and vary depending on why you want access to the Twitter APIs and how you want to use them. Because this process flow is unique based on your use case, it is not explicitly covered here.

  • Once you have created and logged into your Twitter Developer account, it is time to make an OAuth application that we can connect to in order to authenticate with Axway Integration Build. Open a browser and navigate here.
  • Click on “Create an App.” Fill out the form to create your OAuth Application. The most important part here is the Callback URL for authentication within our iPaaS: https://auth.cloudelements.io/oauth. Most other fields are subjective. You can see my configuration here:
App icon
  • Once you have created an OAuth application, you are good to integration with Axway IB. Leave this tab open for easy authentication in the next step.

Integrate Your Twitter Instance with Axway Integration Builder

  • Login to the Axway Platform and navigate to the IB Sandbox.
  • Under Connectors, search for “Twitter” and choose to Authenticate. If you left the tab open, you should only have to add a name to the Connector Instance and click “Create Instance.” For this demo, I wanted to use a Scheduled Trigger to enable a variable to be used for the Event Polling associated with the hashtags for easy reuse of my Flow Template. In other cases, you may wish to use the built-in Twitter Event Polling, as shown below. For this use case, we will not enable events.

Twitter

Test the Twitter Integration in Axway Integration Builder

  • Navigate to your instance’s API docs. From here we can do some initial testing against the REST APIs to see how developers might start working with the Twitter APIs. Here is a suggested flow for testing the statuses API to get current statuses with specific hashtags.
    • Call GET /statuses. This requires you specify a Where query to limit the results. For my testing, I wanted to see live Tweets about natural disasters, so I started with the following: q=’#earthquake’. Note the single quotes around the parameter.
    • This gives you back a ton of information. To limit this, I updated the Fields section to only pull back the data I might want to use in my application: created_at,text,user.screen_name,entities.hashtags

Conclusion

At this point, you should have a working Twitter integration with Axway Application Integration through our Integration Builder solution. In my next blog post, I will show you how to set up a Scheduled Trigger to pull periodically data from Twitter based on real-time hashtags and post the results to another cloud application, to build a Cloud to Cloud flow.

We will use Slack for this, similar to how we did in the Service Now flow (see that blog series for more info on how to set up Slack). In this flow, Slack will just be a generic endpoint to display the results of the flow, but any application could replace it to be the of the data pulled from Twitter.

Stay tuned, enjoy and reach out if you have any questions, comments or concerns with this configuration!