Twilio API wrapper for Crystal.
-
Add the dependency to your
shard.yml
:dependencies: twilio: github: arubinofaux/twilio.cr
-
Run
shards install
require "twilio"
# put your own credentials here
account_sid = "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
auth_token = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
# set up a client to talk to the Twilio API
client = Twilio::Client.new(account_sid, auth_token)
client.calls.create(
from: "+15005550006",
to: "+15005550006",
url: "http://demo.twilio.com/docs/voice.xml"
)
client.messages.create(
from: "+15005550006",
to: "+15005550006",
body: "Hey there!"
)
client.messages.list(limit: 20)
# put the message sid you want to retrieve here:
message_sid = "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client.messages.fetch(message_sid)
- Client
-
Create a message
-
Fetch a message
-
Read multiple messages
-
Update a message
-
Delete a message
-
Create a call
-
Fetch a call
-
Fetch call recordings
-
Fetch call feedback
-
Read multiple calls
-
Update a call
-
Delete a call
For development, you will need API Credentials from Twilio. You can find instructions on how to acquire one for your account here.
If you found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!
- Fork it (https://github.com/arubinofaux/twilio.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- arubinofaux - creator and maintainer