ContactControllerApi

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

MethodHTTP requestDescription
createContactPOST /contactsCreate a contact
deleteContactDELETE /contacts/{contactId}Delete contact
getAllContactsGET /contacts/paginatedGet all contacts
getContactGET /contacts/{contactId}Get contact
getContactVCardGET /contacts/{contactId}/downloadGet contact vCard vcf file
getContactsGET /contactsGet all contacts

createContact

ContactDto createContact(createContactOptions)

Create a contact

Example

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

val apiInstance = ContactControllerApi()
val createContactOptions : CreateContactOptions =  // CreateContactOptions | createContactOptions
try {
    val result : ContactDto = apiInstance.createContact(createContactOptions)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling ContactControllerApi#createContact")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling ContactControllerApi#createContact")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
createContactOptionsCreateContactOptionscreateContactOptions

Return type

ContactDto

Authorization

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

HTTP request headers

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

deleteContact

deleteContact(contactId)

Delete contact

Example

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

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

Parameters

NameTypeDescriptionNotes
contactIdjava.util.UUIDcontactId

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

getAllContacts

PageContactProjection getAllContacts(page, size, sort)

Get all contacts

Example

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

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

Parameters

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

Return type

PageContactProjection

Authorization

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

HTTP request headers

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

getContact

ContactDto getContact(contactId)

Get contact

Example

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

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

Parameters

NameTypeDescriptionNotes
contactIdjava.util.UUIDcontactId

Return type

ContactDto

Authorization

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

HTTP request headers

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

getContactVCard

kotlin.ByteArray getContactVCard(contactId)

Get contact vCard vcf file

Example

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

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

Parameters

NameTypeDescriptionNotes
contactIdjava.util.UUIDcontactId

Return type

kotlin.ByteArray

Authorization

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

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/octet-stream

getContacts

kotlin.collections.List getContacts()

Get all contacts

Example

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

val apiInstance = ContactControllerApi()
try {
    val result : kotlin.collections.List<ContactProjection> = apiInstance.getContacts()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling ContactControllerApi#getContacts")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling ContactControllerApi#getContacts")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

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