WebhookControllerApi

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

MethodHTTP requestDescription
createWebhookPOST /inboxes/{inboxId}/webhooksAttach a WebHook URL to an inbox
deleteWebhookDELETE /inboxes/{inboxId}/webhooks/{webhookId}Delete and disable a Webhook for an Inbox
getAllWebhookResultsGET /webhooks/resultsGet results for all webhooks
getAllWebhooksGET /webhooks/paginatedList Webhooks Paginated
getInboxWebhooksPaginatedGET /inboxes/{inboxId}/webhooks/paginatedGet paginated webhooks for an Inbox
getJsonSchemaForWebhookPayloadPOST /webhooks/{webhookId}/schemaGet JSON Schema definition for webhook payload
getTestWebhookPayloadGET /webhooks/testGet test webhook payload example. Response content depends on eventName passed. Uses EMAIL_RECEIVED as default.
getTestWebhookPayloadEmailOpenedGET /webhooks/test/email-opened-payloadGet webhook test payload for email opened event
getTestWebhookPayloadEmailReadGET /webhooks/test/email-read-payloadGet webhook test payload for email opened event
getTestWebhookPayloadForWebhookPOST /webhooks/{webhookId}/exampleGet example payload for webhook
getTestWebhookPayloadNewAttachmentGET /webhooks/test/new-attachment-payloadGet webhook test payload for new attachment event
getTestWebhookPayloadNewContactGET /webhooks/test/new-contact-payloadGet webhook test payload for new contact event
getTestWebhookPayloadNewEmailGET /webhooks/test/new-email-payloadGet webhook test payload for new email event
getWebhookGET /webhooks/{webhookId}Get a webhook for an Inbox
getWebhookResultGET /webhooks/results/{webhookResultId}Get a webhook result for a webhook
getWebhookResultsGET /webhooks/{webhookId}/resultsGet a webhook results for a webhook
getWebhooksGET /inboxes/{inboxId}/webhooksGet all webhooks for an Inbox
redriveWebhookResultPOST /webhooks/results/{webhookResultId}/redriveGet a webhook result and try to resend the original webhook payload
sendTestDataPOST /webhooks/{webhookId}/testSend 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

NameTypeDescriptionNotes
inboxIdUUIDinboxId
webhookOptionsCreateWebhookOptionswebhookOptions

Return type

WebhookDto

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
201Created-
401Unauthorized-
403Forbidden-
404Not 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

NameTypeDescriptionNotes
inboxIdUUIDinboxId
webhookIdUUIDwebhookId

Return type

null (empty response body)

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
204No Content-
401Unauthorized-
403Forbidden-

getAllWebhookResults

PageWebhookResult getAllWebhookResults(before, page, searchFilter, since, size, sort)

Get results for all webhooks

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);
    OffsetDateTime before = new OffsetDateTime(); // OffsetDateTime | Filter by created at before the given timestamp
    Integer page = 0; // Integer | Optional page  in list pagination
    String searchFilter = "searchFilter_example"; // String | Optional search filter
    OffsetDateTime since = new OffsetDateTime(); // OffsetDateTime | Filter by created at after the given timestamp
    Integer size = 20; // Integer | Optional page size in list pagination
    String sort = "ASC"; // String | Optional createdAt sort direction ASC or DESC
    try {
      PageWebhookResult result = apiInstance.getAllWebhookResults(before, page, searchFilter, since, size, sort);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getAllWebhookResults");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
beforeOffsetDateTimeFilter by created at before the given timestamp[optional]
pageIntegerOptional page in list pagination[optional] [default to 0]
searchFilterStringOptional search filter[optional]
sinceOffsetDateTimeFilter by created at after the given timestamp[optional]
sizeIntegerOptional page size in list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to ASC] [enum: ASC, DESC]

Return type

PageWebhookResult

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getAllWebhooks

PageWebhookProjection getAllWebhooks(before, page, searchFilter, since, size, sort)

List Webhooks Paginated

List webhooks in paginated form. Allows for page , 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);
    OffsetDateTime before = new OffsetDateTime(); // OffsetDateTime | Filter by created at before the given timestamp
    Integer page = 0; // Integer | Optional page  in list pagination
    String searchFilter = "searchFilter_example"; // String | Optional search filter
    OffsetDateTime since = new OffsetDateTime(); // OffsetDateTime | Filter by created at after the given timestamp
    Integer size = 20; // Integer | Optional page size for paginated result list.
    String sort = "DESC"; // String | Optional createdAt sort direction ASC or DESC
    try {
      PageWebhookProjection result = apiInstance.getAllWebhooks(before, page, searchFilter, since, 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

NameTypeDescriptionNotes
beforeOffsetDateTimeFilter by created at before the given timestamp[optional]
pageIntegerOptional page in list pagination[optional] [default to 0]
searchFilterStringOptional search filter[optional]
sinceOffsetDateTimeFilter by created at after the given timestamp[optional]
sizeIntegerOptional page size for paginated result list.[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to DESC] [enum: ASC, DESC]

Return type

PageWebhookProjection

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getInboxWebhooksPaginated

PageWebhookProjection getInboxWebhooksPaginated(inboxId, before, page, searchFilter, since, size, sort)

Get paginated 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
    OffsetDateTime before = new OffsetDateTime(); // OffsetDateTime | Filter by created at before the given timestamp
    Integer page = 0; // Integer | Optional page  in list pagination
    String searchFilter = "searchFilter_example"; // String | Optional search filter
    OffsetDateTime since = new OffsetDateTime(); // OffsetDateTime | Filter by created at after the given timestamp
    Integer size = 20; // Integer | Optional page size in list pagination
    String sort = "ASC"; // String | Optional createdAt sort direction ASC or DESC
    try {
      PageWebhookProjection result = apiInstance.getInboxWebhooksPaginated(inboxId, before, page, searchFilter, since, size, sort);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getInboxWebhooksPaginated");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
inboxIdUUIDinboxId
beforeOffsetDateTimeFilter by created at before the given timestamp[optional]
pageIntegerOptional page in list pagination[optional] [default to 0]
searchFilterStringOptional search filter[optional]
sinceOffsetDateTimeFilter by created at after the given timestamp[optional]
sizeIntegerOptional page size in list pagination[optional] [default to 20]
sortStringOptional 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 codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getJsonSchemaForWebhookPayload

JSONSchemaDto getJsonSchemaForWebhookPayload(webhookId)

Get JSON Schema definition for webhook payload

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 {
      JSONSchemaDto result = apiInstance.getJsonSchemaForWebhookPayload(webhookId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getJsonSchemaForWebhookPayload");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
webhookIdUUIDwebhookId

Return type

JSONSchemaDto

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
201Created-
401Unauthorized-
403Forbidden-
404Not Found-

getTestWebhookPayload

AbstractWebhookPayload getTestWebhookPayload(eventName)

Get test webhook payload example. Response content depends on eventName passed. Uses EMAIL_RECEIVED as default.

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);
    String eventName = "eventName_example"; // String | eventName
    try {
      AbstractWebhookPayload result = apiInstance.getTestWebhookPayload(eventName);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getTestWebhookPayload");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
eventNameStringeventName[optional] [enum: EMAIL_RECEIVED, NEW_EMAIL, NEW_CONTACT, NEW_ATTACHMENT, EMAIL_OPENED, EMAIL_READ]

Return type

AbstractWebhookPayload

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getTestWebhookPayloadEmailOpened

WebhookEmailOpenedPayload getTestWebhookPayloadEmailOpened()

Get webhook test payload for email opened event

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);
    try {
      WebhookEmailOpenedPayload result = apiInstance.getTestWebhookPayloadEmailOpened();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getTestWebhookPayloadEmailOpened");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookEmailOpenedPayload

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getTestWebhookPayloadEmailRead

WebhookEmailReadPayload getTestWebhookPayloadEmailRead()

Get webhook test payload for email opened event

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);
    try {
      WebhookEmailReadPayload result = apiInstance.getTestWebhookPayloadEmailRead();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getTestWebhookPayloadEmailRead");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookEmailReadPayload

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getTestWebhookPayloadForWebhook

AbstractWebhookPayload getTestWebhookPayloadForWebhook(webhookId)

Get example payload for webhook

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 {
      AbstractWebhookPayload result = apiInstance.getTestWebhookPayloadForWebhook(webhookId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getTestWebhookPayloadForWebhook");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
webhookIdUUIDwebhookId

Return type

AbstractWebhookPayload

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
201Created-
401Unauthorized-
403Forbidden-
404Not Found-

getTestWebhookPayloadNewAttachment

WebhookNewAttachmentPayload getTestWebhookPayloadNewAttachment()

Get webhook test payload for new attachment event

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);
    try {
      WebhookNewAttachmentPayload result = apiInstance.getTestWebhookPayloadNewAttachment();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getTestWebhookPayloadNewAttachment");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewAttachmentPayload

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getTestWebhookPayloadNewContact

WebhookNewContactPayload getTestWebhookPayloadNewContact()

Get webhook test payload for new contact event

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);
    try {
      WebhookNewContactPayload result = apiInstance.getTestWebhookPayloadNewContact();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getTestWebhookPayloadNewContact");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewContactPayload

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getTestWebhookPayloadNewEmail

WebhookNewEmailPayload getTestWebhookPayloadNewEmail()

Get webhook test payload for new email event

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);
    try {
      WebhookNewEmailPayload result = apiInstance.getTestWebhookPayloadNewEmail();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getTestWebhookPayloadNewEmail");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewEmailPayload

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not 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

NameTypeDescriptionNotes
webhookIdUUIDwebhookId

Return type

WebhookDto

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getWebhookResult

WebhookResultDto getWebhookResult(webhookResultId)

Get a webhook result for a webhook

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 webhookResultId = new UUID(); // UUID | Webhook Result ID
    try {
      WebhookResultDto result = apiInstance.getWebhookResult(webhookResultId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getWebhookResult");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
webhookResultIdUUIDWebhook Result ID

Return type

WebhookResultDto

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getWebhookResults

PageWebhookResult getWebhookResults(webhookId, before, page, searchFilter, since, size, sort)

Get a webhook results for a webhook

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 | ID of webhook to get results for
    OffsetDateTime before = new OffsetDateTime(); // OffsetDateTime | Filter by created at before the given timestamp
    Integer page = 0; // Integer | Optional page  in list pagination
    String searchFilter = "searchFilter_example"; // String | Optional search filter
    OffsetDateTime since = new OffsetDateTime(); // OffsetDateTime | Filter by created at after the given timestamp
    Integer size = 20; // Integer | Optional page size in list pagination
    String sort = "ASC"; // String | Optional createdAt sort direction ASC or DESC
    try {
      PageWebhookResult result = apiInstance.getWebhookResults(webhookId, before, page, searchFilter, since, size, sort);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#getWebhookResults");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
webhookIdUUIDID of webhook to get results for
beforeOffsetDateTimeFilter by created at before the given timestamp[optional]
pageIntegerOptional page in list pagination[optional] [default to 0]
searchFilterStringOptional search filter[optional]
sinceOffsetDateTimeFilter by created at after the given timestamp[optional]
sizeIntegerOptional page size in list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to ASC] [enum: ASC, DESC]

Return type

PageWebhookResult

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

getWebhooks

List 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<WebhookDto> 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

NameTypeDescriptionNotes
inboxIdUUIDinboxId

Return type

List

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

redriveWebhookResult

WebhookRedriveResult redriveWebhookResult(webhookResultId)

Get a webhook result and try to resend the original webhook payload

Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method.

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 webhookResultId = new UUID(); // UUID | Webhook Result ID
    try {
      WebhookRedriveResult result = apiInstance.redriveWebhookResult(webhookResultId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WebhookControllerApi#redriveWebhookResult");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
webhookResultIdUUIDWebhook Result ID

Return type

WebhookRedriveResult

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
401Unauthorized-
403Forbidden-
404Not 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

NameTypeDescriptionNotes
webhookIdUUIDwebhookId

Return type

WebhookTestResult

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
201Created-
401Unauthorized-
403Forbidden-
404Not Found-