モニター REST API: Events

イベントは Twilioのリソースの イベントを記録、変更トラッキング を提供するプラットフォームです。

例えば、電話番号の設定、アカウントのセキュリティを変更、録音ファイルを削除した時などですイベントは事実上Twilioでのアクションを全て記録します。API、Twilioコンソール、Twilioの従業員が変更 のいずれの場合も対象です。

イベント RESTリソースはイベントログの API経由での取得を提供します。それぞれの イベントは ログエントリーに類似します。

  • イベントタイプ;
  • イベントが関連するリソース;
  • イベントを発生させた当事者;
  • イベントの発生元ソース、IPアドレス; や
  • すべての関連するイベントデータ(どのようなプロパティが変更されたかなど)

イベント は Twilioプロダクト全体で動作します。これらは Twilioアプリケーションで何が起きているかを全て可視化するために助けになるツールです。APIはログの取得、ログ収集ツールやSIEM(セキュリティ情報およびイベント管理)へのデータのプッシュに利用できます。

Event インスタンスリソース

リソースURI

イベントは monitor.twilio.com のサブドメイン を利用します。また、それらのSIDにより参照されます。

https://monitor.twilio.com/v1/Events/{EventSid}

リソースのプロパティ

イベントは 下記のプロパティーで表されます。

プロパティ 概要
sid この イベント を識別する 34 文字の文字列です。
event_type イベントタイプは文字で表されます。イベントタイプは典型的にRESOURCE_TYPE.ACTIONのフォームで、RESOURCE_TYPEが影響を与えたリソースを示し、ACTIONは何が起きたかを示します。例えば、phone-number.created。すべての イベントタイプのリストはこちらをご覧ください。
account_sid イベントが記録されたアカウントを識別する 34 文字の文字列です。
event_date イベント が生成された日時、UTC ISO 8601 フォーマットで提供
description アドレスの より読みやすい形式の説明です。おそらく Null です。
resource_type 影響を受けたリソースタイプすべての リソースタイプ のリストはこちらをご覧ください。
resource_sid 影響を受けたリソース を一意に識別する 34 文字の文字列です。
resource_url もし有効であれば、REST APIの影響を受けたリソースのURLおそらく Null です。
actor_type イベントの当事者のタイプ例えば、userはTwilioコンソールでログインユーザーを変更した場合、accountは認証されたアカウントからAPIを経由して発生したイベント、twilio-adminはTwilioの従業員などです。
actor_sid 有効であれば、イベントを発生させた当事者 を一意に識別する 34 文字の文字列です。おそらく Null です。
actor_url 設定されている場合、このイベントの発生元の REST API における URL です。おそらく Null です。
ソース このイベントの発生元のシステムまたはインターフェイスです。web は、Twilio コンソールでのユーザーの操作により発生したイベントを示します。api は、REST API にリクエストを送信したことにより発生したイベントを示します。twilio は、Twilio の自動システムまたは内部システムにより発生したイベントを示します。
source_ip_address ソースが Twilio クラウド以外の場合、ソースの IP アドレスです。たとえば、発信 API リクエストの IP アドレスです。{"source": "twilio"} のイベントの場合、Null です。
event_data イベントに関する他のデータがエンコードされている自由形式の JSON オブジェクトです。正確な内容は、event_type に応じて異なります。 たとえば、フォーム RESOURCE.updated のイベントデータの場合、event_data には、リソースのプロパティの更新前後の値がエンコードされた resource_properties ディクショナリが格納されます。

イベント通知ページやイベントリストページを作成する際、これらのフィールドが役に立ちます。たとえば、"On {event_date}, a {event_type} event was generated for resource {resource_type} via {source} by {actor_type} {actor_sid} from {source_ip_address}" のように、人間が読みやすい形式の文字列を表示できます。

ソース、当事者タイプ、および当事者 Sid

ソース、当事者タイプ、および当事者 Sid は、密接に関係しています。これらはすべて、誰または何が、どこで、イベントを発生させたかを示すのに役立ちます。次の表は、あなたが目にするであろう、最も一般的な組み合わせを示します。

ソース actor_type actor_sid description
api アカウント AC123 アカウント AC123 は、API により認証され、イベントを発生させました。
Web user US456 Sid が US456 であるユーザーが Twilio コンソールにログインして、イベントを発生させました。このユーザーの Sid は、Twilio コンソールの「Manager Users」ページで確認できます。
twilio twilio-admin null Twilio 管理者が Twilio の管理インターフェイスで変更を行いました。

HTTP GET

上述のプロパティを含む、イベントの表現を返します。

Twilio コンソールで電話番号の VoiceUrl を変更したことを記録するイベント:

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
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
// 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 MonitorClient = require('twilio').MonitorClient;
const client = new MonitorClient(accountSid, authToken);

