Tuesday, December 22, 2020

#820 - OIC Twilio Adapter - send SMS / WhatsApp from Oracle Integration









A very simple example of sending an SMS / WhatsApp from OIC via Twilio.

Before I begin...

Acknowledgements

Thanks to my colleague Pavan D. for providing me with the base .iar file and the impetus for writing this post.

Let's Go

First step - get a Twilio Trial account from twilio.com

Then get a trial number - this will be used to send messages.


 








Second Step - Gather data required for creating the Twilio connection in OIC

We will need the SID and Token -












Third Step - Create the Connection in OIC








Fourth Step - Create the Integration














REST Trigger - Request Payload - remember I am just sending an SMS -

so required fields are from number / to another / message



Rest Trigger - Response Payload -







Twilio Invoke Configuration - 









Mapping -



Deploy and Test - 















WhatsApp Setup












So, I've got a new number for WhatsApp.

I need to change my request payload as follows - 






essentially just adding whatsapp: as suffix to the from and to numbers.

I also add the following url - https://www.oracle.com/a/ocom/img/rh03-blockchain-hero-r1.png

This, which I enter as Attribute3, is mapped to the Target field - MediaUrl

Deploy and Test












I can also review the logs in Twilio -





 





















No comments: