forked from twilio/twilio-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f65d5c
commit 14ce815
Showing
2 changed files
with
41 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'rubygems' | ||
require 'twilio-ruby' | ||
|
||
# print a list of all phone calls, what phone number each was to/from, and how | ||
# much each one cost. | ||
|
||
# put your Twilio credentials here. you can find your AccountSid and AuthToken | ||
# at the top of your account dashboard page located at: | ||
# https://www.twilio.com/user/account | ||
account_sid = 'AC043dcf9844e04758bc3a36a84c29761' | ||
auth_token = '62ea81de3a5b414154eb263595357c69' | ||
|
||
# set up a client | ||
client = Twilio::REST::Client.new(account_sid, auth_token) | ||
|
||
calls = client.account.calls.list | ||
|
||
begin | ||
calls.each do |call| | ||
price = call.price || '0.00' # since apparently prices can be nil... | ||
puts call.sid + "\t" + call.from + "\t" + call.to + "\t" + price | ||
end | ||
calls = calls.next_page | ||
end while not calls.empty? |