REST API: 使用状況記録 (Usage Records)

UsageRecords RESTリソースは、 任意の期間中、および任意の利用カテゴリーにおけるお手持ちのTwilioアカウントの使用状況を取得するシンプルなAPIを提供します。 これにより、アプリケーション用のレポートや分析ツールの作成が簡単になります。

UsageRecords をエンドユーザーごとに作成したサブアカウントと組み合わせて使用すると、いくつかの簡単なAPI呼び出しのみでTwilioのAPIをベースに定期的な利用をベースとする支払いシステムの構築が可能になります。 UsageRecordsを支払い情報で訂正する場合は、特にこの話題について扱ったこちらの記事を参照してください。

また使用状況トリガーをセットアップして、日ごと、月ごと、年ごと、あるいは全期間における特定のカテゴリーの使用状況がしきい値に達した場合にアプリケーションに通知することができます。 トリガーは、エンドユーザーがその使用上限に達した場合や、アプリケーションのリクエストが制御不能に陥った場合を判断するのに役立てることができます。 

UsageRecords リスト リソース

リソースURI

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

リソースのプロパティ

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

名前 概要
account_sid

The Account that accrued the usage. (🏢 not PII)

category

The category of usage. See Usage Categories below. (🏢 not PII)

count

The number of usage events (e.g. the number of calls). (🏢 not PII)

count_unit

The units in which Count is measured. For example calls for calls, messages for SMS. (🏢 not PII)

description

A human-readable description of the usage category. (🏢 not PII)

end_date

The last date for which usage is included in this UsageRecord, formatted as YYYY-MM-DD. All dates are in GMT. (🏢 not PII)

price

The total price of the usage, in the currency associated with the account. (🏢 not PII)

price_unit

The currency in which Price is measured, in ISO 4127 format (e.g. usd, eur, jpy). (🏢 not PII)

start_date

The first date for which usage is included in this UsageRecord, formatted as YYYY-MM-DD. All dates are in GMT. (🏢 not PII)

subresource_uris

Subresource Uris for this UsageRecord. See List Subresources. (🏢 not PII)

uri

The URI that returns only this UsageRecord, relative to https://api.twilio.com. (🏢 not PII)

usage

The amount of billed usage (e.g. the number of call minutes billed for). This is frequently the same as Count, but may be different for certain usage categories like calls, where Count represents the number of calls and Usage represents the number of rounded, billed minutes. (🏢 not PII)

usage_unit

The units in which Usage is measured. For example minutes for calls, messages for SMS. (🏢 not PII)

Usage、Count、Price プロパティ

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

それぞれの利用記録には、利用量の記録に用いる単位を示すフィールドがあります。たとえば、Usage の単位は UsageUnit です。 これらのフィールドを使って、利用一覧を表示するダッシュ ボードを簡単に作成することができます。 たとえばこれらのパラメーターを次のように変数に代入して組み合わせると、人間が読みやすい形式の文字列で利用状況を表すことができます。 「$Usage $UsageUnits (1分、3時間、など) 」、「$Count $CountUnits (25個、など) 」、「$Price $PriceUnits (500JPY、2USD、など) 」

利用カテゴリー

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

Category 概要
calls すべての音声通話です。Count は通話の件数、Usage は分数です。
sms すべての SMS メッセージです。CountUsage は、いずれも送信したメッセージの件数です。
pfax-minutes Programmable Fax minutes. Count is the number of faxes and Usage is the number of minutes.
pfax-pages Programmable Fax pages. Count is the number of faxes and Usage is the number of pages.
phonenumbers このアカウントが所有するすべての電話番号です。
recordings 音声通話の録音です。Count は録音件数、Usage は録音分数です。
transcriptions 音声通話のトランスクリプションです。Count はトランスクリプションの件数、Usage はテキスト化された音声の分数です。
totalprice すべての利用の合計金額です。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: すべての利用カテゴリーの先月分の利用
コードサンプルを読み込んでいます...
Language
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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records.lastMonth.list((err, data) => {
  data.usageRecords.forEach(record => {
    console.log(record.count);
  });
});
// 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 '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
// 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 '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
// 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()
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
   "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>
先月の記録の取得
コードサンプルを読み込んでいます...
Language
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 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);
    });
});
// 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 '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
// 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 '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
// 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")
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
   "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>
