REST API: 利用記録

UsageRecord REST リソースは、ユーザーの Twilio アカウントで行った利用について、任意の期間とカテゴリーの利用記録を取得するための、シンプルな API を提供します。 アプリケーションで使用するレポートや分析のためのツールを、簡単に作成することができます。 利用記録をエンド ユーザー用に作成された サブアカウント と組み合わせて使用すると、期間ごとに料金請求を行うシステムを、わずかな数の API コールで Twilio API 上に構築することができます。

また、 利用限度トリガー を設定すると、特定のカテゴリーの利用料金が日、月、年ごとの限度、または期間の設定のない利用限 度に達した時に、アプリケーションへ通知することもできます。 トリガーは、エンド ユーザーが利用限度に達したか、またはアプリケーションがランナウェイ要求を発行するかどうかの判定に役立ちます。 利用限度トリガーの詳細については、 利用限度トリガー のドキュメントを参照してください。

UsageRecords リスト リソース

リソース URI

/2010-04-01/Accounts/{AccountSid}/Usage/Records

リソースのプロパティ

このリソースとサブリソースは、利用記録のリストを返します。 UsageRecord リソースには、次のプロパティがあります。

プロパティ 説明
Category 利用のカテゴリーです。 後述の 利用カテゴリー のセクションを参照してください。
説明 利用カテゴリーの、人間が読みやすい形式の説明です。
AccountSid この利用を課金するアカウントです。
StartDate この利用記録に最初に利用が記録された日付です。YYYY-MM-DD 形式で表記します。 日付はすべて GMT で表記されます。
EndDate この利用記録に最後に利用が記録された日付です。YYYY-MM-DD 形式で表記します。 日付はすべて GMT で表記されます。
使用状況 支払いの発生する利用の総量(たとえば、支払いの発生する通話の分数など)です。 これはしばしば Count と同一になりますが、通話のような特定の利用カテゴリーにおいては異なることがあり、 Count は通話の数、 Usage は切り上げられた分数になります。
UsageUnit Usage の単位です。 たとえば、通話の場合は minutes、SMS の場合は messages となります。
Count 利用件数 (例 : 通話の件数) です。
CountUnit Count の単位です。 たとえば、通話の場合は calls、SMS の場合は messages となります。
Price 利用料の合計金額です。
PriceUnit Price で示される額面の通貨単位です。ISO4127形式です。

(例:usd, eur, jpy).
Uri Uri | この利用記録のみを返す URI です。https://api.twilio.com からの相対パスです。
SubresourceUris この利用記録のサブリソースの Uri です。 リスト サブリソースのセクションを参照してください。
Usage、Count、Price プロパティ

それぞれの利用記録では、3つの単位があります。UsageCountPriceです。Usageはそのカテゴリーで使われる主要単位で表示されます。音声通話時間ではminutes、SMSではmessages、イベント数ではCount、音声通話数ではcallsとなります。Priceは利用料の合計金額を表します。

それぞれの利用記録には、利用量の記録に用いる単位を示すフィールドがあります。たとえば、Usage の単位は UsageUnit です。 これらのフィールドを使って、利用一覧を表示するダッシュ ボードを簡単に作成することができます。 たとえば、人間が読みやすい形式の文字列で利用を表示するには、$Usage $UsageUnits$Count $CountUnits$Price $PriceUnits を使用します。

利用カテゴリー

利用記録の Category で、その利用記録が表す利用種別を定義します。 完全なリストはここにありますが、通常よく使われるのは、次のカテゴリーです。

Category 説明
calls すべての音声通話です。Count は通話の件数、Usage は分数です。
sms すべての SMS メッセージです。CountUsage は、いずれも送信したメッセージの件数です。
phonenumbers このアカウントが所有するすべての電話番号です。
recordings 音声通話の録音です。Count は録音件数、Usage は録音分数です。
transcriptions 音声通話のトランスクリプションです。Count はトランスクリプションの件数、Usage はテキスト化された音声の分数です。
合計金額 すべての利用の合計金額です。UsagePrice と同じになります。Count は空になります。 Twilio の利用料金にはどの利用カテゴリーにも当てはまらないものがあり、すべての利用記録の Price の合計が TotalPricePrice と一致しない場合がありますので、注意してください。

HTTP GET

すべての利用カテゴリーの利用記録を返します。 このリストは ページ情報を含みます。

リスト フィルター

デフォルトでは、UsageRecord リソースは、Category ごとに 1 つの利用記録を返します。この利用記録は、アカウントに課金されたすべての利用を対象とし、期間の指定はありません。 利用を Category でフィルターするか、またはオプションの GET クエリ パラメーターを使用して、利用をカウントする日付の範囲を変更できます。 クエリ パラメーターの大文字と小文字は区別されますので、注意してください。

