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

Sink Validate Resource


The Sink Validate Resource is responsible for confirming that a Sink has been properly configured and is ready to be toggled to the active state.

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 Validate 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.

SinkValidate Properties

sinkvalidate-properties page anchor
Property nameTypePIIDescription
resultstring
Not PII

Feedback indicating whether the given Sink was validated.


Create a SinkValidate resource

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

Validates a Sink whose generated test ID matches the supplied test ID.

If the "test_id" does not match the "test_id" that was sent with the test event, the endpoint will return a 400 and the sink status does not change. If the "test_id" supplied is correct, then the Sink returns a 201 and the status of the Sink will be updated to active and the sink described in the configuration will begin to receive data.

Path parameters

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

A 34 character string that uniquely identifies the Sink being validated.

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

A 34 character string that uniquely identifies the test event for a Sink being validated.

Post Sink Validate

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

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
import twilio from "twilio";
_14
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = twilio(accountSid, authToken);
_14
_14
const sinkValidate = await client.events.v1
_14
.sinks("DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_14
.sinkValidate.create({ testId: "95001c1e-5b8e-45f5-830d-f9cbf1d16420" });
_14
_14
console.log(sinkValidate.result);

Output

_10
{
_10
"result": "valid"
_10
}


Rate this page: