mailslurp.api.ContactControllerApi

Load the API package

import 'package:mailslurp/api.dart';

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

ContactDto createContact(createContactOptions)

Create a contact

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = ContactControllerApi();
final createContactOptions = CreateContactOptions(); // CreateContactOptions | createContactOptions

try { 
    final result = api_instance.createContact(createContactOptions);
    print(result);
} catch (e) {
    print('Exception when calling ContactControllerApi->createContact: $en');
}

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

deleteContact(contactId)

Delete contact

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = ContactControllerApi();
final contactId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | contactId

try { 
    api_instance.deleteContact(contactId);
} catch (e) {
    print('Exception when calling ContactControllerApi->deleteContact: $en');
}

Parameters

NameTypeDescriptionNotes
contactIdStringcontactId

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

PageContactProjection getAllContacts(page, size, sort)

Get all contacts

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = ContactControllerApi();
final page = 56; // int | Optional page  in list pagination
final size = 56; // int | Optional page size in list pagination
final sort = sort_example; // String | Optional createdAt sort direction ASC or DESC

try { 
    final result = api_instance.getAllContacts(page, size, sort);
    print(result);
} catch (e) {
    print('Exception when calling ContactControllerApi->getAllContacts: $en');
}

Parameters

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

ContactDto getContact(contactId)

Get contact

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = ContactControllerApi();
final contactId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | contactId

try { 
    final result = api_instance.getContact(contactId);
    print(result);
} catch (e) {
    print('Exception when calling ContactControllerApi->getContact: $en');
}

Parameters

NameTypeDescriptionNotes
contactIdStringcontactId

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

String getContactVCard(contactId)

Get contact vCard vcf file

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = ContactControllerApi();
final contactId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | contactId

try { 
    final result = api_instance.getContactVCard(contactId);
    print(result);
} catch (e) {
    print('Exception when calling ContactControllerApi->getContactVCard: $en');
}

Parameters

NameTypeDescriptionNotes
contactIdStringcontactId

Return type

String

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

List getContacts()

Get all contacts

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = ContactControllerApi();

try { 
    final result = api_instance.getContacts();
    print(result);
} catch (e) {
    print('Exception when calling ContactControllerApi->getContacts: $en');
}

Parameters

This endpoint does not need any parameter.

Return type

List

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 ]