モニター 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 フォーマットで提供
説明 アドレスの より読みやすい形式の説明です。おそらく 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 説明
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
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var MonitorClient = require('twilio').MonitorClient;
var client = new MonitorClient(accountSid, authToken);

client.events('AE21f24380625e4aa4abec76e39b14458d').get(function(error, event) {
    process.stdout.write(event.eventType);
});
// Download the Node helper library from twilio.com/docs/node/install
// These are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

const client = require('twilio')(accountSid, authToken);

client.monitor.v1
  .events('AE21f24380625e4aa4abec76e39b14458d')
  .fetch()
  .then((data) => console.log(event.description));
// 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
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Monitor.V1;

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

        TwilioClient.Init(accountSid, authToken);

        var e = EventResource.Fetch(eventSid);

        Console.WriteLine(e.Description);
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

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

echo $event->description;
# 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)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

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

puts @event.description
// 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 Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

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

event = client.monitor.events("AE21f24380625e4aa4abec76e39b14458d").fetch()
print(event.description)
// 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/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

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

    Event event = Event.fetcher("AE21f24380625e4aa4abec76e39b14458d").fetch();

    System.out.println(event.getDescription());
  }
}
$ curl -XGET https://monitor.twilio.com/v1/Events/AE21f24380625e4aa4abec76e39b14458d \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "links": {
    "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN4aa51b930717ea83c91971b86d99018f",
    "actor": null
  },
  "event_data": {
    "resource_properties": {
      "voice_fallback_url": {
        "previous": null,
        "updated": ""
      },
      "voice_url": {
        "previous": "http://www.example.com",
        "updated": "http://www.example.com/hello-joey"
      }
    }
  },
  "source_ip_address": "73.189.144.70",
  "source": "web",
  "url": "https://monitor.twilio.com/v1/Events/AE21f24380625e4aa4abec76e39b14458d",
  "sid": "AE21f24380625e4aa4abec76e39b14458d",
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "actor_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
  "actor_type": "user",
  "description": null,
  "event_date": "2015-04-29T02:55:15Z",
  "event_type": "phone-number.updated",
  "resource_sid": "PN4aa51b930717ea83c91971b86d99018f",
  "resource_type": "phone-number"
}
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 Node helper library from twilio.com/docs/node/install
// These are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

const client = require('twilio')(accountSid, authToken);

client.monitor.v1.events
  .list({
    startDate: '2015-03-01T00:00:00Z',
    endDate: '2015-04-01T00:00:00Z',
  })
  .then(response => console.log(response));
// 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
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Monitor.V1;

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

        TwilioClient.Init(accountSid, authToken);

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

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$events = $client->monitor->events->read(
    array(
        'startDate' => '2015-03-01T00:00:00Z',
        'endDate' => '2015-04-01T00:00:00Z'
    )
);

foreach ($events as $event) {
    echo $event->description;
}
# 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)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@params = {
  start_date: Time.new('2015-03-01T00:00:00Z'),
  end_date: Time.new('2015-04-01T00:00:00Z')
}

@client.monitor.v1.events.list(@params).each do |e|
  puts e.description
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 Python helper library from twilio.com/docs/python/install
from datetime import datetime

import pytz
from twilio.rest import Client

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

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

