This package provides a library for interacting with Twilio's API. Install using
$ cabal install twilio
Documentation soon to be available on Hackage. For now, see markandrus.github.io/twilio-haskell.
For TwiML, see twiml-haskell.
You can create a REST API client and fetch the calls resources as follows
{-#LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad.IO.Class (liftIO)
import System.Environment (getEnv)
import Twilio
import Twilio.Calls as Calls
import Twilio.Messages
main :: IO ()
main = runTwilio' (getEnv "ACCOUNT_SID")
(getEnv "AUTH_TOKEN") $ do
-- Print Calls.
calls <- Calls.get
liftIO $ print calls
-- Send a Message.
let body = PostMessage "+14158059869" "+14158059869" "Oh, hai"
message <- post body
liftIO $ print message
Feel free to contribute to any of the open [issues]
(https://github.com/markandrus/twilio-haskell/issues), bugfixes, etc. When you
think you're ready to merge, ensure the tests are passing and open a pull
request. If you are adding new functionality, please include new tests as well.
Finally, add yourself to the AUTHORS
file.