Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Sink Test Resource


The Sink Test Resource creates a test event. This test gives you a simple way to publish to yourself and programatically ensure that your Sink is ready to receive events.

To create an active Kinesis Sink, you'll need to complete the following steps. Webhook Sinks are active by default but you can choose to validate them if you would like to. The steps in bold are handled using the Sink Test Resource:

  1. Create a new Sink Resource . The status of Kinesis Sinks will be initialized by default. The status of Webhook Sinks will be active by default.
  2. Create a Sink Test resource using your new Sink. This will publish a test event to your Sink, confirming that you've set up your Sink properly.
  3. Check your Sink to see if the Test event was successfully published.
  4. If the test was successful, retrieve the test_id and create a Sink Validate Resource . This will let Twilio know that you successfully configured the Sink, and will toggle the Sink state to active

SinkTest Properties

sinktest-properties page anchor
Property nameTypePIIDescription
resultstring
Not PII

Feedback indicating whether the test event was generated.


Create a SinkTest resource

create-a-sinktest-resource page anchor
POST https://events.twilio.com/v1/Sinks/{Sid}/Test

Initiates a test event on a Sink. Once a Test Event has been initiated, the Sink status property will be set to Validating.

If a Test event is initiated twice then the most recent test event will take precedence and the first Test event will no longer be valid.

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
SidSID<DG>required

A 34 character string that uniquely identifies the Sink to be Tested.

Pattern: ^DG[0-9a-fA-F]{32}$Min length: 34Max length: 34

Create Sink Test

create-sink-test page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.events.v1.sinks('DGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.sinkTest
_11
.create()
_11
.then(sink_test => console.log(sink_test.result));

Output

_10
{
_10
"result": "submitted"
_10
}


Rate this page: