Skip to content

ContactControllerApi

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

Method HTTP request Description
createContact POST /contacts Create a contact
deleteContact DELETE /contacts/{contactId} Delete contact
getAllContacts GET /contacts/paginated Get all contacts
getContact GET /contacts/{contactId} Get contact
getContactVCard GET /contacts/{contactId}/download Get contact vCard vcf file
getContacts GET /contacts Get all contacts

Create a contact

Example

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

val apiClient = ApiClient()
val webService = apiClient.createWebservice(ContactControllerApi::class.java)
val createContactOptions : CreateContactOptions =  // CreateContactOptions | 

val result : ContactDto = webService.createContact(createContactOptions)

Parameters

Name Type Description Notes
createContactOptions CreateContactOptions

Return type

ContactDto

Authorization

HTTP request headers

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

Delete contact

Example

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

val apiClient = ApiClient()
val webService = apiClient.createWebservice(ContactControllerApi::class.java)
val contactId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | 

webService.deleteContact(contactId)

Parameters

Name Type Description Notes
contactId java.util.UUID

Return type

null (empty response body)

Authorization

HTTP request headers

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

Get all contacts

Example

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

val apiClient = ApiClient()
val webService = apiClient.createWebservice(ContactControllerApi::class.java)
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
val since : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter by created at after the given timestamp
val before : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter by created at before the given timestamp

val result : PageContactProjection = webService.getAllContacts(page, size, sort, since, before)

Parameters

Name Type Description Notes
page kotlin.Int Optional page in list pagination [optional] [default to 0]
size kotlin.Int Optional page size in list pagination [optional] [default to 20]
sort kotlin.String Optional createdAt sort direction ASC or DESC [optional] [default to ASC] [enum: ASC, DESC]
since java.time.OffsetDateTime Filter by created at after the given timestamp [optional]
before java.time.OffsetDateTime Filter by created at before the given timestamp [optional]

Return type

PageContactProjection

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

Get contact

Example

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

val apiClient = ApiClient()
val webService = apiClient.createWebservice(ContactControllerApi::class.java)
val contactId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | 

val result : ContactDto = webService.getContact(contactId)

Parameters

Name Type Description Notes
contactId java.util.UUID

Return type

ContactDto

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

Get contact vCard vcf file

Example

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

val apiClient = ApiClient()
val webService = apiClient.createWebservice(ContactControllerApi::class.java)
val contactId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | 

val result : kotlin.collections.List<kotlin.ByteArray> = webService.getContactVCard(contactId)

Parameters

Name Type Description Notes
contactId java.util.UUID

Return type

kotlin.collections.List

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

Get all contacts

Example

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

val apiClient = ApiClient()
val webService = apiClient.createWebservice(ContactControllerApi::class.java)

val result : kotlin.collections.List<ContactProjection> = webService.getContacts()

Parameters

This endpoint does not need any parameter.

Return type

kotlin.collections.List

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: /