for e in events:
    print(e.description)
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.LocalDate;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.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) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Event> events = Event.reader()
        .setStartDate(LocalDate.parse("2015-03-01"))
        .setEndDate(LocalDate.parse("2015-04-01"))
        .read();

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
curl -XGET "https://monitor.twilio.com/v1/Events?StartDate=2015-03-01T00:00:00Z&EndDate=2015-04-01T00:00:00Z" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "events": [
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "falkland_islands": {
            "previous": "disabled",
            "updated": "enabled"
          }
        }
      },
      "source_ip_address": null,
      "source": "twilio",
      "url": "https://monitor.twilio.com/v1/Events/AEc997b108285f476abdfe93aff97e0175",
      "sid": "AEc997b108285f476abdfe93aff97e0175",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": null,
      "actor_type": null,
      "description": null,
      "event_date": "2015-03-13T22:17:27Z",
      "event_type": "sms-geographic-permissions.updated",
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "sms-geographic-permissions"
    },
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "south_sudan": {
            "previous": "disabled",
            "updated": "enabled"
          }
        }
      },
      "source_ip_address": null,
      "source": "twilio",
      "url": "https://monitor.twilio.com/v1/Events/AE824a2c66ff5940398d561b2c875cec80",
      "sid": "AE824a2c66ff5940398d561b2c875cec80",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": null,
      "actor_type": null,
      "description": null,
      "event_date": "2015-03-09T23:42:46Z",
      "event_type": "sms-geographic-permissions.updated",
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "sms-geographic-permissions"
    },
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "south_sudan": {
            "previous": "disabled",
            "updated": "enabled"
          }
        }
      },
      "source_ip_address": null,
      "source": "twilio",
      "url": "https://monitor.twilio.com/v1/Events/AEea2520d7439e4ed9aa2b3ddd532e04d3",
      "sid": "AEea2520d7439e4ed9aa2b3ddd532e04d3",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": null,
      "actor_type": null,
      "description": null,
      "event_date": "2015-03-09T22:41:34Z",
      "event_type": "sms-geographic-permissions.updated",
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "sms-geographic-permissions"
    },
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "south_sudan": {
            "previous": "disabled",
            "updated": "enabled"
          }
        }
      },
      "source_ip_address": null,
      "source": "twilio",
      "url": "https://monitor.twilio.com/v1/Events/AEaf5242e4f10242a299649cc1c1df1849",
      "sid": "AEaf5242e4f10242a299649cc1c1df1849",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": null,
      "actor_type": null,
      "description": null,
      "event_date": "2015-03-09T21:25:15Z",
      "event_type": "sms-geographic-permissions.updated",
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "sms-geographic-permissions"
    },
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "south_sudan": {
            "previous": "disabled",
            "updated": "enabled"
          }
        }
      },
      "source_ip_address": null,
      "source": "twilio",
      "url": "https://monitor.twilio.com/v1/Events/AE661752392a6e4bd5b8980471ab0b12aa",
      "sid": "AE661752392a6e4bd5b8980471ab0b12aa",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": null,
      "actor_type": null,
      "description": null,
      "event_date": "2015-03-09T20:38:20Z",
      "event_type": "sms-geographic-permissions.updated",
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "sms-geographic-permissions"
    }
  ],
  "meta": {
    "key": "events",
    "next_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?StartDate=2015-03-01T00%3A00%3A00Z&EndDate=2015-04-01T00%3A00%3A00Z&PageSize=50&Page=0",
    "previous_page_url": null,
    "first_page_url": "https://monitor.twilio.com/v1/Events?StartDate=2015-03-01T00%3A00%3A00Z&EndDate=2015-04-01T00%3A00%3A00Z&PageSize=50&Page=0",
    "page_size": 50,
    "page": 0
  }
}
日付によるフィルタリング

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
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var MonitorClient = require('twilio').MonitorClient;
var client = new MonitorClient(accountSid, authToken);

var params = {
    resourceSid: 'PN4aa51b930717ea83c91971b86d99018f'
};
client.events.list(params, function(error, events) {
    for (var e in events) {
        process.stdout.write(e);
    }
});
// Download the Node helper library from twilio.com/docs/node/install
// These are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

const client = require('twilio')(accountSid, authToken);

client.monitor.v1.events
  .list({
    resourceSid: 'PN4aa51b930717ea83c91971b86d99018f'
  })
  .then((response) => console.log(response));
// 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
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Monitor.V1;

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

        TwilioClient.Init(accountSid, authToken);

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

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$events = $client->monitor->events->read(
    array('resourceSid' => 'PN4aa51b930717ea83c91971b86d99018f')
);

foreach ($events as $event) {
    echo $event->description;
}
# 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)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@params = {
  resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
}

@client.monitor.v1.events.list(@params).each do |e|
  puts e.description
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 Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

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

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

for e in events:
    print(e.description)