client.events('AE21f24380625e4aa4abec76e39b14458d').get((error, event) => {
  process.stdout.write(event.eventType);
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.monitor.events('AE21f24380625e4aa4abec76e39b14458d')
              .fetch()
              .then(event => console.log(event.actorSid))
              .done();
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Monitor;
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 monitor = new MonitorClient(AccountSid, AuthToken);

    var e = monitor.GetEvent("AE21f24380625e4aa4abec76e39b14458d");
    Console.WriteLine(e.Description);
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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 Monitor_Services_Twilio($sid, $token);

$event = $client->events->get("AE21f24380625e4aa4abec76e39b14458d");
echo $event->description;
# 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::MonitorClient.new account_sid, auth_token

event = @client.events.get('AE21f24380625e4aa4abec76e39b14458d')

puts event.description
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Monitor.V1;


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

        TwilioClient.Init(accountSid, authToken);

        var _event = EventResource.Fetch(pathSid: "AE21f24380625e4aa4abec76e39b14458d");

        Console.WriteLine(_event.ActorSid);
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$event = $twilio->monitor->v1->events("AE21f24380625e4aa4abec76e39b14458d")
                             ->fetch();

print($event->actorSid);
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.monitor import TwilioMonitorClient

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

event = client.events.get("AE21f24380625e4aa4abec76e39b14458d")
print(event.description)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# 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)

event = @client.monitor.events('AE21f24380625e4aa4abec76e39b14458d').fetch

puts event.actor_sid
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioMonitorClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.monitor.Event;

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 {
    TwilioMonitorClient client = new TwilioMonitorClient(ACCOUNT_SID, AUTH_TOKEN);

    Event e = client.getEvent("AE21f24380625e4aa4abec76e39b14458d");

    System.out.println(e.getDescription());
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

event = client.monitor.events('AE21f24380625e4aa4abec76e39b14458d').fetch()

print(event.actor_sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.monitor.v1.Event;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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);
        Event event = Event.fetcher("AE21f24380625e4aa4abec76e39b14458d")
            .fetch();

        System.out.println(event.getActorSid());
    }
}
curl -X GET 'https://monitor.twilio.com/v1/Events/AE21f24380625e4aa4abec76e39b14458d' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "actor_sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "actor_type": "account",
  "description": null,
  "event_data": {
    "friendly_name": {
      "previous": "SubAccount Created at 2014-10-03 09:48 am",
      "updated": "Mr. Friendly"
    }
  },
  "event_date": "2014-10-03T16:48:25Z",
  "event_type": "account.updated",
  "links": {
    "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  },
  "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "resource_type": "account",
  "sid": "AE21f24380625e4aa4abec76e39b14458d",
  "source": "api",
  "source_ip_address": "10.86.6.250",
  "url": "https://monitor.twilio.com/v1/Events/AE21f24380625e4aa4abec76e39b14458d"
}
VoiceUrl 変更を記録する

HTTP POST

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

HTTP PUT

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

HTTP DELETE

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

Events リストリソース

リソースURI

すべてのイベントを表すリストリソースは、サブドメイン monitor.twilio.com にあります。

https://monitor.twilio.com/v1/Events

HTTP GET

このアカウントのイベントのリストを返します。イベント日で並び替えられます。このリストはページ情報を含みます。

リストフィルター

デフォルトでは、すべてのイベントが返されます。StartDate パラメーターと EndDate パラメーターを使用して、いつでもイベント日でイベントをフィルタリングできます。

クエリーパラメーター 概要
StartDate この日付以降のイベントのみを返します。EndDate と組み合わせて、イベントの日付範囲を定義するのに役立ちます。入力はUTC ISO 8601タイムスタンプですが、時間の部分はフィルターで無視されます。
EndDate この日付以降のイベントのみを返します。StartDate と組み合わせて、イベントの日付範囲を定義するのに役立ちます。入力はUTC ISO 8601タイムスタンプですが、時間の部分はフィルターで無視されます。

上記以外に、次のフィールドのいずれか 1 つを使用してフィルタリングできます。1 回のリクエストで複数のフィールドでフィルタリングすることはサポートされていません。その場合は 400 Bad Request エラーが返されます。

クエリーパラメーター 概要
EventType この EventType のイベントのみを返します。
ResourceSid このリソースを参照するイベントのみを返します。特定のリソースの履歴を見つける場合に役立ちます。
SourceIpAddress この IP アドレスから発生したイベントのみを返します。API または Twilio コンソールから発生した疑わしいアクティビティを追跡する場合に役立ちます。
ActorSid この当事者が発生させたイベントのみを返します。特定のユーザーまたは API クレデンシャルが実行したアクションを監査する場合に役立ちます。
サンプル

2015 年 3 月に発生したすべてのイベントをフィルタリングする例:

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
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
// 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 MonitorClient = require('twilio').MonitorClient;
const client = new MonitorClient(accountSid, authToken);

const params = {
  startDate: '2015-03-01T00:00:00Z',
  endDate: '2015-04-01T00:00:00Z',
};
client.events.list(params, (error, events) => {
  for (const e in events) {
    process.stdout.write(e);
  }
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.monitor.events.each({
                        endDate: new Date(Date.UTC(2015, 3, 1, 0, 0, 0)),
                        startDate: new Date(Date.UTC(2015, 2, 1, 0, 0, 0))
                      },
                          events => console.log(events.sid)
                      );
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Monitor;
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 monitor = new MonitorClient(AccountSid, AuthToken);

    var options = new EventListRequest();
    options.StartDate = new DateTime(2015, 3, 1);
    options.EndDate = new DateTime(2015, 4, 1);
    var events = monitor.ListEvents(options);
    foreach (var e in events.Events)
    {
      Console.WriteLine(e.Description);
    }
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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 Monitor_Services_Twilio($sid, $token);

$params = array(
    'StartDate' => '2015-03-01T00:00:00Z',
    'EndDate' => '2015-04-01T00:00:00Z'
);
$events = $client->events->getIterator(0, 50, $params);
foreach ($events as $e) {
    echo $e->description;
}
# 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::MonitorClient.new account_sid, auth_token

@params = {
  start_date: '2015-03-01T00:00:00Z',
  end_date: '2015-04-01T00:00:00Z'
}
@client.events.list(@params).each do |e|
  puts e.description
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Monitor.V1;


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

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(
            endDate: new DateTime(2015, 4, 1, 0, 0, 0),
            startDate: new DateTime(2015, 3, 1, 0, 0, 0)
        );

        foreach(var record in events)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$events = $twilio->monitor->v1->events
                              ->read(array(
                                         "endDate" => new \DateTime('2015-4-1'),
                                         "startDate" => new \DateTime('2015-3-1')
                                     )
                              );

foreach ($events as $record) {
    print($record->sid);
}
# Download the Python helper library from twilio.com/docs/python/install
from datetime import datetime

import pytz
from twilio.rest.monitor import TwilioMonitorClient

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

events = client.events.list(
    start_date=datetime(2015, 3, 1, tzinfo=pytz.UTC).isoformat(),
    end_date=datetime(2015, 4, 1, tzinfo=pytz.UTC).isoformat(),
)

for e in events:
    print(e.description)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# 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)

events = @client.monitor.events.list(
                                  end_date: Date.new(2015, 4, 1),
                                  start_date: Date.new(2015, 3, 1)
                                )

events.each do |record|
  puts record.sid
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioMonitorClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.monitor.Event;
import com.twilio.sdk.resource.list.monitor.EventList;
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 {
    TwilioMonitorClient client = new TwilioMonitorClient(ACCOUNT_SID, AUTH_TOKEN);

    Map<String, String> params = new HashMap<String, String>();
    params.put("StartDate", "2015-03-01T00:00:00Z");
    params.put("EndDate", "2015-04-01T00:00:00Z");
    EventList events = client.getEvents(params);

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from datetime import datetime
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

events = client.monitor.events.list(
                                   end_date=datetime(2015, 4, 1, 0, 0),
                                   start_date=datetime(2015, 3, 1, 0, 0)
                               )

for record in events:
    print(record.sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.Event;
import org.joda.time.DateTime;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<Event> events = Event.reader()
            .setEndDate(new DateTime(2015, 4, 1, 0, 0))
            .setStartDate(new DateTime(2015, 3, 1, 0, 0))
            .read();

        for(Event record : events) {
            System.out.println(record.getSid());
        }
    }
}
curl -X GET 'https://monitor.twilio.com/v1/Events?EndDate=2015-04-01&StartDate=2015-03-01' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "events": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_data": {
        "friendly_name": {
          "previous": "SubAccount Created at 2014-10-03 09:48 am",
          "updated": "Mr. Friendly"
        }
      },
      "event_date": "2014-10-03T16:48:25Z",
      "event_type": "account.updated",
      "links": {
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "account",
      "sid": "AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "source": "api",
      "source_ip_address": "10.86.6.250",
      "url": "https://monitor.twilio.com/v1/Events/AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "end_date": "2015-04-01",
      "start_date": "2015-03-01"
    }
  ],
  "meta": {
    "first_page_url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0",
    "key": "events",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0"
  },
  "end_date": "2015-04-01",
  "start_date": "2015-03-01"
}
日付によるフィルタリング

