Technical Articles
Serverless Extensions – Part 2: Configure SAP Cloud Platform Open Connectors to connect to Whatsapp and Twitter.
This is one of my favourite services offered in the SAP Cloud Platform and it is super easy to set up and use. I have discussed the service – SAP Cloud Platform Open connectors in 2 of my blogs. Please refer them for the information about the initial steps.
Our scenario requires setting up of two connectors – Twitter and Twilio(Whatsapp).
Set up Twitter Connector
Launch the ‘Open Connectors’ application. It will take you to the admin screen which lists the available connectors. In the connectors menu, look for the ‘Twitter’ connector and select ‘Authenticate’.
Enter a name for your instance and click ‘Create Instance’
This will authenticate you with your twitter account and take you to the API documentation page. This page lists the APIs available to connect with Twitter.
For our scenario, we need the Post operation on ‘Statuses’ entity to tweet on the authenticated account.
Let us do a quick test.
Click ‘Try it out’. Enter the JSON as shown below. This contains the status text to be posted to Twitter.
Click execute.
You should be able to see the tweet in the twitter account.
In the CURL script which is displayed after execution, notice the POST URL and the Authorisation string. We will be using this in Part 4 where we call the connector from SAP Cloud Platform Functions.
Set up Twilio Connector for Whatsapp
This has already been described in great detail in the following blogs. Please refer them and set up the Twilio connector for sending Whatsapp messages.
Ferry Djaja’s blog on Whatsapp Chat interface
Sravya Gajavelli‘s blog on integrating Whatsapp with SAP UI5 Application
Similar to the twitter connector, make note of the POST URL and the Authorisation string. We will need it to send WhatsApp messages from Functions.