mailslurp.api.ContactControllerApi
Load the API package
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
createContact | POST /contacts | Create a contact |
deleteContact | DELETE /contacts/{contactId} | Delete contact |
getAllContacts | GET /contacts/paginated | Get all contacts |
getContact | GET /contacts/{contactId} | Get contact |
getContactVCard | GET /contacts/{contactId}/download | Get contact vCard vcf file |
getContacts | GET /contacts | Get 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
Name | Type | Description | Notes |
---|---|---|---|
createContactOptions | CreateContactOptions |
Return type
Authorization
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
Name | Type | Description | Notes |
---|---|---|---|
contactId | String |
Return type
void (empty response body)
Authorization
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
Name | Type | Description | Notes |
---|---|---|---|
page | int | Optional page 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 | DateTime | Filter by created at after the given timestamp | [optional] |
before | DateTime | Filter by created at before the given timestamp | [optional] |
Return type
Authorization
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
Name | Type | Description | Notes |
---|---|---|---|
contactId | String |
Return type
Authorization
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
Name | Type | Description | Notes |
---|---|---|---|
contactId | String |
Return type
List
Authorization
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
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]