Events リストリソースと ResourceSid フィルターを使用して、特定の電話番号で発生したことをすべて検出する例:

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
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
// 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 MonitorClient = require('twilio').MonitorClient;
const client = new MonitorClient(accountSid, authToken);

const params = {
  resourceSid: 'PN4aa51b930717ea83c91971b86d99018f',
};
client.events.list(params, (error, events) => {
  for (const e in events) {
    process.stdout.write(e);
  }
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.monitor.events.each({
                        resourceSid: 'PN4aa51b930717ea83c91971b86d99018f'
                      },
                          events => console.log(events.sid)
                      );
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Monitor;
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 monitor = new MonitorClient(AccountSid, AuthToken);

    var options = new EventListRequest();
    options.ResourceSid = "PN4aa51b930717ea83c91971b86d99018f";
    var events = monitor.ListEvents(options);
    foreach (var e in events.Events)
    {
      Console.WriteLine(e.Description);
    }
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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 Monitor_Services_Twilio($sid, $token);

$params = array(
    'ResourceSid' => 'PN4aa51b930717ea83c91971b86d99018f'
);
$events = $client->events->getIterator(0, 50, $params);
foreach ($events as $e) {
    echo $e->description;
}
# 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::MonitorClient.new account_sid, auth_token

@params = {
  resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
}
@client.events.list(@params).each do |e|
  puts e.description
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Monitor.V1;


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

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(resourceSid: "PN4aa51b930717ea83c91971b86d99018f");

        foreach(var record in events)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$events = $twilio->monitor->v1->events
                              ->read(array(
                                         "resourceSid" => "PN4aa51b930717ea83c91971b86d99018f"
                                     )
                              );

foreach ($events as $record) {
    print($record->sid);
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.monitor import TwilioMonitorClient

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

events = client.events.list(resource_sid="PN4aa51b930717ea83c91971b86d99018f")

for e in events:
    print(e.description)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# 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)

events = @client.monitor.events
                        .list(
                           resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
                         )

events.each do |record|
  puts record.sid
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioMonitorClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.monitor.Event;
import com.twilio.sdk.resource.list.monitor.EventList;
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 {
    TwilioMonitorClient client = new TwilioMonitorClient(ACCOUNT_SID, AUTH_TOKEN);

    Map<String, String> params = new HashMap<String, String>();
    params.put("ResourceSid", "PN4aa51b930717ea83c91971b86d99018f");
    EventList events = client.getEvents(params);

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

events = client.monitor.events \
                       .list(resource_sid='PN4aa51b930717ea83c91971b86d99018f')

for record in events:
    print(record.sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.Event;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<Event> events = Event.reader()
            .setResourceSid("PN4aa51b930717ea83c91971b86d99018f")
            .read();

        for(Event record : events) {
            System.out.println(record.getSid());
        }
    }
}
curl -X GET 'https://monitor.twilio.com/v1/Events?ResourceSid=PN4aa51b930717ea83c91971b86d99018f' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "events": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_data": {
        "friendly_name": {
          "previous": "SubAccount Created at 2014-10-03 09:48 am",
          "updated": "Mr. Friendly"
        }
      },
      "event_date": "2014-10-03T16:48:25Z",
      "event_type": "account.updated",
      "links": {
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "resource_sid": "PN4aa51b930717ea83c91971b86d99018f",
      "resource_type": "account",
      "sid": "AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "source": "api",
      "source_ip_address": "10.86.6.250",
      "url": "https://monitor.twilio.com/v1/Events/AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  ],
  "meta": {
    "first_page_url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0",
    "key": "events",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0"
  },
  "resource_sid": "PN4aa51b930717ea83c91971b86d99018f"
}
電話番号のフィルタリング

SourceIpAddress フィルターを使用して、4 月のある 1 日の特定の IP アドレスのアクティビティを追跡する例:

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
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
// 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 MonitorClient = require('twilio').MonitorClient;
const client = new MonitorClient(accountSid, authToken);

const params = {
  sourceIpAddress: '104.14.155.29',
  startDate: '2015-04-25T00:00:00Z',
  endDate: '2015-04-25T23:59:59Z',
};
client.events.list(params, (error, events) => {
  for (const e in events) {
    process.stdout.write(e);
  }
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.monitor.events.each({
                        endDate: new Date(Date.UTC(2015, 3, 25, 0, 0, 0)),
                        sourceIpAddress: '104.14.155.29',
                        startDate: new Date(Date.UTC(2015, 3, 25, 0, 0, 0))
                      },
                          events => console.log(events.sid)
                      );
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Monitor;
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 monitor = new MonitorClient(AccountSid, AuthToken);

    var options = new EventListRequest();
    options.SourceIpAddress = "104.14.155.29";
    options.StartDate = new DateTime(2015, 4, 25);
    options.EndDate = new DateTime(2015, 4, 25, 23, 59, 59);
    var events = monitor.ListEvents(options);
    foreach (var e in events.Events)
    {
      Console.WriteLine(e.Description);
    }
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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 Monitor_Services_Twilio($sid, $token);

$params = array(
    'SourceIpAddress' => '104.14.155.29',
    'StartDate' => '2015-04-25T00:00:00Z',
    'EndDate' => '2015-04-25T23:59:59Z'
);
$events = $client->events->getIterator(0, 50, $params);
foreach ($events as $e) {
    echo $e->description;
}
# 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::MonitorClient.new account_sid, auth_token

@params = {
  source_ip_address: '104.14.155.29',
  start_date: '2015-04-25T00:00:00Z',
  end_date: '2015-04-25T23:59:59Z'
}
@client.events.list(@params).each do |e|
  puts e.description
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Monitor.V1;


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

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(
            endDate: new DateTime(2015, 4, 25, 0, 0, 0),
            sourceIpAddress: "104.14.155.29",
            startDate: new DateTime(2015, 4, 25, 0, 0, 0)
        );

        foreach(var record in events)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$events = $twilio->monitor->v1->events
                              ->read(array(
                                         "endDate" => new \DateTime('2015-4-25'),
                                         "sourceIpAddress" => "104.14.155.29",
                                         "startDate" => new \DateTime('2015-4-25')
                                     )
                              );

foreach ($events as $record) {
    print($record->sid);
}
# Download the Python helper library from twilio.com/docs/python/install
from datetime import datetime

import pytz
from twilio.rest.monitor import TwilioMonitorClient

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

events = client.events.list(
    source_ip_address="104.14.155.29",
    start_date=datetime(2015, 4, 25, tzinfo=pytz.UTC).isoformat(),
    end_date=datetime(2015, 4, 25, 23, 59, 59, tzinfo=pytz.UTC).isoformat(),
)

for e in events:
    print(e.description)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# 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)

events = @client.monitor.events.list(
                                  end_date: Date.new(2015, 4, 25),
                                  source_ip_address: '104.14.155.29',
                                  start_date: Date.new(2015, 4, 25)
                                )

events.each do |record|
  puts record.sid
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioMonitorClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.monitor.Event;
import com.twilio.sdk.resource.list.monitor.EventList;
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 {
    TwilioMonitorClient client = new TwilioMonitorClient(ACCOUNT_SID, AUTH_TOKEN);

    Map<String, String> params = new HashMap<String, String>();
    params.put("SourceIpAddress", "104.14.155.29");
    params.put("StartDate", "2015-04-25T00:00:00Z");
    params.put("EndDate", "2015-04-25T23:59:59Z");
    EventList events = client.getEvents(params);

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from datetime import datetime
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

events = client.monitor.events.list(
                                   end_date=datetime(2015, 4, 25, 0, 0),
                                   source_ip_address='104.14.155.29',
                                   start_date=datetime(2015, 4, 25, 0, 0)
                               )

for record in events:
    print(record.sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.Event;
import org.joda.time.DateTime;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<Event> events = Event.reader()
            .setEndDate(new DateTime(2015, 4, 25, 0, 0))
            .setSourceIpAddress("104.14.155.29")
            .setStartDate(new DateTime(2015, 4, 25, 0, 0))
            .read();

        for(Event record : events) {
            System.out.println(record.getSid());
        }
    }
}
curl -X GET 'https://monitor.twilio.com/v1/Events?EndDate=2015-04-25&SourceIpAddress=104.14.155.29&StartDate=2015-04-25' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "events": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_data": {
        "friendly_name": {
          "previous": "SubAccount Created at 2014-10-03 09:48 am",
          "updated": "Mr. Friendly"
        }
      },
      "event_date": "2014-10-03T16:48:25Z",
      "event_type": "account.updated",
      "links": {
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "account",
      "sid": "AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "source": "api",
      "source_ip_address": "104.14.155.29",
      "url": "https://monitor.twilio.com/v1/Events/AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "end_date": "2015-04-25",
      "start_date": "2015-04-25"
    }
  ],
  "meta": {
    "first_page_url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0",
    "key": "events",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0"
  },
  "end_date": "2015-04-25",
  "source_ip_address": "104.14.155.29",
  "start_date": "2015-04-25"
}
IP アドレスのフィルタリング

ActorSidResourceSid、および SourceIpAddress は、一度にどれか 1 つしか使えないので、次に示す ActorSidResourceSid を両方使用するリクエストを送信すると、HTTP 400 エラーが返されます。

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
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
// 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 MonitorClient = require('twilio').MonitorClient;
const client = new MonitorClient(accountSid, authToken);

const params = {
  actorSid: 'USd0afd67cddff4ec7cb0022771a203cb1',
  resourceSid: 'PN4aa51b930717ea83c91971b86d99018f',
};
client.events.list(params, (error, events) => {
  for (const e in events) {
    process.stdout.write(e);
  }
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.monitor.events.each({
                        actorSid: 'USd0afd67cddff4ec7cb0022771a203cb1',
                        resourceSid: 'PN4aa51b930717ea83c91971b86d99018f'
                      },
                          events => console.log(events.sid)
                      );
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Monitor;
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 monitor = new MonitorClient(AccountSid, AuthToken);

    var options = new EventListRequest();
    options.ActorSid = "USd0afd67cddff4ec7cb0022771a203cb1";
    options.ResourceSid = "PN4aa51b930717ea83c91971b86d99018f";
    var events = monitor.ListEvents(options);
    foreach (var e in events.Events)
    {
      Console.WriteLine(e.Description);
    }
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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 Monitor_Services_Twilio($sid, $token);

$params = array(
    'ActorSid' => 'USd0afd67cddff4ec7cb0022771a203cb1',
    'ResourceSid' => 'PN4aa51b930717ea83c91971b86d99018f'
);
$events = $client->events->getIterator(0, 50, $params);
foreach ($events as $e) {
    echo $e->description;
}
# 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::MonitorClient.new account_sid, auth_token

@params = {
  actor_sid: 'USd0afd67cddff4ec7cb0022771a203cb1',
  resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
}
@client.events.list(@params).each do |e|
  puts e.description
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Monitor.V1;


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

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(
            actorSid: "USd0afd67cddff4ec7cb0022771a203cb1",
            resourceSid: "PN4aa51b930717ea83c91971b86d99018f"
        );

        foreach(var record in events)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$events = $twilio->monitor->v1->events
                              ->read(array(
                                         "actorSid" => "USd0afd67cddff4ec7cb0022771a203cb1",
                                         "resourceSid" => "PN4aa51b930717ea83c91971b86d99018f"
                                     )
                              );

foreach ($events as $record) {
    print($record->sid);
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.monitor import TwilioMonitorClient

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

events = client.events.list(
    actor_sid="USd0afd67cddff4ec7cb0022771a203cb1",
    resource_sid="PN4aa51b930717ea83c91971b86d99018f",
)

for e in events:
    print(e.description)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# 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)

events = @client.monitor.events
                        .list(
                           actor_sid: 'USd0afd67cddff4ec7cb0022771a203cb1',
                           resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
                         )

events.each do |record|
  puts record.sid
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioMonitorClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.monitor.Event;
import com.twilio.sdk.resource.list.monitor.EventList;
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 {
    TwilioMonitorClient client = new TwilioMonitorClient(ACCOUNT_SID, AUTH_TOKEN);

    Map<String, String> params = new HashMap<String, String>();
    params.put("ActorSid", "USd0afd67cddff4ec7cb0022771a203cb1");
    params.put("ResourceSid", "PN4aa51b930717ea83c91971b86d99018f");
    EventList events = client.getEvents(params);

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

events = client.monitor.events \
                       .list(
                            actor_sid='USd0afd67cddff4ec7cb0022771a203cb1',
                            resource_sid='PN4aa51b930717ea83c91971b86d99018f'
                        )

for record in events:
    print(record.sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.Event;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<Event> events = Event.reader()
            .setActorSid("USd0afd67cddff4ec7cb0022771a203cb1")
            .setResourceSid("PN4aa51b930717ea83c91971b86d99018f")
            .read();

        for(Event record : events) {
            System.out.println(record.getSid());
        }
    }
}
curl -X GET 'https://monitor.twilio.com/v1/Events?ActorSid=USd0afd67cddff4ec7cb0022771a203cb1&ResourceSid=PN4aa51b930717ea83c91971b86d99018f' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "events": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
      "actor_type": "account",
      "description": null,
      "event_data": {
        "friendly_name": {
          "previous": "SubAccount Created at 2014-10-03 09:48 am",
          "updated": "Mr. Friendly"
        }
      },
      "event_date": "2014-10-03T16:48:25Z",
      "event_type": "account.updated",
      "links": {
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "resource_sid": "PN4aa51b930717ea83c91971b86d99018f",
      "resource_type": "account",
      "sid": "AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "source": "api",
      "source_ip_address": "10.86.6.250",
      "url": "https://monitor.twilio.com/v1/Events/AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  ],
  "meta": {
    "first_page_url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0",
    "key": "events",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0"
  },
  "actor_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
  "resource_sid": "PN4aa51b930717ea83c91971b86d99018f"
}
一度に使用するフィルタープロパティーは 1 つだけです!

HTTP POST

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

HTTP PUT

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

HTTP DELETE

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

サポートされているすべてのリソースタイプとイベントタイプの完全なリスト

現在、イベントは、次に示すリソースタイプと関連イベントタイプを追跡しています。

リソースタイプ イベントタイプ
アカウント account.created
account.updated
account.deleted
アプリケーション application.created
application.updated
application.deleted
authorized-connect-app authorized-connect-app.created
authorized-connect-app.deleted
call call.deleted
caller-id caller-id.created
caller-id.updated
caller-id.deleted
connect-app connect-app.created
connect-app.updated
connect-app.deleted
invoice-settings invoice-settings.updated
message message.updated
message.deleted
message-body message-body.deleted
message-media message-media.deleted
payment payment.created
payment-method payment-method.created
payment-method.updated
payment-method.deleted
payment-refund payment-refund.created
phone-number phone-number.created
phone-number.updated
phone-number.deleted
recharge-trigger recharge-trigger.created
recharge-trigger.updated
recharge-trigger.deleted
レコーディング recording.deleted
Shortcode shortcode.created
shortcode.updated
shortcode.deleted
sip-credential-list sip-credential-list.created
sip-credential-list.updated
sip-credential-list.deleted
sip-domain sip-domain.created
sip-domain.updated
sip-domain.deleted
sip-ip-access-control-list sip-ip-access-control-list.created
sip-ip-access-control-list.updated
sip-ip-access-control-list.deleted
support-plan support-plan.updated
sms-geographic-permissions sms-geographic-permissions.updated
トランスクリプション transcription.deleted
usage-trigger usage-trigger.created
usage-trigger.updated
usage-trigger.deleted
voice-geographic-permissions voice-geographic-permissions.updated
wireless-sim wireless-sim.updated

ヘルプが必要ですか?

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

コードサンプルを読み込んでいます...
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
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
// 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 MonitorClient = require('twilio').MonitorClient;
const client = new MonitorClient(accountSid, authToken);

client.events('AE21f24380625e4aa4abec76e39b14458d').get((error, event) => {
  process.stdout.write(event.eventType);
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.monitor.events('AE21f24380625e4aa4abec76e39b14458d')
              .fetch()
              .then(event => console.log(event.actorSid))
              .done();
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Monitor;
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 monitor = new MonitorClient(AccountSid, AuthToken);

    var e = monitor.GetEvent("AE21f24380625e4aa4abec76e39b14458d");
    Console.WriteLine(e.Description);
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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 Monitor_Services_Twilio($sid, $token);

$event = $client->events->get("AE21f24380625e4aa4abec76e39b14458d");
echo $event->description;
# 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::MonitorClient.new account_sid, auth_token

event = @client.events.get('AE21f24380625e4aa4abec76e39b14458d')

puts event.description
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Monitor.V1;


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

        TwilioClient.Init(accountSid, authToken);

        var _event = EventResource.Fetch(pathSid: "AE21f24380625e4aa4abec76e39b14458d");

        Console.WriteLine(_event.ActorSid);
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$event = $twilio->monitor->v1->events("AE21f24380625e4aa4abec76e39b14458d")
                             ->fetch();

print($event->actorSid);
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.monitor import TwilioMonitorClient

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

event = client.events.get("AE21f24380625e4aa4abec76e39b14458d")
print(event.description)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# 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)

event = @client.monitor.events('AE21f24380625e4aa4abec76e39b14458d').fetch

puts event.actor_sid
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioMonitorClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.monitor.Event;

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 {
    TwilioMonitorClient client = new TwilioMonitorClient(ACCOUNT_SID, AUTH_TOKEN);

    Event e = client.getEvent("AE21f24380625e4aa4abec76e39b14458d");

    System.out.println(e.getDescription());
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

event = client.monitor.events('AE21f24380625e4aa4abec76e39b14458d').fetch()

print(event.actor_sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.monitor.v1.Event;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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);
        Event event = Event.fetcher("AE21f24380625e4aa4abec76e39b14458d")
            .fetch();

        System.out.println(event.getActorSid());
    }
}
curl -X GET 'https://monitor.twilio.com/v1/Events/AE21f24380625e4aa4abec76e39b14458d' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "actor_sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "actor_type": "account",
  "description": null,
  "event_data": {
    "friendly_name": {
      "previous": "SubAccount Created at 2014-10-03 09:48 am",
      "updated": "Mr. Friendly"
    }
  },
  "event_date": "2014-10-03T16:48:25Z",
  "event_type": "account.updated",
  "links": {
    "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  },
  "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "resource_type": "account",
  "sid": "AE21f24380625e4aa4abec76e39b14458d",
  "source": "api",
  "source_ip_address": "10.86.6.250",
  "url": "https://monitor.twilio.com/v1/Events/AE21f24380625e4aa4abec76e39b14458d"
}
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
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
// 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 MonitorClient = require('twilio').MonitorClient;
const client = new MonitorClient(accountSid, authToken);

const params = {
  startDate: '2015-03-01T00:00:00Z',
  endDate: '2015-04-01T00:00:00Z',
};
client.events.list(params, (error, events) => {
  for (const e in events) {
    process.stdout.write(e);
  }
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.monitor.events.each({
                        endDate: new Date(Date.UTC(2015, 3, 1, 0, 0, 0)),
                        startDate: new Date(Date.UTC(2015, 2, 1, 0, 0, 0))
                      },
                          events => console.log(events.sid)
                      );
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Monitor;
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 monitor = new MonitorClient(AccountSid, AuthToken);

    var options = new EventListRequest();
    options.StartDate = new DateTime(2015, 3, 1);
    options.EndDate = new DateTime(2015, 4, 1);
    var events = monitor.ListEvents(options);
    foreach (var e in events.Events)
    {
      Console.WriteLine(e.Description);
    }
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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 Monitor_Services_Twilio($sid, $token);

$params = array(
    'StartDate' => '2015-03-01T00:00:00Z',
    'EndDate' => '2015-04-01T00:00:00Z'
);
$events = $client->events->getIterator(0, 50, $params);
foreach ($events as $e) {
    echo $e->description;
}
# 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::MonitorClient.new account_sid, auth_token

@params = {
  start_date: '2015-03-01T00:00:00Z',
  end_date: '2015-04-01T00:00:00Z'
}
@client.events.list(@params).each do |e|
  puts e.description
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Monitor.V1;


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

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(
            endDate: new DateTime(2015, 4, 1, 0, 0, 0),
            startDate: new DateTime(2015, 3, 1, 0, 0, 0)
        );

        foreach(var record in events)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$events = $twilio->monitor->v1->events
                              ->read(array(
                                         "endDate" => new \DateTime('2015-4-1'),
                                         "startDate" => new \DateTime('2015-3-1')
                                     )
                              );

foreach ($events as $record) {
    print($record->sid);
}
# Download the Python helper library from twilio.com/docs/python/install
from datetime import datetime

import pytz
from twilio.rest.monitor import TwilioMonitorClient

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

events = client.events.list(
    start_date=datetime(2015, 3, 1, tzinfo=pytz.UTC).isoformat(),
    end_date=datetime(2015, 4, 1, tzinfo=pytz.UTC).isoformat(),
)

for e in events:
    print(e.description)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# 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)

events = @client.monitor.events.list(
                                  end_date: Date.new(2015, 4, 1),
                                  start_date: Date.new(2015, 3, 1)
                                )

events.each do |record|
  puts record.sid
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioMonitorClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.monitor.Event;
import com.twilio.sdk.resource.list.monitor.EventList;
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 {
    TwilioMonitorClient client = new TwilioMonitorClient(ACCOUNT_SID, AUTH_TOKEN);

    Map<String, String> params = new HashMap<String, String>();
    params.put("StartDate", "2015-03-01T00:00:00Z");
    params.put("EndDate", "2015-04-01T00:00:00Z");
    EventList events = client.getEvents(params);

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from datetime import datetime
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

events = client.monitor.events.list(
                                   end_date=datetime(2015, 4, 1, 0, 0),
                                   start_date=datetime(2015, 3, 1, 0, 0)
                               )

for record in events:
    print(record.sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.Event;
import org.joda.time.DateTime;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<Event> events = Event.reader()
            .setEndDate(new DateTime(2015, 4, 1, 0, 0))
            .setStartDate(new DateTime(2015, 3, 1, 0, 0))
            .read();

        for(Event record : events) {
            System.out.println(record.getSid());
        }
    }
}
curl -X GET 'https://monitor.twilio.com/v1/Events?EndDate=2015-04-01&StartDate=2015-03-01' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "events": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_data": {
        "friendly_name": {
          "previous": "SubAccount Created at 2014-10-03 09:48 am",
          "updated": "Mr. Friendly"
        }
      },
      "event_date": "2014-10-03T16:48:25Z",
      "event_type": "account.updated",
      "links": {
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "account",
      "sid": "AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "source": "api",
      "source_ip_address": "10.86.6.250",
      "url": "https://monitor.twilio.com/v1/Events/AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "end_date": "2015-04-01",
      "start_date": "2015-03-01"
    }
  ],
  "meta": {
    "first_page_url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0",
    "key": "events",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0"
  },
  "end_date": "2015-04-01",
  "start_date": "2015-03-01"
}
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
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
// 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 MonitorClient = require('twilio').MonitorClient;
const client = new MonitorClient(accountSid, authToken);

const params = {
  resourceSid: 'PN4aa51b930717ea83c91971b86d99018f',
};
client.events.list(params, (error, events) => {
  for (const e in events) {
    process.stdout.write(e);
  }
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.monitor.events.each({
                        resourceSid: 'PN4aa51b930717ea83c91971b86d99018f'
                      },
                          events => console.log(events.sid)
                      );
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Monitor;
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 monitor = new MonitorClient(AccountSid, AuthToken);

    var options = new EventListRequest();
    options.ResourceSid = "PN4aa51b930717ea83c91971b86d99018f";
    var events = monitor.ListEvents(options);
    foreach (var e in events.Events)
    {
      Console.WriteLine(e.Description);
    }
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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 Monitor_Services_Twilio($sid, $token);

$params = array(
    'ResourceSid' => 'PN4aa51b930717ea83c91971b86d99018f'
);
$events = $client->events->getIterator(0, 50, $params);
foreach ($events as $e) {
    echo $e->description;
}
# 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::MonitorClient.new account_sid, auth_token

@params = {
  resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
}
@client.events.list(@params).each do |e|
  puts e.description
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Monitor.V1;


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

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(resourceSid: "PN4aa51b930717ea83c91971b86d99018f");

        foreach(var record in events)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$events = $twilio->monitor->v1->events
                              ->read(array(
                                         "resourceSid" => "PN4aa51b930717ea83c91971b86d99018f"
                                     )
                              );

foreach ($events as $record) {
    print($record->sid);
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.monitor import TwilioMonitorClient

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

events = client.events.list(resource_sid="PN4aa51b930717ea83c91971b86d99018f")

for e in events:
    print(e.description)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# 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)

events = @client.monitor.events
                        .list(
                           resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
                         )

events.each do |record|
  puts record.sid
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioMonitorClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.monitor.Event;
import com.twilio.sdk.resource.list.monitor.EventList;
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 {
    TwilioMonitorClient client = new TwilioMonitorClient(ACCOUNT_SID, AUTH_TOKEN);

    Map<String, String> params = new HashMap<String, String>();
    params.put("ResourceSid", "PN4aa51b930717ea83c91971b86d99018f");
    EventList events = client.getEvents(params);

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

events = client.monitor.events \
                       .list(resource_sid='PN4aa51b930717ea83c91971b86d99018f')

for record in events:
    print(record.sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.Event;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<Event> events = Event.reader()
            .setResourceSid("PN4aa51b930717ea83c91971b86d99018f")
            .read();

        for(Event record : events) {
            System.out.println(record.getSid());
        }
    }
}
curl -X GET 'https://monitor.twilio.com/v1/Events?ResourceSid=PN4aa51b930717ea83c91971b86d99018f' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "events": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_data": {
        "friendly_name": {
          "previous": "SubAccount Created at 2014-10-03 09:48 am",
          "updated": "Mr. Friendly"
        }
      },
      "event_date": "2014-10-03T16:48:25Z",
      "event_type": "account.updated",
      "links": {
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "resource_sid": "PN4aa51b930717ea83c91971b86d99018f",
      "resource_type": "account",
      "sid": "AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "source": "api",
      "source_ip_address": "10.86.6.250",
      "url": "https://monitor.twilio.com/v1/Events/AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  ],
  "meta": {
    "first_page_url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0",
    "key": "events",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0"
  },
  "resource_sid": "PN4aa51b930717ea83c91971b86d99018f"
}
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
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
// 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 MonitorClient = require('twilio').MonitorClient;
const client = new MonitorClient(accountSid, authToken);

const params = {
  sourceIpAddress: '104.14.155.29',
  startDate: '2015-04-25T00:00:00Z',
  endDate: '2015-04-25T23:59:59Z',
};
client.events.list(params, (error, events) => {
  for (const e in events) {
    process.stdout.write(e);
  }
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.monitor.events.each({
                        endDate: new Date(Date.UTC(2015, 3, 25, 0, 0, 0)),
                        sourceIpAddress: '104.14.155.29',
                        startDate: new Date(Date.UTC(2015, 3, 25, 0, 0, 0))
                      },
                          events => console.log(events.sid)
                      );
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Monitor;
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 monitor = new MonitorClient(AccountSid, AuthToken);

    var options = new EventListRequest();
    options.SourceIpAddress = "104.14.155.29";
    options.StartDate = new DateTime(2015, 4, 25);
    options.EndDate = new DateTime(2015, 4, 25, 23, 59, 59);
    var events = monitor.ListEvents(options);
    foreach (var e in events.Events)
    {
      Console.WriteLine(e.Description);
    }
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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 Monitor_Services_Twilio($sid, $token);

$params = array(
    'SourceIpAddress' => '104.14.155.29',
    'StartDate' => '2015-04-25T00:00:00Z',
    'EndDate' => '2015-04-25T23:59:59Z'
);
$events = $client->events->getIterator(0, 50, $params);
foreach ($events as $e) {
    echo $e->description;
}
# 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::MonitorClient.new account_sid, auth_token

@params = {
  source_ip_address: '104.14.155.29',
  start_date: '2015-04-25T00:00:00Z',
  end_date: '2015-04-25T23:59:59Z'
}
@client.events.list(@params).each do |e|
  puts e.description
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Monitor.V1;


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

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(
            endDate: new DateTime(2015, 4, 25, 0, 0, 0),
            sourceIpAddress: "104.14.155.29",
            startDate: new DateTime(2015, 4, 25, 0, 0, 0)
        );

        foreach(var record in events)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$events = $twilio->monitor->v1->events
                              ->read(array(
                                         "endDate" => new \DateTime('2015-4-25'),
                                         "sourceIpAddress" => "104.14.155.29",
                                         "startDate" => new \DateTime('2015-4-25')
                                     )
                              );

foreach ($events as $record) {
    print($record->sid);
}
# Download the Python helper library from twilio.com/docs/python/install
from datetime import datetime

import pytz
from twilio.rest.monitor import TwilioMonitorClient

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

events = client.events.list(
    source_ip_address="104.14.155.29",
    start_date=datetime(2015, 4, 25, tzinfo=pytz.UTC).isoformat(),
    end_date=datetime(2015, 4, 25, 23, 59, 59, tzinfo=pytz.UTC).isoformat(),
)

for e in events:
    print(e.description)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# 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)

events = @client.monitor.events.list(
                                  end_date: Date.new(2015, 4, 25),
                                  source_ip_address: '104.14.155.29',
                                  start_date: Date.new(2015, 4, 25)
                                )

events.each do |record|
  puts record.sid
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioMonitorClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.monitor.Event;
import com.twilio.sdk.resource.list.monitor.EventList;
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 {
    TwilioMonitorClient client = new TwilioMonitorClient(ACCOUNT_SID, AUTH_TOKEN);

    Map<String, String> params = new HashMap<String, String>();
    params.put("SourceIpAddress", "104.14.155.29");
    params.put("StartDate", "2015-04-25T00:00:00Z");
    params.put("EndDate", "2015-04-25T23:59:59Z");
    EventList events = client.getEvents(params);

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from datetime import datetime
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

events = client.monitor.events.list(
                                   end_date=datetime(2015, 4, 25, 0, 0),
                                   source_ip_address='104.14.155.29',
                                   start_date=datetime(2015, 4, 25, 0, 0)
                               )

for record in events:
    print(record.sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.Event;
import org.joda.time.DateTime;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<Event> events = Event.reader()
            .setEndDate(new DateTime(2015, 4, 25, 0, 0))
            .setSourceIpAddress("104.14.155.29")
            .setStartDate(new DateTime(2015, 4, 25, 0, 0))
            .read();

        for(Event record : events) {
            System.out.println(record.getSid());
        }
    }
}
curl -X GET 'https://monitor.twilio.com/v1/Events?EndDate=2015-04-25&SourceIpAddress=104.14.155.29&StartDate=2015-04-25' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "events": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_data": {
        "friendly_name": {
          "previous": "SubAccount Created at 2014-10-03 09:48 am",
          "updated": "Mr. Friendly"
        }
      },
      "event_date": "2014-10-03T16:48:25Z",
      "event_type": "account.updated",
      "links": {
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "account",
      "sid": "AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "source": "api",
      "source_ip_address": "104.14.155.29",
      "url": "https://monitor.twilio.com/v1/Events/AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "end_date": "2015-04-25",
      "start_date": "2015-04-25"
    }
  ],
  "meta": {
    "first_page_url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0",
    "key": "events",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0"
  },
  "end_date": "2015-04-25",
  "source_ip_address": "104.14.155.29",
  "start_date": "2015-04-25"
}
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
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
// 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 MonitorClient = require('twilio').MonitorClient;
const client = new MonitorClient(accountSid, authToken);

const params = {
  actorSid: 'USd0afd67cddff4ec7cb0022771a203cb1',
  resourceSid: 'PN4aa51b930717ea83c91971b86d99018f',
};
client.events.list(params, (error, events) => {
  for (const e in events) {
    process.stdout.write(e);
  }
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.monitor.events.each({
                        actorSid: 'USd0afd67cddff4ec7cb0022771a203cb1',
                        resourceSid: 'PN4aa51b930717ea83c91971b86d99018f'
                      },
                          events => console.log(events.sid)
                      );
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Monitor;
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 monitor = new MonitorClient(AccountSid, AuthToken);

    var options = new EventListRequest();
    options.ActorSid = "USd0afd67cddff4ec7cb0022771a203cb1";
    options.ResourceSid = "PN4aa51b930717ea83c91971b86d99018f";
    var events = monitor.ListEvents(options);
    foreach (var e in events.Events)
    {
      Console.WriteLine(e.Description);
    }
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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 Monitor_Services_Twilio($sid, $token);

$params = array(
    'ActorSid' => 'USd0afd67cddff4ec7cb0022771a203cb1',
    'ResourceSid' => 'PN4aa51b930717ea83c91971b86d99018f'
);
$events = $client->events->getIterator(0, 50, $params);
foreach ($events as $e) {
    echo $e->description;
}
# 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::MonitorClient.new account_sid, auth_token

@params = {
  actor_sid: 'USd0afd67cddff4ec7cb0022771a203cb1',
  resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
}
@client.events.list(@params).each do |e|
  puts e.description
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Monitor.V1;


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

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(
            actorSid: "USd0afd67cddff4ec7cb0022771a203cb1",
            resourceSid: "PN4aa51b930717ea83c91971b86d99018f"
        );

        foreach(var record in events)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$events = $twilio->monitor->v1->events
                              ->read(array(
                                         "actorSid" => "USd0afd67cddff4ec7cb0022771a203cb1",
                                         "resourceSid" => "PN4aa51b930717ea83c91971b86d99018f"
                                     )
                              );

foreach ($events as $record) {
    print($record->sid);
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.monitor import TwilioMonitorClient

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

events = client.events.list(
    actor_sid="USd0afd67cddff4ec7cb0022771a203cb1",
    resource_sid="PN4aa51b930717ea83c91971b86d99018f",
)

for e in events:
    print(e.description)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# 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)

events = @client.monitor.events
                        .list(
                           actor_sid: 'USd0afd67cddff4ec7cb0022771a203cb1',
                           resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
                         )

events.each do |record|
  puts record.sid
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioMonitorClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.monitor.Event;
import com.twilio.sdk.resource.list.monitor.EventList;
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 {
    TwilioMonitorClient client = new TwilioMonitorClient(ACCOUNT_SID, AUTH_TOKEN);

    Map<String, String> params = new HashMap<String, String>();
    params.put("ActorSid", "USd0afd67cddff4ec7cb0022771a203cb1");
    params.put("ResourceSid", "PN4aa51b930717ea83c91971b86d99018f");
    EventList events = client.getEvents(params);

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

events = client.monitor.events \
                       .list(
                            actor_sid='USd0afd67cddff4ec7cb0022771a203cb1',
                            resource_sid='PN4aa51b930717ea83c91971b86d99018f'
                        )

for record in events:
    print(record.sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.Event;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<Event> events = Event.reader()
            .setActorSid("USd0afd67cddff4ec7cb0022771a203cb1")
            .setResourceSid("PN4aa51b930717ea83c91971b86d99018f")
            .read();

        for(Event record : events) {
            System.out.println(record.getSid());
        }
    }
}
curl -X GET 'https://monitor.twilio.com/v1/Events?ActorSid=USd0afd67cddff4ec7cb0022771a203cb1&ResourceSid=PN4aa51b930717ea83c91971b86d99018f' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "events": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
      "actor_type": "account",
      "description": null,
      "event_data": {
        "friendly_name": {
          "previous": "SubAccount Created at 2014-10-03 09:48 am",
          "updated": "Mr. Friendly"
        }
      },
      "event_date": "2014-10-03T16:48:25Z",
      "event_type": "account.updated",
      "links": {
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "resource_sid": "PN4aa51b930717ea83c91971b86d99018f",
      "resource_type": "account",
      "sid": "AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "source": "api",
      "source_ip_address": "10.86.6.250",
      "url": "https://monitor.twilio.com/v1/Events/AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  ],
  "meta": {
    "first_page_url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0",
    "key": "events",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0"
  },
  "actor_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
  "resource_sid": "PN4aa51b930717ea83c91971b86d99018f"
}