パラメーター 説明
Category この 利用カテゴリーの利用のみを返します。
StartDate この日付の当日またはこの日よりも後に発生した利用のみを返します。 YYYY-MM-DD 形式で表記します。 日付はすべて GMT で表記されます。 今日の日付からのオフセットを指定することもできます。 StartDate=-30days とすると、StartDate は今日から 30 日前に設定されます。
EndDate この日付の当日またはこの日よりも前に発生した利用のみを返します。 YYYY-MM-DD 形式で表記します。 日付はすべて GMT で表記されます。 今日の日付からのオフセットを指定することもできます。 たとえば、EndDate=+30days とすると、EndDate は今日から 30 日後に設定されます。
IncludeSubaccounts true を指定すると、マスター・アカウントとすべてのサブアカウントの使用状況を含めます。 false では、指定されたアカウントのみ取得します。 IncludeSubaccounts は既定では true です。

たとえば、2012 年 4 月のすべての利用記録をリクエストするとします。 ここではクエリ文字列は StartDate=2012-04-01&EndDate=2012-04-30 です。 4 月中の利用について、利用種別につき 1 つの利用記録が返ります。このリストは ページ情報を含みます。 後述の 例 2 を参照してください。

後述の サブリソース を使って、利用を日、月、年ごとにグループ化することもできます。

リスト サブリソース

メインの UsageRecords リスト リソースは、さまざまなサブリソースをサポートしており、便利に使えます。 原則として、次の形式を取ります。

/2010-04-01/Accounts/{AccountSid}/Usage/Records/{Subresource}

サポートするサブリソースは、次の通りです。

サブリソース 説明
Daily 利用カテゴリーごとに、複数の利用記録を返します。各項目は 1 日の利用を表現します。
Monthly 利用カテゴリーごとに、複数の利用記録を返します。各項目は 1 か月の利用を表現します。
Yearly 利用カテゴリーごとに、複数の利用記録を返します。各項目は 1 年の利用を表現します。
AllTime 利用カテゴリーごとに、1 つの利用記録を返します。各項目は指定された日付範囲の利用を表現します。 root /Usage/Records と同じです。
Today 今日の利用分のみの、利用カテゴリーにつき 1 つの利用記録を返します。
Yesterday 昨日の利用分のみの、利用カテゴリーにつき 1 つの利用記録を返します。
ThisMonth 今月の利用分のみの、利用カテゴリーにつき 1 つの利用記録を返します。
LastMonth 先月の利用分のみの、利用カテゴリーにつき 1 つの利用記録を返します。

これらの便利なサブリソースを使って、日ごとの通話のグラフを作成したり、すべての利用カテゴリーの月間利用をダッシュ ボードに表示したり、先月の利用合計を元に利用料金の請求システムを構築できます。

すべてのサブリソースは、ルートの UsageCounter リソースと同じ リスト フィルター をサポートします。

例 1: すべての利用カテゴリーの先月分の利用
先月の記録の取得
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Usage.Record;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var records = LastMonthResource.Read();

        foreach (var record in records)
        {
            Console.WriteLine(record.Count);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of transcriptions and echo a property for each one
foreach ($client->usage->records->lastMonth->read() as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.last_month.list()
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over records and print out a property for each one
@client.usage.records.last_month.list.each do |record|
    puts record.count
end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    
    UsageRecordList records = client.getAccount().getUsageRecords(Type.LAST_MONTH);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.last_month.list()
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records
  .lastMonth
  .each((record) => console.log(record.count));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage(null, "LastMonth", null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->last_month as $record) {
    echo $record->count;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.last_month.list.each do |record|
  puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.LastMonth;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<LastMonth> records = LastMonth.reader().read();

    // Loop over records and print out a property for each one.
    for (LastMonth record : records) {
      System.out.println(record.getCount());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.lastMonth.list(function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
出力を表示
  • JSON
  • XML
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "shortcodes-customerowned", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Customer Owned ShortCodes", 
         "end_date": "2012-09-30", 
         "usage_unit": "shortcodes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=shortcodes-customerowned&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-01", 
         "count_unit": "shortcodes"
      }, 
      {
         "category": "sms-inbound-shortcode", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound ShortCode SMS", 
         "end_date": "2012-09-30", 
         "usage_unit": "messages", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-01", 
         "count_unit": "messages"
      }
      . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>shortcodes-customerowned</Category>
         <Description>Customer Owned ShortCodes</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>shortcodes</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>shortcodes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=shortcodes-customerowned&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      <UsageRecord>
         <Category>sms-inbound-shortcode</Category>
         <Description>Inbound ShortCode SMS</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>messages</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>messages</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=sms-inbound-shortcode&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>
先月の記録の取得
今日の記録の取得
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Usage.Record;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var records = TodayResource.Read(category: TodayResource.CategoryEnum.Calls);

        foreach (var record in records)
        {
            Console.WriteLine(record.Count);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage
    ->records
    ->today
    ->read(
        array("category" => "calls")
    );

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.today.list(category="calls")
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over records and print out a property for each one
@client.usage.records.today.list(
  :category => 'calls').each do |record|
    puts record.count
  end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordsTodayList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params, Type.TODAY);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.today.list(category="calls")
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records.today
  .each({category: 'calls'}, (record) => console.log(record.count));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls", "Today", null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->today->getIterator(0, 50, array(
        "Category" => "calls"
    )) as $record
) {
    echo $record->count;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.today.list({
  :category => "calls"}).each do |record|
  puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.Today;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Today> records = Today.reader().setCategory(Today.Category.CALLS).read();

    // Loop over records and print out a property for each one.
    for (Today record : records) {
      System.out.println(record.getCount());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.today.list({ category: "calls" }, function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
出力を表示
  • JSON
  • XML
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Total Calls", 
         "end_date": "2012-10-13", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls&StartDate=2012-10-13&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-10-13", 
         "count_unit": "calls"
      }
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls</Category>
         <Description>Total Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-10-13</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls&amp;StartDate=2012-10-13&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris />
      </UsageRecord>
   </UsageRecords>
</TwilioResponse>
今日の記録の取得
1 か月間の記録の取得
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Usage;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var records = RecordResource.Read(
            category: RecordResource.CategoryEnum.CallsInbound,
            startDate: new DateTime(2012, 09, 01),
            endDate: new DateTime(2012, 09, 30));

        foreach (var record in records)
        {
            Console.WriteLine(record.Price);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage->records->read(
    array(
        "category" => "calls-inbound",
        "startDate" => "2012-09-01",
        "endDate" => "2012-09-30"
    )
);

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->price;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list(category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'date'
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over records and print out a property for each one
@client.usage.records.list(
  :category   => 'calls-inbound',
  :start_date => Date.new(2012, 9, 1),
  :end_date   => Date.new(2012, 9, 30)).each do |record|
    puts record.price
  end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls-inbound");
    params.put("StartDate", "2012-09-01");
    params.put("EndDate", "2012-09-30");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getPrice());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list(
    category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

const filterOpts = {
  category: 'calls-inbound',
  startDate: '2012-09-01',
  endDate: '2012-09-30',
};

client.usage.records.each(filterOpts, (record) => console.log(record.price));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls-inbound", null, new DateTime(2012, 09, 01), new DateTime(2012, 09, 30), null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Price);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->getIterator(0, 50, array(
        "Category" => "calls-inbound",
    "StartDate" => "2012-09-01",
    "EndDate" => "2012-09-30"
    )) as $record
) {
    echo $record->price;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.list({
  :category => "calls-inbound",
  :start_date => "2012-09-01",
  :end_date => "2012-09-30"}).each do |record|
  puts record.price
end
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.LocalDate;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.Record;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Record> records = Record.reader()
        .setCategory(Record.Category.CALLS_INBOUND)
        .setStartDate(LocalDate.parse("2012-09-01"))
        .setEndDate(LocalDate.parse("2012-09-30"))
        .read();

    // Loop over records and print out a property for each one.
    for (Record record : records) {
      System.out.println(record.getPrice());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.list({ category: "calls-inbound",
    startDate: "2012-09-01",
    endDate: "2012-09-30"
  }, function(err, data) {
    data.usageRecords.forEach(function(record) {
      console.log(record.price);
    });
});
出力を表示
  • JSON
  • XML
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls-inbound", 
         "count": "1", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calls-inbound", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calls-inbound", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calls-inbound", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calls-inbound", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calls-inbound", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calls-inbound", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls-inbound"
         }, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-30", 
         "usage_unit": "minutes", 
         "price": "0.01", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "1", 
         "start_date": "2012-09-01", 
         "count_unit": "calls"
      }
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>1</Count>
         <CountUnit>calls</CountUnit>
         <Usage>1</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0.01</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calls-inbound</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls-inbound</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calls-inbound</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calls-inbound</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calls-inbound</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calls-inbound</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calls-inbound</Yearly>
         </SubresourceUris>
      </UsageRecord>
   </UsageRecords>
</TwilioResponse>
1 か月間の記録の取得
1 か月間の日ごとの記録
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Usage.Record;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var records = DailyResource.Read(
            category: DailyResource.CategoryEnum.CallsInbound,
            startDate: new DateTime(2012, 09, 01),
            endDate: new DateTime(2012, 09, 30));

        foreach (var record in records)
        {
            Console.WriteLine(record.Price);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage
    ->records
    ->today
    ->read(
        array(
            "category" => "calls-inbound",
            "startDate" => "2012-09-01",
            "endDate" => "2012-09-30"
        )
    );

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->price;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.daily.list(category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'date'
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over records and print out a property for each one
@client.usage.records.daily.list(
  :category   => 'calls-inbound',
  :start_date => Date.new(2012, 9, 1),
  :end_date   => Date.new(2012, 9, 30)).each do |record|
    puts record.price
  end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordsDailyList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls-inbound");
    params.put("StartDate", "2012-09-01");
    params.put("EndDate", "2012-09-30");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params, Type.DAILY);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getPrice());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.daily.list(
    category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

const filterOpts = {
  category: 'calls-inbound',
  startDate: '2012-09-01',
  endDate: '2012-09-30',
};

client.usage.records.daily
  .each(filterOpts, (record) => console.log(record.price));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls-inbound", "Daily", new DateTime(2012, 09, 01), new DateTime(2012, 09, 30), null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Price);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->daily->getIterator(0, 50, array(
        "Category" => "calls-inbound",
    "StartDate" => "2012-09-01",
    "EndDate" => "2012-09-30"
    )) as $record
) {
    echo $record->price;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.daily.list({
  :category => "calls-inbound",
  :start_date => "2012-09-01",
  :end_date => "2012-09-30"}).each do |record|
    puts record.price
  end
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.LocalDate;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.Daily;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Daily> records = Daily.reader()
        .setCategory(Daily.Category.CALLS_INBOUND)
        .setStartDate(LocalDate.parse("2012-09-01"))
        .setEndDate(LocalDate.parse("2012-09-30"))
        .read();

    // Loop over records and print out a property for each one.
    for (Daily record : records) {
      System.out.println(record.getPrice());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.daily.list({ category: "calls-inbound",
    startDate: "2012-09-01",
    endDate: "2012-09-30"
  }, function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.price);
    });
});
出力を表示
  • JSON
  • XML
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls-inbound", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-30", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-30&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-30", 
         "count_unit": "calls"
      }, 
      {
         "category": "calls-inbound", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-29", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-29&EndDate=2012-09-29", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-29", 
         "count_unit": "calls"
      }
      . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-30</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&amp;StartDate=2012-09-30&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-29</StartDate>
         <EndDate>2012-09-29</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&amp;StartDate=2012-09-29&amp;EndDate=2012-09-29</Uri>
         <SubresourceUris />
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>
1 か月間の日ごとの記録
すべての記録の取得
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Usage;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var records = RecordResource.Read();

        foreach (var record in records)
        {
            Console.WriteLine(record.Count);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->usage->records->read() as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list()
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over records and print out a property for each one
@client.usage.records.list.each do |record|
  puts record.count
end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    
    UsageRecordList records = client.getAccount().getUsageRecords();
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list()
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records.each((record) => console.log(record.count));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage(null, null, null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records as $record) {
    echo $record->count;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.list.each do |record|
  puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.Record;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Record> records = Record.reader().read();

    // Loop over records and print out a property for each one.
    for (Record record : records) {
      System.out.println(record.getCount());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.list(function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
出力を表示
  • JSON
  • XML
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calleridlookups", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calleridlookups", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calleridlookups", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calleridlookups", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calleridlookups", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calleridlookups", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calleridlookups", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calleridlookups", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calleridlookups"
         }, 
         "description": "Caller ID Lookups", 
         "end_date": "2012-10-13", 
         "usage_unit": "lookups", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calleridlookups&StartDate=2012-08-15&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-08-15", 
         "count_unit": "lookups"
      }, 
      {
         "category": "calls", 
         "count": "21", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calls", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calls", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calls", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calls", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calls", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calls", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls"
         }, 
         "description": "Total Calls", 
         "end_date": "2012-10-13", 
         "usage_unit": "minutes", 
         "price": "0.38", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls&StartDate=2012-08-15&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "21", 
         "start_date": "2012-08-15", 
         "count_unit": "calls"
      }
       . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calleridlookups</Category>
         <Description>Caller ID Lookups</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-08-15</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>0</Count>
         <CountUnit>lookups</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>lookups</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calleridlookups&amp;StartDate=2012-08-15&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calleridlookups</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calleridlookups</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calleridlookups</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calleridlookups</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calleridlookups</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calleridlookups</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calleridlookups</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calleridlookups</Yearly>
         </SubresourceUris>
      </UsageRecord>
      <UsageRecord>
         <Category>calls</Category>
         <Description>Total Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-08-15</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>21</Count>
         <CountUnit>calls</CountUnit>
         <Usage>21</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0.38</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls&amp;StartDate=2012-08-15&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calls</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calls</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calls</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calls</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calls</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calls</Yearly>
         </SubresourceUris>
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>
すべての記録の取得

HTTP POST

サポートしません。

HTTP PUT

サポートしません。

HTTP DELETE

サポートしません。

すべての利用カテゴリーの完全なリスト

音声通話
Category 説明
calls すべての音声通話です。インバウンドとアウトバウンドがあります。Count は通話件数、Usage は分数です。
calls-inbound 携帯電話番号、無料電話番号、およびローカル番号へのすべてのインバウンド音声通話です。
calls-inbound-local 国内番号への、すべての着信音声通話です。
calls-inbound-mobile 携帯電話番号へのすべてのインバウンド音声通話です。
calls-inbound-tollfree 無料電話番号への、すべての着信音声通話です。
calls-outbound すべての発信音声通話です。
calls-sip すべてのSIPコール
calls-sip-inbound すべてのインバウンド SIP 通話です。
calls-sip-outbound すべてのアウトバウンド SIP 通話です。
calls-client すべてのTiwlio クライアント音声通話です。
calls-globalconference すべてのグローバルカンファレンス通話
call-progess-events すべてのコールプログレスイベントです。
recordings 音声通話とトランク通話の録音です。Count は録音件数、Usage は録音分数です。
calls-recordings 音声通話の録音です。Count は録音件数、Usage は録音分数です。
recordingstorage このアカウントで保存された通話の録音が使用する保存容量です。Count は保存された録音の件数、Usage は保存された録音の分数、Price は録音の保存料金です。
transcriptions 音声通話のトランスクリプションです。Count はトランスクリプションの件数、Usage はテキスト化された音声の分数です。
SMS & MMS
Category 説明
sms 着信と発信の両方のすべての SMS メッセージです。Count と Usage は、どちらも送信されたメッセージの件数です。
sms-inbound ショート コードとロング コードの両方への、すべての 着信 SMS メッセージです。
sms-inbound-longcode ロング コード宛の、すべての着信 SMS メッセージです。
sms-inbound-shortcode ショート コード宛の、すべての着信 SMS メッセージです。
sms-outbound ショート コードとロング コードの両方からの、すべての発信 SMS メッセージです。
sms-outbound-longcode ロング コードからの、すべての発信 SMS メッセージです。
sms-outbound-shortcode ショート コードからの、すべての発信 SMS メッセージです。
MMS 着信と発信の、すべての MMS メッセージです。Count と Usage は、どちらも送信されたメッセージの件数です。
mms-inbound ショートコードとロングコードの両方への、すべての着信 MMS メッセージです。
mms-inbound-longcode ロングコード宛の、すべての着信 MMS メッセージです。
mms-inbound-shortcode ショートコード宛の、すべての着信 MMS メッセージです。
mms-outbound ショートコードとロングコードの両方からの、すべての発信 MMS メッセージです。
mms-outbound-longcode ロングコードからの、すべての発信 MMS メッセージです。
mms-outbound-shortcode ショートコードからの、すべての発信 MMS メッセージです。
mediastorage このアカウントで保存されたメディアが使用する保存容量です。Count は保存されたメディアファイルの件数、Usage はメガバイト数、Price はメディアの保存料金です。
電話番号
Category 説明
phonenumbers このアカウントが所有するすべての電話番号です。携帯電話番号、無料電話番号、および国内電話番号があります。
phonenumbers-local このアカウントが所有するすべての国内電話番号です。
phonenumbers-mobile このアカウントが所有するすべての携帯電話番号です。
phonenumbers-tollfree このアカウントが所有するすべての無料電話番号です。
phonenumbers-cps すべての電話番号秒間通話回数(CPS)増加分です。
phonenumbers-setups すべての電話番号設定料金です。
shortcodes このアカウントが所有する、すべての種別のショート コードです。
shortcodes-customerowned このアカウントが所有する、すべての他のプロバイダーから貸与されたショート コードです。
shortcodes-mms-enablement すべてのショートコード MMS 有効化料金です。
shortcodes-mps すべてのショートコード秒間メッセージ数(MPS)増加分です。
shortcodes-random このアカウントが所有する、すべてのランダムに割り当てられたショート コードです。
shortcodes-uk このアカウントが所有する、すべての英国ショートコードです。
shortcodes-vanity このアカウントが所有する、すべてのカスタム ショート コードです。
ルックアップ
Category 説明
ルックアップ すべてのルックアップです。キャリア、発信者 ID、および番号形式のルックアップが含まれます。
carrier-lookups すべてのキャリアルックアップです。
calleridlookups すべての callerID (CallerName)ルックアップです。
number-format-lookups すべての番号形式ルックアップです。
エラスティックSIPトランク
Category 説明
trunking-origination 携帯電話番号、無料電話番号、および国内電話番号へのすべてのトランキングオリジネーション(着信)通話です。
trunking-origination-local 国内電話番号へのすべてのトランキングオリジネーション(着信)通話です。
trunking-origination-mobile 携帯電話番号へのすべてのトランキングオリジネーション(着信)通話です。
trunking-origination-tollfree 無料電話番号へのすべてのトランキングオリジネーション(着信)通話です。
trunking-termination すべてのトランキングターミネーション(発信)通話です。
trunking-recordings トランク通話の録音です。Count は録音件数、Usage は録音分数です。
trunking-cps すべてのトランキング秒間通話回数(CPS)増加分です。
trunking-secure すべての保護されたトランク通話です。
タスクルーター
Category 説明
taskrouter-tasks タスクルーターで作成されたすべてのタスクです。
ネットワークトラバーサル
Category 説明
turnmegabytes ネットワークトラバーサルで使用されたすべての TURN メガバイト数です。
Authy
Category 説明
authy-authentications すべての Authy 認証です。
authy-calls-outbound すべての Authy 発信通話です。この利用状況は音声カテゴリーにも含まれます。
authy-monthly-fees すべての Authy 月額料金です。
authy-phone-intelligence すべての Authy 電話インテリジェンスリクエストです。
authy-phone-verifications すべての Authy 電話認証です。
authy-sms-outbound すべての Authy 発信 SMS メッセージです。この利用状況は SMS カテゴリーにも含まれるので、注意してください。
モニター
Category 説明
monitor-reads すべてのモニターイベント API 読み込みです。
monitor-writes すべてのモニターイベント書き込みです。
monitor-storage すべてのモニターイベント保存料金です。
その他
Category 説明
premiumsupport すべてのプレミアムサポート料金です。
合計金額 すべての利用の合計料金です。Usage は Price と同じになります。Count は空になります。 Twilio の利用料金にはどの利用カテゴリーにも当てはまらないものがあり、すべての UsageRecord の Price の合計が TotalPrice の Price と一致する場合としない場合がありますので、注意してください。

UsageRecord インスタンス リソース

UsageRecord リソースに直接リクエストを発行することはできません。 UsageRecords リスト リソース または サブリソースのいずれかに、リクエストを発行してください。

1 / 1
Loading Code Samples...
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Usage.Record;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var records = LastMonthResource.Read();

        foreach (var record in records)
        {
            Console.WriteLine(record.Count);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of transcriptions and echo a property for each one
foreach ($client->usage->records->lastMonth->read() as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.last_month.list()
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over records and print out a property for each one
@client.usage.records.last_month.list.each do |record|
    puts record.count
end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    
    UsageRecordList records = client.getAccount().getUsageRecords(Type.LAST_MONTH);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.last_month.list()
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records
  .lastMonth
  .each((record) => console.log(record.count));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage(null, "LastMonth", null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->last_month as $record) {
    echo $record->count;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.last_month.list.each do |record|
  puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.LastMonth;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<LastMonth> records = LastMonth.reader().read();

    // Loop over records and print out a property for each one.
    for (LastMonth record : records) {
      System.out.println(record.getCount());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.lastMonth.list(function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "shortcodes-customerowned", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Customer Owned ShortCodes", 
         "end_date": "2012-09-30", 
         "usage_unit": "shortcodes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=shortcodes-customerowned&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-01", 
         "count_unit": "shortcodes"
      }, 
      {
         "category": "sms-inbound-shortcode", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound ShortCode SMS", 
         "end_date": "2012-09-30", 
         "usage_unit": "messages", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-01", 
         "count_unit": "messages"
      }
      . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>shortcodes-customerowned</Category>
         <Description>Customer Owned ShortCodes</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>shortcodes</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>shortcodes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=shortcodes-customerowned&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      <UsageRecord>
         <Category>sms-inbound-shortcode</Category>
         <Description>Inbound ShortCode SMS</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>messages</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>messages</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=sms-inbound-shortcode&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Usage.Record;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var records = TodayResource.Read(category: TodayResource.CategoryEnum.Calls);

        foreach (var record in records)
        {
            Console.WriteLine(record.Count);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage
    ->records
    ->today
    ->read(
        array("category" => "calls")
    );

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.today.list(category="calls")
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over records and print out a property for each one
@client.usage.records.today.list(
  :category => 'calls').each do |record|
    puts record.count
  end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordsTodayList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params, Type.TODAY);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.today.list(category="calls")
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records.today
  .each({category: 'calls'}, (record) => console.log(record.count));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls", "Today", null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->today->getIterator(0, 50, array(
        "Category" => "calls"
    )) as $record
) {
    echo $record->count;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.today.list({
  :category => "calls"}).each do |record|
  puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.Today;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Today> records = Today.reader().setCategory(Today.Category.CALLS).read();

    // Loop over records and print out a property for each one.
    for (Today record : records) {
      System.out.println(record.getCount());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.today.list({ category: "calls" }, function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Total Calls", 
         "end_date": "2012-10-13", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls&StartDate=2012-10-13&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-10-13", 
         "count_unit": "calls"
      }
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls</Category>
         <Description>Total Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-10-13</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls&amp;StartDate=2012-10-13&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris />
      </UsageRecord>
   </UsageRecords>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Usage;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var records = RecordResource.Read(
            category: RecordResource.CategoryEnum.CallsInbound,
            startDate: new DateTime(2012, 09, 01),
            endDate: new DateTime(2012, 09, 30));

        foreach (var record in records)
        {
            Console.WriteLine(record.Price);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage->records->read(
    array(
        "category" => "calls-inbound",
        "startDate" => "2012-09-01",
        "endDate" => "2012-09-30"
    )
);

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->price;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list(category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'date'
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over records and print out a property for each one
@client.usage.records.list(
  :category   => 'calls-inbound',
  :start_date => Date.new(2012, 9, 1),
  :end_date   => Date.new(2012, 9, 30)).each do |record|
    puts record.price
  end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls-inbound");
    params.put("StartDate", "2012-09-01");
    params.put("EndDate", "2012-09-30");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getPrice());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list(
    category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

const filterOpts = {
  category: 'calls-inbound',
  startDate: '2012-09-01',
  endDate: '2012-09-30',
};

client.usage.records.each(filterOpts, (record) => console.log(record.price));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls-inbound", null, new DateTime(2012, 09, 01), new DateTime(2012, 09, 30), null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Price);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->getIterator(0, 50, array(
        "Category" => "calls-inbound",
    "StartDate" => "2012-09-01",
    "EndDate" => "2012-09-30"
    )) as $record
) {
    echo $record->price;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.list({
  :category => "calls-inbound",
  :start_date => "2012-09-01",
  :end_date => "2012-09-30"}).each do |record|
  puts record.price
end
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.LocalDate;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.Record;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Record> records = Record.reader()
        .setCategory(Record.Category.CALLS_INBOUND)
        .setStartDate(LocalDate.parse("2012-09-01"))
        .setEndDate(LocalDate.parse("2012-09-30"))
        .read();

    // Loop over records and print out a property for each one.
    for (Record record : records) {
      System.out.println(record.getPrice());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.list({ category: "calls-inbound",
    startDate: "2012-09-01",
    endDate: "2012-09-30"
  }, function(err, data) {
    data.usageRecords.forEach(function(record) {
      console.log(record.price);
    });
});
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls-inbound", 
         "count": "1", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calls-inbound", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calls-inbound", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calls-inbound", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calls-inbound", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calls-inbound", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calls-inbound", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls-inbound"
         }, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-30", 
         "usage_unit": "minutes", 
         "price": "0.01", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "1", 
         "start_date": "2012-09-01", 
         "count_unit": "calls"
      }
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-01</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>1</Count>
         <CountUnit>calls</CountUnit>
         <Usage>1</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0.01</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls-inbound&amp;StartDate=2012-09-01&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calls-inbound</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls-inbound</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calls-inbound</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calls-inbound</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calls-inbound</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calls-inbound</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calls-inbound</Yearly>
         </SubresourceUris>
      </UsageRecord>
   </UsageRecords>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Usage.Record;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var records = DailyResource.Read(
            category: DailyResource.CategoryEnum.CallsInbound,
            startDate: new DateTime(2012, 09, 01),
            endDate: new DateTime(2012, 09, 30));

        foreach (var record in records)
        {
            Console.WriteLine(record.Price);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$records = $client->usage
    ->records
    ->today
    ->read(
        array(
            "category" => "calls-inbound",
            "startDate" => "2012-09-01",
            "endDate" => "2012-09-30"
        )
    );

// Loop over the list of records and echo a property for each one
foreach ($records as $record) {
    echo $record->price;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.daily.list(category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'date'
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over records and print out a property for each one
@client.usage.records.daily.list(
  :category   => 'calls-inbound',
  :start_date => Date.new(2012, 9, 1),
  :end_date   => Date.new(2012, 9, 30)).each do |record|
    puts record.price
  end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily \
    -d "Category=calls-inbound" \
    -d "StartDate=2012-09-01" \
    -d "EndDate=2012-09-30" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;
import com.twilio.sdk.resource.list.UsageRecordList.Type;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the UsageRecordsDailyList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("Category", "calls-inbound");
    params.put("StartDate", "2012-09-01");
    params.put("EndDate", "2012-09-30");
    
    UsageRecordList records = client.getAccount().getUsageRecords(params, Type.DAILY);
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getPrice());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.daily.list(
    category="calls-inbound",
    start_date="2012-09-01",
    end_date="2012-09-30")
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

const filterOpts = {
  category: 'calls-inbound',
  startDate: '2012-09-01',
  endDate: '2012-09-30',
};

client.usage.records.daily
  .each(filterOpts, (record) => console.log(record.price));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage("calls-inbound", "Daily", new DateTime(2012, 09, 01), new DateTime(2012, 09, 30), null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Price);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->daily->getIterator(0, 50, array(
        "Category" => "calls-inbound",
    "StartDate" => "2012-09-01",
    "EndDate" => "2012-09-30"
    )) as $record
) {
    echo $record->price;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.daily.list({
  :category => "calls-inbound",
  :start_date => "2012-09-01",
  :end_date => "2012-09-30"}).each do |record|
    puts record.price
  end
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.LocalDate;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.record.Daily;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Daily> records = Daily.reader()
        .setCategory(Daily.Category.CALLS_INBOUND)
        .setStartDate(LocalDate.parse("2012-09-01"))
        .setEndDate(LocalDate.parse("2012-09-30"))
        .read();

    // Loop over records and print out a property for each one.
    for (Daily record : records) {
      System.out.println(record.getPrice());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.daily.list({ category: "calls-inbound",
    startDate: "2012-09-01",
    endDate: "2012-09-30"
  }, function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.price);
    });
});
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calls-inbound", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-30", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-30&EndDate=2012-09-30", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-30", 
         "count_unit": "calls"
      }, 
      {
         "category": "calls-inbound", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": null, 
         "description": "Inbound Calls", 
         "end_date": "2012-09-29", 
         "usage_unit": "minutes", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls-inbound&StartDate=2012-09-29&EndDate=2012-09-29", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-09-29", 
         "count_unit": "calls"
      }
      . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&StartDate=2012-09-01&EndDate=2012-09-30&Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-30</StartDate>
         <EndDate>2012-09-30</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&amp;StartDate=2012-09-30&amp;EndDate=2012-09-30</Uri>
         <SubresourceUris />
      </UsageRecord>
      <UsageRecord>
         <Category>calls-inbound</Category>
         <Description>Inbound Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-09-29</StartDate>
         <EndDate>2012-09-29</EndDate>
         <Count>0</Count>
         <CountUnit>calls</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls-inbound&amp;StartDate=2012-09-29&amp;EndDate=2012-09-29</Uri>
         <SubresourceUris />
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Usage;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var records = RecordResource.Read();

        foreach (var record in records)
        {
            Console.WriteLine(record.Count);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->usage->records->read() as $record) {
    echo $record->count;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list()
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over records and print out a property for each one
@client.usage.records.list.each do |record|
  puts record.count
end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.UsageRecord;
import com.twilio.sdk.resource.list.UsageRecordList;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    
    UsageRecordList records = client.getAccount().getUsageRecords();
    
    // Loop over records and print out a property for each one.
    for (UsageRecord record : records) {
      System.out.println(record.getCount());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

# A list of record objects with the properties described above
records = client.usage.records.list()
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records.each((record) => console.log(record.count));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var records = twilio.ListUsage(null, null, null, null, null, null);
    
    foreach (var record in records.UsageRecords)
    {
      Console.WriteLine(record.Count);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records as $record) {
    echo $record->count;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over records and print out a property for each one
@client.account.usage.records.list.each do |record|
  puts record.count
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.usage.Record;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Record> records = Record.reader().read();

    // Loop over records and print out a property for each one.
    for (Record record : records) {
      System.out.println(record.getCount());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.usage.records.list(function(err, data) {
    data.usageRecords.forEach(function(record) {
        console.log(record.count);
    });
});
{
   "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Page=0&PageSize=50",
   "previous_page_uri": null, 
   "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json", 
   "page_size": 50,
   "usage_records": [
      {
         "category": "calleridlookups", 
         "count": "0", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calleridlookups", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calleridlookups", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calleridlookups", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calleridlookups", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calleridlookups", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calleridlookups", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calleridlookups", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calleridlookups"
         }, 
         "description": "Caller ID Lookups", 
         "end_date": "2012-10-13", 
         "usage_unit": "lookups", 
         "price": "0", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calleridlookups&StartDate=2012-08-15&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "0", 
         "start_date": "2012-08-15", 
         "count_unit": "lookups"
      }, 
      {
         "category": "calls", 
         "count": "21", 
         "price_unit": "usd", 
         "subresource_uris": {
            "yearly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly.json?Category=calls", 
            "last_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json?Category=calls", 
            "monthly": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly.json?Category=calls", 
            "yesterday": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday.json?Category=calls", 
            "daily": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily.json?Category=calls", 
            "all_time": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime.json?Category=calls", 
            "this_month": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth.json?Category=calls", 
            "today": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls"
         }, 
         "description": "Total Calls", 
         "end_date": "2012-10-13", 
         "usage_unit": "minutes", 
         "price": "0.38", 
         "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls&StartDate=2012-08-15&EndDate=2012-10-13", 
         "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
         "usage": "21", 
         "start_date": "2012-08-15", 
         "count_unit": "calls"
      }
       . . .
   ], 
   "next_page_uri": null,
   "page": 0
}
<TwilioResponse>
   <UsageRecords pagesize="50" nextpageuri="" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Page=0&PageSize=50" previouspageuri="" page="0">
      <UsageRecord>
         <Category>calleridlookups</Category>
         <Description>Caller ID Lookups</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-08-15</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>0</Count>
         <CountUnit>lookups</CountUnit>
         <Usage>0</Usage>
         <UsageUnit>lookups</UsageUnit>
         <Price>0</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calleridlookups&amp;StartDate=2012-08-15&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calleridlookups</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calleridlookups</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calleridlookups</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calleridlookups</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calleridlookups</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calleridlookups</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calleridlookups</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calleridlookups</Yearly>
         </SubresourceUris>
      </UsageRecord>
      <UsageRecord>
         <Category>calls</Category>
         <Description>Total Calls</Description>
         <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
         <StartDate>2012-08-15</StartDate>
         <EndDate>2012-10-13</EndDate>
         <Count>21</Count>
         <CountUnit>calls</CountUnit>
         <Usage>21</Usage>
         <UsageUnit>minutes</UsageUnit>
         <Price>0.38</Price>
         <PriceUnit>usd</PriceUnit>
         <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=calls&amp;StartDate=2012-08-15&amp;EndDate=2012-10-13</Uri>
         <SubresourceUris>
            <AllTime>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/AllTime?Category=calls</AllTime>
            <Today>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today?Category=calls</Today>
            <Yesterday>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yesterday?Category=calls</Yesterday>
            <ThisMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/ThisMonth?Category=calls</ThisMonth>
            <LastMonth>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth?Category=calls</LastMonth>
            <Daily>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Daily?Category=calls</Daily>
            <Monthly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Monthly?Category=calls</Monthly>
            <Yearly>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Yearly?Category=calls</Yearly>
         </SubresourceUris>
      </UsageRecord>
      . . .
   </UsageRecords>
</TwilioResponse>