// 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/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

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

    ResourceSet<Event> events = Event.reader()
        .setResourceSid("PN4aa51b930717ea83c91971b86d99018f")
        .read();

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
$ curl -XGET https://monitor.twilio.com/v1/Events?ResourceSid=PN4aa51b930717ea83c91971b86d99018f \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "events": [
    {
      "links": {
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN67652f4755e8c3a0bdf02a922949b888",
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "event_data": null,
      "source_ip_address": "173.227.7.2",
      "source": "api",
      "url": "https://monitor.twilio.com/v1/Events/AE0e0751c03ed6439ea61c30c653f99680",
      "sid": "AE0e0751c03ed6439ea61c30c653f99680",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_date": "2015-04-30T19:50:16Z",
      "event_type": "phone-number.deleted",
      "resource_sid": "PN67652f4755e8c3a0bdf02a922949b888",
      "resource_type": "phone-number"
    },
    {
      "links": {
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN67652f4755e8c3a0bdf02a922949b888",
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "event_data": {
        "resource_properties": {
          "voice_url": {
            "previous": null,
            "updated": "http://www.example.com"
          }
        }
      },
      "source_ip_address": "73.189.144.70",
      "source": "api",
      "url": "https://monitor.twilio.com/v1/Events/AEb3377b7f3144406ab9b804cb8ef79ddd",
      "sid": "AEb3377b7f3144406ab9b804cb8ef79ddd",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_date": "2015-04-19T22:21:04Z",
      "event_type": "phone-number.updated",
      "resource_sid": "PN67652f4755e8c3a0bdf02a922949b888",
      "resource_type": "phone-number"
    },
    {
      "links": {
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN67652f4755e8c3a0bdf02a922949b888",
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "event_data": {
        "resource_properties": {
          "status_callback": {
            "updated": ""
          },
          "status_callback_method": {
            "updated": "POST"
          },
          "voice_fallback_method": {
            "updated": "POST"
          },
          "voice_application_sid": {
            "updated": ""
          },
          "friendly_name": {
            "updated": "(510) 500-9369"
          },
          "sms_fallback_url": {
            "updated": ""
          },
          "sms_application_sid": {
            "updated": ""
          },
          "sms_method": {
            "updated": "POST"
          },
          "voice_method": {
            "updated": "POST"
          },
          "sms_fallback_method": {
            "updated": "POST"
          },
          "sms_url": {
            "updated": ""
          }
        },
        "previous_properties": {}
      },
      "source_ip_address": "73.189.144.70",
      "source": "api",
      "url": "https://monitor.twilio.com/v1/Events/AE68bc35581b6c465b9c35a0187a9f78f1",
      "sid": "AE68bc35581b6c465b9c35a0187a9f78f1",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_date": "2015-04-19T22:21:02Z",
      "event_type": "phone-number.created",
      "resource_sid": "PN67652f4755e8c3a0bdf02a922949b888",
      "resource_type": "phone-number"
    }
  ],
  "meta": {
    "key": "events",
    "next_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?ResourceSid=PN67652f4755e8c3a0bdf02a922949b888&PageSize=50&Page=0",
    "previous_page_url": null,
    "first_page_url": "https://monitor.twilio.com/v1/Events?ResourceSid=PN67652f4755e8c3a0bdf02a922949b888&PageSize=50&Page=0",
    "page_size": 50,
    "page": 0
  }
}
電話番号のフィルタリング

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
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var MonitorClient = require('twilio').MonitorClient;
var client = new MonitorClient(accountSid, authToken);

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

const client = require('twilio')(accountSid, authToken);

client.monitor.v1.events
  .list({
    sourceIpAddress: '104.14.155.29',
    startDate: '2015-04-25T00:00:00Z',
    endDate: '2015-04-25T23:59:59Z'
  })
  .then((response) => console.log(response));
// 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
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Monitor.V1;

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

        TwilioClient.Init(accountSid, authToken);

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

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$events = $client->monitor->events->read(
    array(
        'sourceIpAddress' => '104.14.155.29',
        'startDate' => '2015-04-25T00:00:00Z',
        'endDate' => '2015-04-25T23:59:59Z'
    )
);

foreach ($events as $event) {
    echo $event->description;
}
# 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)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@params = {
  source_ip_address: '104.14.155.29',
  start_date: Time.new('2015-04-25T00:00:00Z'),
  end_date: Time.new('2015-04-25T23:59:59Z')
}

@client.monitor.v1.events.list(@params).each do |e|
  puts e.description
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 Python helper library from twilio.com/docs/python/install
from datetime import datetime

import pytz
from twilio.rest import Client

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

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

