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

    open class func addContactsToGroup( groupId: UUID,  updateGroupContactsOption: UpdateGroupContacts) -> Promise<GroupContactsDto>

Add contacts to a group

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let groupId = 987 // UUID | groupId
let updateGroupContactsOption = UpdateGroupContacts(contactIds: [123]) // UpdateGroupContacts | updateGroupContactsOption

// Add contacts to a group
GroupControllerAPI.addContactsToGroup(groupId: groupId, updateGroupContactsOption: updateGroupContactsOption).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
groupIdUUIDgroupId
updateGroupContactsOptionUpdateGroupContactsupdateGroupContactsOption

Return type

GroupContactsDto

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

createGroup

    open class func createGroup( createGroupOptions: CreateGroupOptions) -> Promise<GroupDto>

Create a group

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let createGroupOptions = CreateGroupOptions(name: "name_example", _description: "_description_example") // CreateGroupOptions | createGroupOptions

// Create a group
GroupControllerAPI.createGroup(createGroupOptions: createGroupOptions).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
createGroupOptionsCreateGroupOptionscreateGroupOptions

Return type

GroupDto

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

deleteGroup

    open class func deleteGroup( groupId: UUID) -> Promise<Void>

Delete group

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let groupId = 987 // UUID | groupId

// Delete group
GroupControllerAPI.deleteGroup(groupId: groupId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
groupIdUUIDgroupId

Return type

Void (empty response body)

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getAllGroups

    open class func getAllGroups( before: Date? = nil,  page: Int? = nil,  since: Date? = nil,  size: Int? = nil,  sort: Sort_getAllGroups? = nil) -> Promise<PageGroupProjection>

Get all Contact Groups in paginated format

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let before = Date() // Date | Filter by created at before the given timestamp (optional)
let page = 987 // Int | Optional page  in list pagination (optional) (default to 0)
let since = Date() // Date | Filter by created at after the given timestamp (optional)
let size = 987 // Int | Optional page size in list pagination (optional) (default to 20)
let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc)

// Get all Contact Groups in paginated format
GroupControllerAPI.getAllGroups(before: before, page: page, since: since, size: size, sort: sort).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
beforeDateFilter by created at before the given timestamp[optional]
pageIntOptional page in list pagination[optional] [default to 0]
sinceDateFilter by created at after the given timestamp[optional]
sizeIntOptional page size in list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to .asc]

Return type

PageGroupProjection

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getGroup

    open class func getGroup( groupId: UUID) -> Promise<GroupDto>

Get group

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let groupId = 987 // UUID | groupId

// Get group
GroupControllerAPI.getGroup(groupId: groupId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
groupIdUUIDgroupId

Return type

GroupDto

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getGroupWithContacts

    open class func getGroupWithContacts( groupId: UUID) -> Promise<GroupContactsDto>

Get group and contacts belonging to it

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let groupId = 987 // UUID | groupId

// Get group and contacts belonging to it
GroupControllerAPI.getGroupWithContacts(groupId: groupId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
groupIdUUIDgroupId

Return type

GroupContactsDto

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getGroupWithContactsPaginated

    open class func getGroupWithContactsPaginated( groupId: UUID,  before: Date? = nil,  page: Int? = nil,  since: Date? = nil,  size: Int? = nil,  sort: Sort_getGroupWithContactsPaginated? = nil) -> Promise<PageContactProjection>

Get group and paginated contacts belonging to it

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let groupId = 987 // UUID | groupId
let before = Date() // Date | Filter by created at before the given timestamp (optional)
let page = 987 // Int | Optional page  in group contact pagination (optional) (default to 0)
let since = Date() // Date | Filter by created at after the given timestamp (optional)
let size = 987 // Int | Optional page size in group contact pagination (optional) (default to 20)
let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc)

// Get group and paginated contacts belonging to it
GroupControllerAPI.getGroupWithContactsPaginated(groupId: groupId, before: before, page: page, since: since, size: size, sort: sort).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
groupIdUUIDgroupId
beforeDateFilter by created at before the given timestamp[optional]
pageIntOptional page in group contact pagination[optional] [default to 0]
sinceDateFilter by created at after the given timestamp[optional]
sizeIntOptional page size in group contact pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to .asc]

Return type

PageContactProjection

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getGroups

    open class func getGroups() -> Promise<[GroupProjection]>

Get all groups

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp


// Get all groups
GroupControllerAPI.getGroups().then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

This endpoint does not need any parameter.

Return type

**[GroupProjection]**

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

removeContactsFromGroup

    open class func removeContactsFromGroup( groupId: UUID,  updateGroupContactsOption: UpdateGroupContacts) -> Promise<GroupContactsDto>

Remove contacts from a group

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let groupId = 987 // UUID | groupId
let updateGroupContactsOption = UpdateGroupContacts(contactIds: [123]) // UpdateGroupContacts | updateGroupContactsOption

// Remove contacts from a group
GroupControllerAPI.removeContactsFromGroup(groupId: groupId, updateGroupContactsOption: updateGroupContactsOption).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
groupIdUUIDgroupId
updateGroupContactsOptionUpdateGroupContactsupdateGroupContactsOption

Return type

GroupContactsDto

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]