Skip to contentSkip to navigationSkip to topbar
On this page

Sink Test Resource


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


Test Properties

test-properties page anchor
Property nameTypeRequiredDescriptionChild properties
resultstringOptional
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 TestLink to code sample: Create Sink Test
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createSinkTest() {
11
const sinkTest = await client.events.v1
12
.sinks("DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.sinkTest.create();
14
15
console.log(sinkTest.result);
16
}
17
18
createSinkTest();

Output

1
{
2
"result": "submitted"
3
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.