for e in events:
    print(e.description)
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.LocalDate;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.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) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Event> events = Event.reader()
        .setSourceIpAddress("104.14.155.29")
        .setStartDate(LocalDate.parse("2015-04-25"))
        .setEndDate(LocalDate.parse("2015-04-25"))
        .read();

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
curl -XGET "https://monitor.twilio.com/v1/Events?SourceIpAddress=104.14.155.29&StartDate=2015-04-25T00:00:00Z&EndDate=2015-04-25T23:59:59Z" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "events": [
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "friendly_name": {
            "previous": "tim+audittester1@twilio.com",
            "updated": "tim+audittester100@twilio.com"
          },
          "email_address": {
            "previous": "tim+audittester1@twilio.com",
            "updated": "tim+audittester100@twilio.com"
          }
        }
      },
      "source_ip_address": "12.130.117.96",
      "source": "web",
      "url": "https://monitor.twilio.com/v1/Events/AEd6373d5a8e9540ce9f697d2bae7a2c34",
      "sid": "AEd6373d5a8e9540ce9f697d2bae7a2c34",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
      "actor_type": "user",
      "description": null,
      "event_date": "2015-01-04T00:38:23Z",
      "event_type": "user.updated",
      "resource_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
      "resource_type": "user"
    },
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": null,
      "source_ip_address": "12.130.117.96",
      "source": "web",
      "url": "https://monitor.twilio.com/v1/Events/AEf98c1e62319846a791c62f982cb045f6",
      "sid": "AEf98c1e62319846a791c62f982cb045f6",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
      "actor_type": "user",
      "description": null,
      "event_date": "2015-01-04T00:38:22Z",
      "event_type": "user-session.created",
      "resource_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
      "resource_type": "user-session"
    }
  ],
  "meta": {
    "key": "events",
    "next_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?SourceIpAddress=12.130.117.96&PageSize=50&Page=0",
    "previous_page_url": null,
    "first_page_url": "https://monitor.twilio.com/v1/Events?SourceIpAddress=12.130.117.96&PageSize=50&Page=0",
    "page_size": 50,
    "page": 0
  }
}
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
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var MonitorClient = require('twilio').MonitorClient;
var client = new MonitorClient(accountSid, authToken);

var params = {
    actorSid: 'USd0afd67cddff4ec7cb0022771a203cb1',
    resourceSid: 'PN4aa51b930717ea83c91971b86d99018f'
};
client.events.list(params, function(error, events) {
    for (var e in events) {
        process.stdout.write(e);
    }
});
// Download the Node helper library from twilio.com/docs/node/install
// These are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

const client = require('twilio')(accountSid, authToken);

client.monitor.v1.events.list()
  .then((response) => console.log(response));
// 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
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Monitor.V1;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string actorSid = "USd0afd67cddff4ec7cb0022771a203cb1";
        const string resourceSid = "PN4aa51b930717ea83c91971b86d99018f";

        TwilioClient.Init(accountSid, authToken);

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

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$events = $client->monitor->events->read(
    array(
        'actorSid' => 'USd0afd67cddff4ec7cb0022771a203cb1',
        'resourceSid' => 'PN4aa51b930717ea83c91971b86d99018f'
    )
);

foreach ($events as $event) {
    echo $event->description;
}
# 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)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@params = {
  actor_sid: 'USd0afd67cddff4ec7cb0022771a203cb1',
  resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
}

@client.monitor.v1.events.list(@params).each do |e|
  puts e.description
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 Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

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

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

for e in events:
    print(e.description)
// 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/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

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

    ResourceSet<Event> events = Event.reader()
        .setActorSid("USd0afd67cddff4ec7cb0022771a203cb1")
        .setResourceSid("PN4aa51b930717ea83c91971b86d99018f")
        .read();

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
curl -XGET "https://monitor.twilio.com/v1/Events?ActorSid=USd0afd67cddff4ec7cb0022771a203cb1&ResourceSid=PN4aa51b930717ea83c91971b86d99018f" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "status": 400,
  "more_info": "https://www.twilio.com/docs/errors/400",
  "message": "Invalid combination of AuditEvent filters, no combinations of ResourceSid, IpAddress, ActorSid, and ResourceType are supported.",
  "code": 400
}
一度に使用するフィルタープロパティーは 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
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var MonitorClient = require('twilio').MonitorClient;
var client = new MonitorClient(accountSid, authToken);

