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
getTestWebhookPayloadGET /webhooks/testGet test webhook payload example. Response content depends on eventName passed. Uses EMAIL_RECEIVED as default.
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
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.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
val inboxId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | inboxId
val webhookOptions : CreateWebhookOptions =  // CreateWebhookOptions | webhookOptions
try {
    val result : WebhookDto = apiInstance.createWebhook(inboxId, webhookOptions)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#createWebhook")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#createWebhook")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
inboxIdjava.util.UUIDinboxId
webhookOptionsCreateWebhookOptionswebhookOptions

Return type

WebhookDto

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

deleteWebhook

deleteWebhook(inboxId, webhookId)

Delete and disable a Webhook for an Inbox

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
val inboxId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | inboxId
val webhookId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | webhookId
try {
    apiInstance.deleteWebhook(inboxId, webhookId)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#deleteWebhook")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#deleteWebhook")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
inboxIdjava.util.UUIDinboxId
webhookIdjava.util.UUIDwebhookId

Return type

null (empty response body)

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

getAllWebhookResults

PageWebhookResult getAllWebhookResults(page, size, sort)

Get results for all webhooks

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
val page : kotlin.Int = 56 // kotlin.Int | Optional page  in list pagination
val size : kotlin.Int = 56 // kotlin.Int | Optional page size in list pagination
val sort : kotlin.String = sort_example // kotlin.String | Optional createdAt sort direction ASC or DESC
try {
    val result : PageWebhookResult = apiInstance.getAllWebhookResults(page, size, sort)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#getAllWebhookResults")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#getAllWebhookResults")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
pagekotlin.IntOptional page in list pagination[optional] [default to 0]
sizekotlin.IntOptional page size in list pagination[optional] [default to 20]
sortkotlin.StringOptional createdAt sort direction ASC or DESC[optional] [default to ASC] [enum: ASC, DESC]

Return type

PageWebhookResult

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

getAllWebhooks

PageWebhookProjection getAllWebhooks(page, size, sort)

List Webhooks Paginated

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

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
val page : kotlin.Int = 56 // kotlin.Int | Optional page  in list pagination
val size : kotlin.Int = 56 // kotlin.Int | Optional page size in list pagination
val sort : kotlin.String = sort_example // kotlin.String | Optional createdAt sort direction ASC or DESC
try {
    val result : PageWebhookProjection = apiInstance.getAllWebhooks(page, size, sort)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#getAllWebhooks")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#getAllWebhooks")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
pagekotlin.IntOptional page in list pagination[optional] [default to 0]
sizekotlin.IntOptional page size in list pagination[optional] [default to 20]
sortkotlin.StringOptional createdAt sort direction ASC or DESC[optional] [default to ASC] [enum: ASC, DESC]

Return type

PageWebhookProjection

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

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.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
val eventName : kotlin.String = eventName_example // kotlin.String | eventName
try {
    val result : AbstractWebhookPayload = apiInstance.getTestWebhookPayload(eventName)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#getTestWebhookPayload")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#getTestWebhookPayload")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
eventNamekotlin.StringeventName[optional] [enum: EMAIL_RECEIVED, NEW_EMAIL, NEW_CONTACT, NEW_ATTACHMENT]

Return type

AbstractWebhookPayload

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

getTestWebhookPayloadNewAttachment

WebhookNewAttachmentPayload getTestWebhookPayloadNewAttachment()

Get webhook test payload for new attachment event

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
try {
    val result : WebhookNewAttachmentPayload = apiInstance.getTestWebhookPayloadNewAttachment()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#getTestWebhookPayloadNewAttachment")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#getTestWebhookPayloadNewAttachment")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewAttachmentPayload

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

getTestWebhookPayloadNewContact

WebhookNewContactPayload getTestWebhookPayloadNewContact()

Get webhook test payload for new contact event

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
try {
    val result : WebhookNewContactPayload = apiInstance.getTestWebhookPayloadNewContact()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#getTestWebhookPayloadNewContact")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#getTestWebhookPayloadNewContact")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewContactPayload

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

getTestWebhookPayloadNewEmail

WebhookNewEmailPayload getTestWebhookPayloadNewEmail()

Get webhook test payload for new email event

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
try {
    val result : WebhookNewEmailPayload = apiInstance.getTestWebhookPayloadNewEmail()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#getTestWebhookPayloadNewEmail")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#getTestWebhookPayloadNewEmail")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewEmailPayload

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

getWebhook

WebhookDto getWebhook(webhookId)

Get a webhook for an Inbox

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
val webhookId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | webhookId
try {
    val result : WebhookDto = apiInstance.getWebhook(webhookId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#getWebhook")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#getWebhook")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
webhookIdjava.util.UUIDwebhookId

Return type

WebhookDto

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

getWebhookResult

WebhookResultEntity getWebhookResult(webhookResultId)

Get a webhook result for a webhook

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
val webhookResultId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | Webhook Result ID
try {
    val result : WebhookResultEntity = apiInstance.getWebhookResult(webhookResultId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#getWebhookResult")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#getWebhookResult")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
webhookResultIdjava.util.UUIDWebhook Result ID

Return type

WebhookResultEntity

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

getWebhookResults

PageWebhookResult getWebhookResults(webhookId, page, size, sort)

Get a webhook results for a webhook

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
val webhookId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | ID of webhook to get results for
val page : kotlin.Int = 56 // kotlin.Int | Optional page  in list pagination
val size : kotlin.Int = 56 // kotlin.Int | Optional page size in list pagination
val sort : kotlin.String = sort_example // kotlin.String | Optional createdAt sort direction ASC or DESC
try {
    val result : PageWebhookResult = apiInstance.getWebhookResults(webhookId, page, size, sort)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#getWebhookResults")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#getWebhookResults")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
webhookIdjava.util.UUIDID of webhook to get results for
pagekotlin.IntOptional page in list pagination[optional] [default to 0]
sizekotlin.IntOptional page size in list pagination[optional] [default to 20]
sortkotlin.StringOptional createdAt sort direction ASC or DESC[optional] [default to ASC] [enum: ASC, DESC]

Return type

PageWebhookResult

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

getWebhooks

kotlin.collections.List getWebhooks(inboxId)

Get all webhooks for an Inbox

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
val inboxId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | inboxId
try {
    val result : kotlin.collections.List<WebhookDto> = apiInstance.getWebhooks(inboxId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#getWebhooks")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#getWebhooks")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
inboxIdjava.util.UUIDinboxId

Return type

kotlin.collections.List

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

sendTestData

WebhookTestResult sendTestData(webhookId)

Send webhook test data

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WebhookControllerApi()
val webhookId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | webhookId
try {
    val result : WebhookTestResult = apiInstance.sendTestData(webhookId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhookControllerApi#sendTestData")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhookControllerApi#sendTestData")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
webhookIdjava.util.UUIDwebhookId

Return type

WebhookTestResult

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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