GroupControllerApi

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

MethodHTTP requestDescription
addContactsToGroupPUT /groups/{groupId}/contactsAdd contacts to a group
createGroupPOST /groupsCreate a group
deleteGroupDELETE /groups/{groupId}Delete group
getAllGroupsGET /groups/paginatedGet all Contact Groups in paginated format
getGroupGET /groups/{groupId}Get group
getGroupWithContactsGET /groups/{groupId}/contactsGet group and contacts belonging to it
getGroupWithContactsPaginatedGET /groups/{groupId}/contacts-paginatedGet group and paginated contacts belonging to it
getGroupsGET /groupsGet all groups
removeContactsFromGroupDELETE /groups/{groupId}/contactsRemove contacts from a group

addContactsToGroup

GroupContactsDto addContactsToGroup(groupId, updateGroupContactsOption)

Add contacts to a group

Example

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

val apiInstance = GroupControllerApi()
val groupId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | groupId
val updateGroupContactsOption : UpdateGroupContacts =  // UpdateGroupContacts | updateGroupContactsOption
try {
    val result : GroupContactsDto = apiInstance.addContactsToGroup(groupId, updateGroupContactsOption)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling GroupControllerApi#addContactsToGroup")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling GroupControllerApi#addContactsToGroup")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
groupIdjava.util.UUIDgroupId
updateGroupContactsOptionUpdateGroupContactsupdateGroupContactsOption

Return type

GroupContactsDto

Authorization

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

HTTP request headers

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

createGroup

GroupDto createGroup(createGroupOptions)

Create a group

Example

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

val apiInstance = GroupControllerApi()
val createGroupOptions : CreateGroupOptions =  // CreateGroupOptions | createGroupOptions
try {
    val result : GroupDto = apiInstance.createGroup(createGroupOptions)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling GroupControllerApi#createGroup")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling GroupControllerApi#createGroup")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
createGroupOptionsCreateGroupOptionscreateGroupOptions

Return type

GroupDto

Authorization

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

HTTP request headers

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

deleteGroup

deleteGroup(groupId)

Delete group

Example

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

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

Parameters

NameTypeDescriptionNotes
groupIdjava.util.UUIDgroupId

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

getAllGroups

PageGroupProjection getAllGroups(page, size, sort)

Get all Contact Groups in paginated format

Example

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

val apiInstance = GroupControllerApi()
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 : PageGroupProjection = apiInstance.getAllGroups(page, size, sort)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling GroupControllerApi#getAllGroups")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling GroupControllerApi#getAllGroups")
    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

PageGroupProjection

Authorization

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

HTTP request headers

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

getGroup

GroupDto getGroup(groupId)

Get group

Example

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

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

Parameters

NameTypeDescriptionNotes
groupIdjava.util.UUIDgroupId

Return type

GroupDto

Authorization

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

HTTP request headers

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

getGroupWithContacts

GroupContactsDto getGroupWithContacts(groupId)

Get group and contacts belonging to it

Example

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

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

Parameters

NameTypeDescriptionNotes
groupIdjava.util.UUIDgroupId

Return type

GroupContactsDto

Authorization

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

HTTP request headers

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

getGroupWithContactsPaginated

PageContactProjection getGroupWithContactsPaginated(groupId, page, size, sort)

Get group and paginated contacts belonging to it

Example

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

val apiInstance = GroupControllerApi()
val groupId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | groupId
val page : kotlin.Int = 56 // kotlin.Int | Optional page  in group contact pagination
val size : kotlin.Int = 56 // kotlin.Int | Optional page size in group contact pagination
val sort : kotlin.String = sort_example // kotlin.String | Optional createdAt sort direction ASC or DESC
try {
    val result : PageContactProjection = apiInstance.getGroupWithContactsPaginated(groupId, page, size, sort)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling GroupControllerApi#getGroupWithContactsPaginated")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling GroupControllerApi#getGroupWithContactsPaginated")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
groupIdjava.util.UUIDgroupId
pagekotlin.IntOptional page in group contact pagination[optional] [default to 0]
sizekotlin.IntOptional page size in group contact 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

getGroups

kotlin.collections.List getGroups()

Get all groups

Example

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

val apiInstance = GroupControllerApi()
try {
    val result : kotlin.collections.List<GroupProjection> = apiInstance.getGroups()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling GroupControllerApi#getGroups")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling GroupControllerApi#getGroups")
    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

removeContactsFromGroup

GroupContactsDto removeContactsFromGroup(groupId, updateGroupContactsOption)

Remove contacts from a group

Example

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

val apiInstance = GroupControllerApi()
val groupId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | groupId
val updateGroupContactsOption : UpdateGroupContacts =  // UpdateGroupContacts | updateGroupContactsOption
try {
    val result : GroupContactsDto = apiInstance.removeContactsFromGroup(groupId, updateGroupContactsOption)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling GroupControllerApi#removeContactsFromGroup")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling GroupControllerApi#removeContactsFromGroup")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
groupIdjava.util.UUIDgroupId
updateGroupContactsOptionUpdateGroupContactsupdateGroupContactsOption

Return type

GroupContactsDto

Authorization

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

HTTP request headers

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