client.events('AE21f24380625e4aa4abec76e39b14458d').get(function(error, event) {
    process.stdout.write(event.eventType);
});
// Download the Node helper library from twilio.com/docs/node/install
// These are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

const client = require('twilio')(accountSid, authToken);

client.monitor.v1
  .events('AE21f24380625e4aa4abec76e39b14458d')
  .fetch()
  .then((data) => console.log(event.description));
// 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
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Monitor.V1;

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

        TwilioClient.Init(accountSid, authToken);

        var e = EventResource.Fetch(eventSid);

        Console.WriteLine(e.Description);
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

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

echo $event->description;
# 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)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

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

puts @event.description
// 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 Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

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

event = client.monitor.events("AE21f24380625e4aa4abec76e39b14458d").fetch()
print(event.description)
// 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/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

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

    Event event = Event.fetcher("AE21f24380625e4aa4abec76e39b14458d").fetch();

    System.out.println(event.getDescription());
  }
}
$ curl -XGET https://monitor.twilio.com/v1/Events/AE21f24380625e4aa4abec76e39b14458d \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "links": {
    "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN4aa51b930717ea83c91971b86d99018f",
    "actor": null
  },
  "event_data": {
    "resource_properties": {
      "voice_fallback_url": {
        "previous": null,
        "updated": ""
      },
      "voice_url": {
        "previous": "http://www.example.com",
        "updated": "http://www.example.com/hello-joey"
      }
    }
  },
  "source_ip_address": "73.189.144.70",
  "source": "web",
  "url": "https://monitor.twilio.com/v1/Events/AE21f24380625e4aa4abec76e39b14458d",
  "sid": "AE21f24380625e4aa4abec76e39b14458d",
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "actor_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
  "actor_type": "user",
  "description": null,
  "event_date": "2015-04-29T02:55:15Z",
  "event_type": "phone-number.updated",
  "resource_sid": "PN4aa51b930717ea83c91971b86d99018f",
  "resource_type": "phone-number"
}
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 Node helper library from twilio.com/docs/node/install
// These are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

const client = require('twilio')(accountSid, authToken);

client.monitor.v1.events
  .list({
    startDate: '2015-03-01T00:00:00Z',
    endDate: '2015-04-01T00:00:00Z',
  })
  .then(response => console.log(response));
// 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
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Monitor.V1;

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

        TwilioClient.Init(accountSid, authToken);

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

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$events = $client->monitor->events->read(
    array(
        'startDate' => '2015-03-01T00:00:00Z',
        'endDate' => '2015-04-01T00:00:00Z'
    )
);

foreach ($events as $event) {
    echo $event->description;
}
# 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)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@params = {
  start_date: Time.new('2015-03-01T00:00:00Z'),
  end_date: Time.new('2015-04-01T00:00:00Z')
}

@client.monitor.v1.events.list(@params).each do |e|
  puts e.description
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 Python helper library from twilio.com/docs/python/install
from datetime import datetime

import pytz
from twilio.rest import Client

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

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

for e in events:
    print(e.description)
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.LocalDate;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.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) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Event> events = Event.reader()
        .setStartDate(LocalDate.parse("2015-03-01"))
        .setEndDate(LocalDate.parse("2015-04-01"))
        .read();

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
curl -XGET "https://monitor.twilio.com/v1/Events?StartDate=2015-03-01T00:00:00Z&EndDate=2015-04-01T00:00:00Z" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "events": [
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "falkland_islands": {
            "previous": "disabled",
            "updated": "enabled"
          }
        }
      },
      "source_ip_address": null,
      "source": "twilio",
      "url": "https://monitor.twilio.com/v1/Events/AEc997b108285f476abdfe93aff97e0175",
      "sid": "AEc997b108285f476abdfe93aff97e0175",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": null,
      "actor_type": null,
      "description": null,
      "event_date": "2015-03-13T22:17:27Z",
      "event_type": "sms-geographic-permissions.updated",
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "sms-geographic-permissions"
    },
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "south_sudan": {
            "previous": "disabled",
            "updated": "enabled"
          }
        }
      },
      "source_ip_address": null,
      "source": "twilio",
      "url": "https://monitor.twilio.com/v1/Events/AE824a2c66ff5940398d561b2c875cec80",
      "sid": "AE824a2c66ff5940398d561b2c875cec80",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": null,
      "actor_type": null,
      "description": null,
      "event_date": "2015-03-09T23:42:46Z",
      "event_type": "sms-geographic-permissions.updated",
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "sms-geographic-permissions"
    },
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "south_sudan": {
            "previous": "disabled",
            "updated": "enabled"
          }
        }
      },
      "source_ip_address": null,
      "source": "twilio",
      "url": "https://monitor.twilio.com/v1/Events/AEea2520d7439e4ed9aa2b3ddd532e04d3",
      "sid": "AEea2520d7439e4ed9aa2b3ddd532e04d3",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": null,
      "actor_type": null,
      "description": null,
      "event_date": "2015-03-09T22:41:34Z",
      "event_type": "sms-geographic-permissions.updated",
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "sms-geographic-permissions"
    },
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "south_sudan": {
            "previous": "disabled",
            "updated": "enabled"
          }
        }
      },
      "source_ip_address": null,
      "source": "twilio",
      "url": "https://monitor.twilio.com/v1/Events/AEaf5242e4f10242a299649cc1c1df1849",
      "sid": "AEaf5242e4f10242a299649cc1c1df1849",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": null,
      "actor_type": null,
      "description": null,
      "event_date": "2015-03-09T21:25:15Z",
      "event_type": "sms-geographic-permissions.updated",
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "sms-geographic-permissions"
    },
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "south_sudan": {
            "previous": "disabled",
            "updated": "enabled"
          }
        }
      },
      "source_ip_address": null,
      "source": "twilio",
      "url": "https://monitor.twilio.com/v1/Events/AE661752392a6e4bd5b8980471ab0b12aa",
      "sid": "AE661752392a6e4bd5b8980471ab0b12aa",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": null,
      "actor_type": null,
      "description": null,
      "event_date": "2015-03-09T20:38:20Z",
      "event_type": "sms-geographic-permissions.updated",
      "resource_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "resource_type": "sms-geographic-permissions"
    }
  ],
  "meta": {
    "key": "events",
    "next_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?StartDate=2015-03-01T00%3A00%3A00Z&EndDate=2015-04-01T00%3A00%3A00Z&PageSize=50&Page=0",
    "previous_page_url": null,
    "first_page_url": "https://monitor.twilio.com/v1/Events?StartDate=2015-03-01T00%3A00%3A00Z&EndDate=2015-04-01T00%3A00%3A00Z&PageSize=50&Page=0",
    "page_size": 50,
    "page": 0
  }
}
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
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var MonitorClient = require('twilio').MonitorClient;
var client = new MonitorClient(accountSid, authToken);

var params = {
    resourceSid: 'PN4aa51b930717ea83c91971b86d99018f'
};
client.events.list(params, function(error, events) {
    for (var e in events) {
        process.stdout.write(e);
    }
});
// Download the Node helper library from twilio.com/docs/node/install
// These are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

const client = require('twilio')(accountSid, authToken);

client.monitor.v1.events
  .list({
    resourceSid: 'PN4aa51b930717ea83c91971b86d99018f'
  })
  .then((response) => console.log(response));
// 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
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Monitor.V1;

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

        TwilioClient.Init(accountSid, authToken);

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

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$events = $client->monitor->events->read(
    array('resourceSid' => 'PN4aa51b930717ea83c91971b86d99018f')
);

foreach ($events as $event) {
    echo $event->description;
}
# 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)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@params = {
  resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
}

@client.monitor.v1.events.list(@params).each do |e|
  puts e.description
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 Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

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

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

for e in events:
    print(e.description)
