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.
Property nameTypeRequiredPIIDescriptionChild properties
Feedback indicating whether the test event was generated.
POST https://events.twilio.com/v1/Sinks/{Sid}/Test
Initiates a test event on a Sink.
Property nameTypeRequiredPIIDescription
A 34 character string that uniquely identifies the Sink to be Tested.
Pattern:
^DG[0-9a-fA-F]{32}$Min length: 34Max length: 341// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createSinkTest() {14const sinkTest = await client.events.v115.sinks("DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")16.sinkTest.create();1718console.log(sinkTest.result);19}2021createSinkTest();
Response
1{2"result": "submitted"3}