# 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

```json
{"type":"object","refName":"events.v1.sink.sink_test","modelName":"events_v1_sink_sink_test","properties":{"result":{"type":"string","nullable":true,"description":"Feedback indicating whether the test event was generated."}}}
```

## Create a SinkTest resource

`POST https://events.twilio.com/v1/Sinks/{Sid}/Test`

Initiates a test event on a Sink.

### Path parameters

```json
[{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies the Sink to be Tested.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^DG[0-9a-fA-F]{32}$"},"required":true}]
```

Create Sink Test

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createSinkTest() {
  const sinkTest = await client.events.v1
    .sinks("DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .sinkTest.create();

  console.log(sinkTest.result);
}

createSinkTest();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

sink_test = client.events.v1.sinks(
    "DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
).sink_test.create()

print(sink_test.result)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Events.V1.Sink;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var sinkTest =
            await SinkTestResource.CreateAsync(pathSid: "DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(sinkTest.Result);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.events.v1.sink.SinkTest;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        SinkTest sinkTest = SinkTest.creator("DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").create();

        System.out.println(sinkTest.getResult());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.EventsV1.CreateSinkTest("DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Result != nil {
			fmt.Println(*resp.Result)
		} else {
			fmt.Println(resp.Result)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$sink_test = $twilio->events->v1
    ->sinks("DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->sinkTest->create();

print $sink_test->result;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

sink_test = @client
            .events
            .v1
            .sinks('DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
            .sink_test
            .create

puts sink_test.result
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:events:v1:sinks:test:create \
   --sid DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X POST "https://events.twilio.com/v1/Sinks/DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Test" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "result": "submitted"
}
```
