# GroupControllerAPI

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

Method HTTP request Description
addContactsToGroup PUT /groups/{groupId}/contacts Add contacts to a group
createGroup POST /groups Create a group
deleteGroup DELETE /groups/{groupId} Delete group
getAllGroups GET /groups/paginated Get all Contact Groups in paginated format
getGroup GET /groups/{groupId} Get group
getGroupWithContacts GET /groups/{groupId}/contacts Get group and contacts belonging to it
getGroupWithContactsPaginated GET /groups/{groupId}/contacts-paginated Get group and paginated contacts belonging to it
getGroups GET /groups Get all groups
removeContactsFromGroup DELETE /groups/{groupId}/contacts Remove contacts from a group

# addContactsToGroup

    open class func addContactsToGroup(groupId: UUID, updateGroupContactsOption: UpdateGroupContacts, completion: @escaping (_ data: GroupContactsDto?, _ error: Error?) -> Void)

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) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
groupId UUID groupId
updateGroupContactsOption UpdateGroupContacts updateGroupContactsOption

# 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 README]

# createGroup

    open class func createGroup(createGroupOptions: CreateGroupOptions, completion: @escaping (_ data: GroupDto?, _ error: Error?) -> Void)

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) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
createGroupOptions CreateGroupOptions createGroupOptions

# 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 README]

# deleteGroup

    open class func deleteGroup(groupId: UUID, completion: @escaping (_ data: Void?, _ error: Error?) -> 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) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
groupId UUID groupId

# 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 README]

# getAllGroups

    open class func getAllGroups(page: Int? = nil, size: Int? = nil, sort: Sort_getAllGroups? = nil, completion: @escaping (_ data: PageGroupProjection?, _ error: Error?) -> Void)

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 page = 987 // Int | Optional page index in inbox list pagination (optional) (default to 0)
let size = 987 // Int | Optional page size in inbox 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(page: page, size: size, sort: sort) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
page Int Optional page index in inbox list pagination [optional] [default to 0]
size Int Optional page size in inbox list pagination [optional] [default to 20]
sort String Optional 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 README]

# getGroup

    open class func getGroup(groupId: UUID, completion: @escaping (_ data: GroupDto?, _ error: Error?) -> Void)

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) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
groupId UUID groupId

# 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 README]

# getGroupWithContacts

    open class func getGroupWithContacts(groupId: UUID, completion: @escaping (_ data: GroupContactsDto?, _ error: Error?) -> Void)

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) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
groupId UUID groupId

# 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 README]

# getGroupWithContactsPaginated

    open class func getGroupWithContactsPaginated(groupId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getGroupWithContactsPaginated? = nil, completion: @escaping (_ data: PageContactProjection?, _ error: Error?) -> Void)

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 page = 987 // Int | Optional page index in group contact pagination (optional) (default to 0)
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, page: page, size: size, sort: sort) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
groupId UUID groupId
page Int Optional page index in group contact pagination [optional] [default to 0]
size Int Optional page size in group contact pagination [optional] [default to 20]
sort String Optional 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 README]

# getGroups

    open class func getGroups(completion: @escaping (_ data: [GroupProjection]?, _ error: Error?) -> Void)

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() { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# 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 README]

# removeContactsFromGroup

    open class func removeContactsFromGroup(groupId: UUID, updateGroupContactsOption: UpdateGroupContacts, completion: @escaping (_ data: GroupContactsDto?, _ error: Error?) -> Void)

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) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
groupId UUID groupId
updateGroupContactsOption UpdateGroupContacts updateGroupContactsOption

# 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 README]