// 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/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

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

    ResourceSet<Event> events = Event.reader()
        .setResourceSid("PN4aa51b930717ea83c91971b86d99018f")
        .read();

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
$ curl -XGET https://monitor.twilio.com/v1/Events?ResourceSid=PN4aa51b930717ea83c91971b86d99018f \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "events": [
    {
      "links": {
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN67652f4755e8c3a0bdf02a922949b888",
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "event_data": null,
      "source_ip_address": "173.227.7.2",
      "source": "api",
      "url": "https://monitor.twilio.com/v1/Events/AE0e0751c03ed6439ea61c30c653f99680",
      "sid": "AE0e0751c03ed6439ea61c30c653f99680",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_date": "2015-04-30T19:50:16Z",
      "event_type": "phone-number.deleted",
      "resource_sid": "PN67652f4755e8c3a0bdf02a922949b888",
      "resource_type": "phone-number"
    },
    {
      "links": {
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN67652f4755e8c3a0bdf02a922949b888",
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "event_data": {
        "resource_properties": {
          "voice_url": {
            "previous": null,
            "updated": "http://www.example.com"
          }
        }
      },
      "source_ip_address": "73.189.144.70",
      "source": "api",
      "url": "https://monitor.twilio.com/v1/Events/AEb3377b7f3144406ab9b804cb8ef79ddd",
      "sid": "AEb3377b7f3144406ab9b804cb8ef79ddd",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_date": "2015-04-19T22:21:04Z",
      "event_type": "phone-number.updated",
      "resource_sid": "PN67652f4755e8c3a0bdf02a922949b888",
      "resource_type": "phone-number"
    },
    {
      "links": {
        "resource": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN67652f4755e8c3a0bdf02a922949b888",
        "actor": "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      },
      "event_data": {
        "resource_properties": {
          "status_callback": {
            "updated": ""
          },
          "status_callback_method": {
            "updated": "POST"
          },
          "voice_fallback_method": {
            "updated": "POST"
          },
          "voice_application_sid": {
            "updated": ""
          },
          "friendly_name": {
            "updated": "(510) 500-9369"
          },
          "sms_fallback_url": {
            "updated": ""
          },
          "sms_application_sid": {
            "updated": ""
          },
          "sms_method": {
            "updated": "POST"
          },
          "voice_method": {
            "updated": "POST"
          },
          "sms_fallback_method": {
            "updated": "POST"
          },
          "sms_url": {
            "updated": ""
          }
        },
        "previous_properties": {}
      },
      "source_ip_address": "73.189.144.70",
      "source": "api",
      "url": "https://monitor.twilio.com/v1/Events/AE68bc35581b6c465b9c35a0187a9f78f1",
      "sid": "AE68bc35581b6c465b9c35a0187a9f78f1",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_type": "account",
      "description": null,
      "event_date": "2015-04-19T22:21:02Z",
      "event_type": "phone-number.created",
      "resource_sid": "PN67652f4755e8c3a0bdf02a922949b888",
      "resource_type": "phone-number"
    }
  ],
  "meta": {
    "key": "events",
    "next_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?ResourceSid=PN67652f4755e8c3a0bdf02a922949b888&PageSize=50&Page=0",
    "previous_page_url": null,
    "first_page_url": "https://monitor.twilio.com/v1/Events?ResourceSid=PN67652f4755e8c3a0bdf02a922949b888&PageSize=50&Page=0",
    "page_size": 50,
    "page": 0
  }
}
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
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var MonitorClient = require('twilio').MonitorClient;
var client = new MonitorClient(accountSid, authToken);

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

const client = require('twilio')(accountSid, authToken);

client.monitor.v1.events
  .list({
    sourceIpAddress: '104.14.155.29',
    startDate: '2015-04-25T00:00:00Z',
    endDate: '2015-04-25T23:59:59Z'
  })
  .then((response) => console.log(response));
// 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
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Monitor.V1;

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

        TwilioClient.Init(accountSid, authToken);

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

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$events = $client->monitor->events->read(
    array(
        'sourceIpAddress' => '104.14.155.29',
        'startDate' => '2015-04-25T00:00:00Z',
        'endDate' => '2015-04-25T23:59:59Z'
    )
);

foreach ($events as $event) {
    echo $event->description;
}
# 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)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@params = {
  source_ip_address: '104.14.155.29',
  start_date: Time.new('2015-04-25T00:00:00Z'),
  end_date: Time.new('2015-04-25T23:59:59Z')
}

@client.monitor.v1.events.list(@params).each do |e|
  puts e.description
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 Python helper library from twilio.com/docs/python/install
from datetime import datetime

import pytz
from twilio.rest import Client

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

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

