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 programmatically ensure that your Sink is ready to receive events.


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.

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

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function createSinkTest() {
_18
const sinkTest = await client.events.v1
_18
.sinks("DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.sinkTest.create();
_18
_18
console.log(sinkTest.result);
_18
}
_18
_18
createSinkTest();

Output

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


Rate this page: