# ContactControllerAPI All URIs are relative to *https://api.mailslurp.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**createContact**](ContactControllerAPI#createcontact) | **POST** /contacts | Create a contact [**deleteContact**](ContactControllerAPI#deletecontact) | **DELETE** /contacts/{contactId} | Delete contact [**getAllContacts**](ContactControllerAPI#getallcontacts) | **GET** /contacts/paginated | Get all contacts [**getContact**](ContactControllerAPI#getcontact) | **GET** /contacts/{contactId} | Get contact [**getContactVCard**](ContactControllerAPI#getcontactvcard) | **GET** /contacts/{contactId}/download | Get contact vCard vcf file [**getContacts**](ContactControllerAPI#getcontacts) | **GET** /contacts | Get all contacts # **createContact** ```swift open class func createContact( createContactOptions: CreateContactOptions) -> Promise ``` Create a contact ### Example ```swift // 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(firstName: "firstName_example", lastName: "lastName_example", company: "company_example", emailAddresses: ["emailAddresses_example"], tags: ["tags_example"], metaData: "TODO", optOut: false, groupId: 123, verifyEmailAddresses: false) // CreateContactOptions | // Create a contact ContactControllerAPI.createContact(createContactOptions: createContactOptions).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 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **createContactOptions** | [**CreateContactOptions**](CreateContactOptions) | | ### Return type [**ContactDto**](ContactDto) ### Authorization [API_KEY](../README#API_KEY) ### HTTP request headers - **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) # **deleteContact** ```swift open class func deleteContact( contactId: UUID) -> Promise ``` Delete contact ### Example ```swift // 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 | // Delete contact ContactControllerAPI.deleteContact(contactId: contactId).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 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contactId** | **UUID** | | ### Return type Void (empty response body) ### Authorization [API_KEY](../README#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) # **getAllContacts** ```swift open class func getAllContacts( page: Int? = nil, size: Int? = nil, sort: Sort_getAllContacts? = nil, since: Date? = nil, before: Date? = nil, search: String? = nil) -> Promise ``` Get all contacts ### Example ```swift // 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 list pagination (optional) (default to 0) 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) let since = Date() // Date | Filter by created at after the given timestamp (optional) let before = Date() // Date | Filter by created at before the given timestamp (optional) let search = "search_example" // String | Search terms (optional) // Get all contacts ContactControllerAPI.getAllContacts(page: page, size: size, sort: sort, since: since, before: before, search: search).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 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] **since** | **Date** | Filter by created at after the given timestamp | [optional] **before** | **Date** | Filter by created at before the given timestamp | [optional] **search** | **String** | Search terms | [optional] ### Return type [**PageContactProjection**](PageContactProjection) ### Authorization [API_KEY](../README#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) # **getContact** ```swift open class func getContact( contactId: UUID) -> Promise ``` Get contact ### Example ```swift // 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 | // Get contact ContactControllerAPI.getContact(contactId: contactId).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 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contactId** | **UUID** | | ### Return type [**ContactDto**](ContactDto) ### Authorization [API_KEY](../README#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) # **getContactVCard** ```swift open class func getContactVCard( contactId: UUID) -> Promise ``` Get contact vCard vcf file ### Example ```swift // 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 | // Get contact vCard vcf file ContactControllerAPI.getContactVCard(contactId: contactId).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 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contactId** | **UUID** | | ### Return type Void (empty response body) ### Authorization [API_KEY](../README#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) # **getContacts** ```swift open class func getContacts() -> Promise<[ContactProjection]> ``` Get all contacts ### Example ```swift // 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().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 [**[ContactProjection]**](ContactProjection) ### Authorization [API_KEY](../README#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README)