for e in events:
    print(e.description)
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.LocalDate;

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.monitor.v1.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) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Event> events = Event.reader()
        .setSourceIpAddress("104.14.155.29")
        .setStartDate(LocalDate.parse("2015-04-25"))
        .setEndDate(LocalDate.parse("2015-04-25"))
        .read();

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
curl -XGET "https://monitor.twilio.com/v1/Events?SourceIpAddress=104.14.155.29&StartDate=2015-04-25T00:00:00Z&EndDate=2015-04-25T23:59:59Z" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "events": [
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": {
        "resource_properties": {
          "friendly_name": {
            "previous": "tim+audittester1@twilio.com",
            "updated": "tim+audittester100@twilio.com"
          },
          "email_address": {
            "previous": "tim+audittester1@twilio.com",
            "updated": "tim+audittester100@twilio.com"
          }
        }
      },
      "source_ip_address": "12.130.117.96",
      "source": "web",
      "url": "https://monitor.twilio.com/v1/Events/AEd6373d5a8e9540ce9f697d2bae7a2c34",
      "sid": "AEd6373d5a8e9540ce9f697d2bae7a2c34",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
      "actor_type": "user",
      "description": null,
      "event_date": "2015-01-04T00:38:23Z",
      "event_type": "user.updated",
      "resource_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
      "resource_type": "user"
    },
    {
      "links": {
        "resource": null,
        "actor": null
      },
      "event_data": null,
      "source_ip_address": "12.130.117.96",
      "source": "web",
      "url": "https://monitor.twilio.com/v1/Events/AEf98c1e62319846a791c62f982cb045f6",
      "sid": "AEf98c1e62319846a791c62f982cb045f6",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "actor_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
      "actor_type": "user",
      "description": null,
      "event_date": "2015-01-04T00:38:22Z",
      "event_type": "user-session.created",
      "resource_sid": "USd0afd67cddff4ec7cb0022771a203cb1",
      "resource_type": "user-session"
    }
  ],
  "meta": {
    "key": "events",
    "next_page_url": null,
    "url": "https://monitor.twilio.com/v1/Events?SourceIpAddress=12.130.117.96&PageSize=50&Page=0",
    "previous_page_url": null,
    "first_page_url": "https://monitor.twilio.com/v1/Events?SourceIpAddress=12.130.117.96&PageSize=50&Page=0",
    "page_size": 50,
    "page": 0
  }
}
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
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var MonitorClient = require('twilio').MonitorClient;
var client = new MonitorClient(accountSid, authToken);

var params = {
    actorSid: 'USd0afd67cddff4ec7cb0022771a203cb1',
    resourceSid: 'PN4aa51b930717ea83c91971b86d99018f'
};
client.events.list(params, function(error, events) {
    for (var e in events) {
        process.stdout.write(e);
    }
});
// Download the Node helper library from twilio.com/docs/node/install
// These are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

const client = require('twilio')(accountSid, authToken);

client.monitor.v1.events.list()
  .then((response) => console.log(response));
// 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
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Monitor.V1;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string actorSid = "USd0afd67cddff4ec7cb0022771a203cb1";
        const string resourceSid = "PN4aa51b930717ea83c91971b86d99018f";

        TwilioClient.Init(accountSid, authToken);

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

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$events = $client->monitor->events->read(
    array(
        'actorSid' => 'USd0afd67cddff4ec7cb0022771a203cb1',
        'resourceSid' => 'PN4aa51b930717ea83c91971b86d99018f'
    )
);

foreach ($events as $event) {
    echo $event->description;
}
# 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)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@params = {
  actor_sid: 'USd0afd67cddff4ec7cb0022771a203cb1',
  resource_sid: 'PN4aa51b930717ea83c91971b86d99018f'
}

@client.monitor.v1.events.list(@params).each do |e|
  puts e.description
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 Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

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

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

for e in events:
    print(e.description)
// 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/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

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

    ResourceSet<Event> events = Event.reader()
        .setActorSid("USd0afd67cddff4ec7cb0022771a203cb1")
        .setResourceSid("PN4aa51b930717ea83c91971b86d99018f")
        .read();

    for (Event e : events) {
      System.out.println(e.getDescription());
    }
  }
}
curl -XGET "https://monitor.twilio.com/v1/Events?ActorSid=USd0afd67cddff4ec7cb0022771a203cb1&ResourceSid=PN4aa51b930717ea83c91971b86d99018f" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "status": 400,
  "more_info": "https://www.twilio.com/docs/errors/400",
  "message": "Invalid combination of AuditEvent filters, no combinations of ResourceSid, IpAddress, ActorSid, and ResourceType are supported.",
  "code": 400
}