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

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 | 

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

Parameters

NameTypeDescriptionNotes
createContactOptionsCreateContactOptions

Return type

ContactDto

Authorization

API_KEY

HTTP request headers

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

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

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 | 

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

Parameters

NameTypeDescriptionNotes
contactIdString

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 ]

PageContactProjection getAllContacts(page, size, sort, since, before)

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
final since = 2013-10-20T19:20:30+01:00; // DateTime | Filter by created at after the given timestamp
final before = 2013-10-20T19:20:30+01:00; // DateTime | Filter by created at before the given timestamp

try { 
    final result = api_instance.getAllContacts(page, size, sort, since, before);
    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’]
sinceDateTimeFilter by created at after the given timestamp[optional]
beforeDateTimeFilter by created at before the given timestamp[optional]

Return type

PageContactProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

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 | 

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

Parameters

NameTypeDescriptionNotes
contactIdString

Return type

ContactDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

List 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 | 

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

Parameters

NameTypeDescriptionNotes
contactIdString

Return type

List

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

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: /

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