Important: The following instructions assume you some technical knowledge, and already have a verified Twilio account you can use for sending messages. For more information see: https://www.twilio.com/docs/messaging/onboarding
Gather required information:
Log in to your Twilio account, and go to the API Keys page.
Copy aside your Account SID.
Create a new API Key. If you use restricted keys, make sure you give it the permissions needed for the API you will use.
Copy aside the Key SID and the Secret, and keep them safe.
Click "Done".
Set up in Coho:
In Coho, create a new HTTP Action.
Choose the right HTTP method and URL, depending on the type of action you want to do. For example, to send messages, choose
POST
as the method and this URL:https://api.twilio.com/2010-04-01/Accounts/<Account SID>/Messages.json
In the payload, enter the appropriate URL Encoded properties, as described in the Twilio API reference. For example, for SMS messages, it should look like:
Body=Hello&From=%2B14155552345&To=%2B14155552345
To craft the Basic Authentication header, run the following command in your terminal:
βecho -n '<Key SID>:<Secret>' | base64
The output should be a Base64 encoded string, similar to
bXlzaWQ6bXlzZWNyZXQ=
. Add the following header to the action configuration:{
"Authorization": "Basic bXlzaWQ6bXlzZWNyZXQ=",
"Content-Type": "x-www-form-urlencoded"
}You can now test the action and save it.