# WebhookControllerApi

All URIs are relative to https://api.mailslurp.com

Method HTTP request Description
createWebhook POST /inboxes/{inboxId}/webhooks Attach a WebHook URL to an inbox
deleteWebhook DELETE /inboxes/{inboxId}/webhooks/{webhookId} Delete and disable a Webhook for an Inbox
getAllWebhooks GET /webhooks/paginated List Webhooks Paginated
getWebhook GET /webhooks/{webhookId} Get a webhook for an Inbox
getWebhooks GET /inboxes/{inboxId}/webhooks Get all Webhooks for an Inbox
sendTestData POST /webhooks/{webhookId}/test Send webhook test data

# createWebhook

WebhookDto createWebhook(inboxId, webhookOptions)

Attach a WebHook URL to an inbox

Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.

# Example

// Import classes:
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.auth.*;
import com.mailslurp.clients.models.*;
import com.mailslurp.apis.WebhookControllerApi;
public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.mailslurp.com");
    // Configure API key authorization: API_KEY
    ApiKeyAuth API_KEY = (ApiKeyAuth) defaultClient.getAuthentication("API_KEY");
    API_KEY.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //API_KEY.setApiKeyPrefix("Token");
    WebhookControllerApi apiInstance = new WebhookControllerApi(defaultClient);
    UUID inboxId = new UUID(); // UUID | inboxId
    CreateWebhookOptions webhookOptions = new CreateWebhookOptions(); // CreateWebhookOptions | webhookOptions
    try {
      WebhookDto result = apiInstance.createWebhook(inboxId, webhookOptions);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#createWebhook");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

# Parameters

Name Type Description Notes
inboxId UUID inboxId
webhookOptions CreateWebhookOptions webhookOptions

# Return type

WebhookDto

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

# HTTP response details

Status code Description Response headers
201 Created -
401 Unauthorized -
403 Forbidden -
404 Not Found -

# deleteWebhook

deleteWebhook(inboxId, webhookId)

Delete and disable a Webhook for an Inbox

# Example

// Import classes:
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.auth.*;
import com.mailslurp.clients.models.*;
import com.mailslurp.apis.WebhookControllerApi;
public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.mailslurp.com");
    // Configure API key authorization: API_KEY
    ApiKeyAuth API_KEY = (ApiKeyAuth) defaultClient.getAuthentication("API_KEY");
    API_KEY.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //API_KEY.setApiKeyPrefix("Token");
    WebhookControllerApi apiInstance = new WebhookControllerApi(defaultClient);
    UUID inboxId = new UUID(); // UUID | inboxId
    UUID webhookId = new UUID(); // UUID | webhookId
    try {
      apiInstance.deleteWebhook(inboxId, webhookId);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#deleteWebhook");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

# Parameters

Name Type Description Notes
inboxId UUID inboxId
webhookId UUID webhookId

# Return type

null (empty response body)

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

# HTTP response details

Status code Description Response headers
204 No Content -
401 Unauthorized -
403 Forbidden -

# getAllWebhooks

PageWebhookProjection getAllWebhooks(page, size, sort)

List Webhooks Paginated

List webhooks in paginated form. Allows for page index, page size, and sort direction.

# Example

// Import classes:
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.auth.*;
import com.mailslurp.clients.models.*;
import com.mailslurp.apis.WebhookControllerApi;
public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.mailslurp.com");
    // Configure API key authorization: API_KEY
    ApiKeyAuth API_KEY = (ApiKeyAuth) defaultClient.getAuthentication("API_KEY");
    API_KEY.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //API_KEY.setApiKeyPrefix("Token");
    WebhookControllerApi apiInstance = new WebhookControllerApi(defaultClient);
    Integer page = 0; // Integer | Optional page index in inbox list pagination
    Integer size = 20; // Integer | Optional page size in inbox list pagination
    String sort = "ASC"; // String | Optional createdAt sort direction ASC or DESC
    try {
      PageWebhookProjection result = apiInstance.getAllWebhooks(page, size, sort);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getAllWebhooks");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

# Parameters

Name Type Description Notes
page Integer Optional page index in inbox list pagination [optional] [default to 0]
size Integer Optional page size in inbox list pagination [optional] [default to 20]
sort String Optional createdAt sort direction ASC or DESC [optional] [default to ASC] [enum: ASC, DESC]

# Return type

PageWebhookProjection

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

# HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -

# getWebhook

WebhookDto getWebhook(webhookId)

Get a webhook for an Inbox

# Example

// Import classes:
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.auth.*;
import com.mailslurp.clients.models.*;
import com.mailslurp.apis.WebhookControllerApi;
public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.mailslurp.com");
    // Configure API key authorization: API_KEY
    ApiKeyAuth API_KEY = (ApiKeyAuth) defaultClient.getAuthentication("API_KEY");
    API_KEY.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //API_KEY.setApiKeyPrefix("Token");
    WebhookControllerApi apiInstance = new WebhookControllerApi(defaultClient);
    UUID webhookId = new UUID(); // UUID | webhookId
    try {
      WebhookDto result = apiInstance.getWebhook(webhookId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getWebhook");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

# Parameters

Name Type Description Notes
webhookId UUID webhookId

# Return type

WebhookDto

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

# HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -

# getWebhooks

List<WebhookDto> getWebhooks(inboxId)

Get all Webhooks for an Inbox

# Example

// Import classes:
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.auth.*;
import com.mailslurp.clients.models.*;
import com.mailslurp.apis.WebhookControllerApi;
public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.mailslurp.com");
    // Configure API key authorization: API_KEY
    ApiKeyAuth API_KEY = (ApiKeyAuth) defaultClient.getAuthentication("API_KEY");
    API_KEY.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //API_KEY.setApiKeyPrefix("Token");
    WebhookControllerApi apiInstance = new WebhookControllerApi(defaultClient);
    UUID inboxId = new UUID(); // UUID | inboxId
    try {
      List&lt;WebhookDto&gt; result = apiInstance.getWebhooks(inboxId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getWebhooks");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

# Parameters

Name Type Description Notes
inboxId UUID inboxId

# Return type

List<WebhookDto>

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

# HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -

# sendTestData

WebhookTestResult sendTestData(webhookId)

Send webhook test data

# Example

// Import classes:
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.auth.*;
import com.mailslurp.clients.models.*;
import com.mailslurp.apis.WebhookControllerApi;
public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.mailslurp.com");
    // Configure API key authorization: API_KEY
    ApiKeyAuth API_KEY = (ApiKeyAuth) defaultClient.getAuthentication("API_KEY");
    API_KEY.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //API_KEY.setApiKeyPrefix("Token");
    WebhookControllerApi apiInstance = new WebhookControllerApi(defaultClient);
    UUID webhookId = new UUID(); // UUID | webhookId
    try {
      WebhookTestResult result = apiInstance.sendTestData(webhookId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#sendTestData");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

# Parameters

Name Type Description Notes
webhookId UUID webhookId

# Return type

WebhookTestResult

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

# HTTP response details

Status code Description Response headers
201 Created -
401 Unauthorized -
403 Forbidden -
404 Not Found -