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

    open class func createContact(createContactOptions: CreateContactOptions, completion: @escaping (_ data: ContactDto?, _ error: Error?) -> Void)

Create a contact

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 createContactOptions = CreateContactOptions(emailAddresses: ["emailAddresses_example"], firstName: "firstName_example", groupId: 123, metaData: 123, optOut: false, tags: ["tags_example"], lastName: "lastName_example", company: "company_example") // CreateContactOptions | createContactOptions

// Create a contact
ContactControllerAPI.createContact(createContactOptions: createContactOptions) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

NameTypeDescriptionNotes
createContactOptionsCreateContactOptionscreateContactOptions

Return type

ContactDto

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 ]

deleteContact

    open class func deleteContact(contactId: UUID, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)

Delete contact

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 contactId = 987 // UUID | contactId

// Delete contact
ContactControllerAPI.deleteContact(contactId: contactId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

NameTypeDescriptionNotes
contactIdUUIDcontactId

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 ]

getAllContacts

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

Get all contacts

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  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 contacts
ContactControllerAPI.getAllContacts(page: page, size: size, sort: sort) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

NameTypeDescriptionNotes
pageIntOptional page in inbox list pagination[optional] [default to 0]
sizeIntOptional page size in inbox list 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 ]

getContact

    open class func getContact(contactId: UUID, completion: @escaping (_ data: ContactDto?, _ error: Error?) -> Void)

Get contact

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 contactId = 987 // UUID | contactId

// Get contact
ContactControllerAPI.getContact(contactId: contactId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

NameTypeDescriptionNotes
contactIdUUIDcontactId

Return type

ContactDto

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 ]

getContactVCard

    open class func getContactVCard(contactId: UUID, completion: @escaping (_ data: Data?, _ error: Error?) -> Void)

Get contact vCard vcf file

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 contactId = 987 // UUID | contactId

// Get contact vCard vcf file
ContactControllerAPI.getContactVCard(contactId: contactId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

NameTypeDescriptionNotes
contactIdUUIDcontactId

Return type

Data

Authorization

API_KEY

HTTP request headers

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

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

getContacts

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

Get all contacts

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 contacts
ContactControllerAPI.getContacts() { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

This endpoint does not need any parameter.

Return type

**[ContactProjection]**

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 ]