今日の記録の取得
コードサンプルを読み込んでいます...
Language
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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records.list(
  {
    category: 'calls-inbound',
    startDate: '2012-09-01',
    endDate: '2012-09-30',
  },
  (err, data) => {
    data.usageRecords.forEach(record => {
      console.log(record.price);
    });
  }
);
// 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 '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
// 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 '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
// 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")
// 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());
    }
  }
}
$ 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'
$ 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'
{
   "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 か月間の記録の取得
コードサンプルを読み込んでいます...
Language
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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records.daily.list(
  {
    category: 'calls-inbound',
    startDate: '2012-09-01',
    endDate: '2012-09-30',
  },
  (err, data) => {
    data.usageRecords.forEach(record => {
      console.log(record.price);
    });
  }
);
// 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 '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
// 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
    ->daily
    ->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 '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
// 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"
)
// 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());
    }
  }
}
$ 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'
$ 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'
{
   "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 か月間の日ごとの記録
コードサンプルを読み込んでいます...
Language
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 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);
    });
});
// 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 '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
// 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 '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
// 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()
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
   "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

サポートされていません。

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

Voice
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 概要
lookups すべてのルックアップです。キャリア、発信者 ID、および番号形式のルックアップが含まれます。
carrier-lookups すべてのキャリアルックアップです。
calleridlookups すべての callerID (CallerName)ルックアップです。
number-format-lookups すべての番号形式ルックアップです。
Elastic SIP Trunking
Category 概要
trunking-origination 携帯電話番号、無料電話番号、および国内電話番号へのすべてのトランキングオリジネーション(着信)通話です。
trunking-origination-local 国内電話番号へのすべてのトランキングオリジネーション(着信)通話です。
trunking-origination-mobile 携帯電話番号へのすべてのトランキングオリジネーション(着信)通話です。
trunking-origination-tollfree 無料電話番号へのすべてのトランキングオリジネーション(着信)通話です。
trunking-termination すべてのトランキングターミネーション(発信)通話です。
trunking-recordings トランク通話の録音です。Count は録音件数、Usage は録音分数です。
trunking-cps すべてのトランキング秒間通話回数(CPS)増加分です。
trunking-secure すべての保護されたトランク通話です。
TaskRouter
Category 概要
taskrouter-tasks TaskRouterで作成されたすべてのタスクです。
ネットワークトラバーサル
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 カテゴリーにも含まれるので、注意してください。
Studio
Category 概要
studio-engagements すべてのStudio Engagementです
モニター
Category 概要
monitor-reads すべてのモニターイベント API 読み込みです。
monitor-writes すべてのモニターイベント書き込みです。
monitor-storage すべてのモニターイベント保存料金です。
その他
Category 概要
premiumsupport すべてのプレミアムサポート料金です。
totalprice すべての利用の合計料金です。Usage は Price と同じになります。Count は空になります。 Twilio の利用料金にはどの利用カテゴリーにも当てはまらないものがあり、すべての UsageRecord の Price の合計が TotalPrice の Price と一致する場合としない場合がありますので、注意してください。

UsageRecord インスタンス リソース

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

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。

コードサンプルを読み込んでいます...
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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records.lastMonth.list((err, data) => {
  data.usageRecords.forEach(record => {
    console.log(record.count);
  });
});
// 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 '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
// 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 '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
// 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()
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/LastMonth.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
   "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 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);
    });
});
// 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 '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
// 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 '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
// 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")
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json \
    -d "Category=calls" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
   "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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records.list(
  {
    category: 'calls-inbound',
    startDate: '2012-09-01',
    endDate: '2012-09-30',
  },
  (err, data) => {
    data.usageRecords.forEach(record => {
      console.log(record.price);
    });
  }
);
// 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 '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
// 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 '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
// 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")
// 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());
    }
  }
}
$ 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'
$ 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'
{
   "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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.usage.records.daily.list(
  {
    category: 'calls-inbound',
    startDate: '2012-09-01',
    endDate: '2012-09-30',
  },
  (err, data) => {
    data.usageRecords.forEach(record => {
      console.log(record.price);
    });
  }
);
// 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 '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
// 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
    ->daily
    ->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 '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
// 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"
)
// 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());
    }
  }
}
$ 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'
$ 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'
{
   "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 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);
    });
});
// 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 '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
// 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 '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
// 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()
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
   "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>