mailslurp.api.GroupControllerApi

Load the API package

import 'package:mailslurp/api.dart';

All URIs are relative to https://api.mailslurp.com

MethodHTTP requestDescription
addContactsToGroupPUT /groups/{groupId}/contactsAdd contacts to a group
createGroupPOST /groupsCreate a group
deleteGroupDELETE /groups/{groupId}Delete group
getAllGroupsGET /groups/paginatedGet all Contact Groups in paginated format
getGroupGET /groups/{groupId}Get group
getGroupWithContactsGET /groups/{groupId}/contactsGet group and contacts belonging to it
getGroupWithContactsPaginatedGET /groups/{groupId}/contacts-paginatedGet group and paginated contacts belonging to it
getGroupsGET /groupsGet all groups
removeContactsFromGroupDELETE /groups/{groupId}/contactsRemove contacts from a group

addContactsToGroup

GroupContactsDto addContactsToGroup(groupId, updateGroupContactsOption)

Add contacts to a group

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 = GroupControllerApi();
final groupId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | groupId
final updateGroupContactsOption = UpdateGroupContacts(); // UpdateGroupContacts | updateGroupContactsOption

try { 
    final result = api_instance.addContactsToGroup(groupId, updateGroupContactsOption);
    print(result);
} catch (e) {
    print('Exception when calling GroupControllerApi->addContactsToGroup: $en');
}

Parameters

NameTypeDescriptionNotes
groupIdStringgroupId
updateGroupContactsOptionUpdateGroupContactsupdateGroupContactsOption

Return type

GroupContactsDto

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 ]

createGroup

GroupDto createGroup(createGroupOptions)

Create a group

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 = GroupControllerApi();
final createGroupOptions = CreateGroupOptions(); // CreateGroupOptions | createGroupOptions

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

Parameters

NameTypeDescriptionNotes
createGroupOptionsCreateGroupOptionscreateGroupOptions

Return type

GroupDto

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 ]

deleteGroup

deleteGroup(groupId)

Delete group

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 = GroupControllerApi();
final groupId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | groupId

try { 
    api_instance.deleteGroup(groupId);
} catch (e) {
    print('Exception when calling GroupControllerApi->deleteGroup: $en');
}

Parameters

NameTypeDescriptionNotes
groupIdStringgroupId

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 ]

getAllGroups

PageGroupProjection getAllGroups(before, page, since, size, sort)

Get all Contact Groups in paginated format

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 = GroupControllerApi();
final before = 2013-10-20T19:20:30+01:00; // DateTime | Filter by created at before the given timestamp
final page = 56; // int | Optional page  in list pagination
final since = 2013-10-20T19:20:30+01:00; // DateTime | Filter by created at after the given timestamp
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.getAllGroups(before, page, since, size, sort);
    print(result);
} catch (e) {
    print('Exception when calling GroupControllerApi->getAllGroups: $en');
}

Parameters

NameTypeDescriptionNotes
beforeDateTimeFilter by created at before the given timestamp[optional]
pageintOptional page in list pagination[optional] [default to 0]
sinceDateTimeFilter by created at after the given timestamp[optional]
sizeintOptional page size in list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

PageGroupProjection

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 ]

getGroup

GroupDto getGroup(groupId)

Get group

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 = GroupControllerApi();
final groupId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | groupId

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

Parameters

NameTypeDescriptionNotes
groupIdStringgroupId

Return type

GroupDto

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 ]

getGroupWithContacts

GroupContactsDto getGroupWithContacts(groupId)

Get group and contacts belonging to it

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 = GroupControllerApi();
final groupId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | groupId

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

Parameters

NameTypeDescriptionNotes
groupIdStringgroupId

Return type

GroupContactsDto

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 ]

getGroupWithContactsPaginated

PageContactProjection getGroupWithContactsPaginated(groupId, before, page, since, size, sort)

Get group and paginated contacts belonging to it

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 = GroupControllerApi();
final groupId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | groupId
final before = 2013-10-20T19:20:30+01:00; // DateTime | Filter by created at before the given timestamp
final page = 56; // int | Optional page  in group contact pagination
final since = 2013-10-20T19:20:30+01:00; // DateTime | Filter by created at after the given timestamp
final size = 56; // int | Optional page size in group contact pagination
final sort = sort_example; // String | Optional createdAt sort direction ASC or DESC

try { 
    final result = api_instance.getGroupWithContactsPaginated(groupId, before, page, since, size, sort);
    print(result);
} catch (e) {
    print('Exception when calling GroupControllerApi->getGroupWithContactsPaginated: $en');
}

Parameters

NameTypeDescriptionNotes
groupIdStringgroupId
beforeDateTimeFilter by created at before the given timestamp[optional]
pageintOptional page in group contact pagination[optional] [default to 0]
sinceDateTimeFilter by created at after the given timestamp[optional]
sizeintOptional page size in group contact 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 ]

getGroups

List getGroups()

Get all groups

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 = GroupControllerApi();

try { 
    final result = api_instance.getGroups();
    print(result);
} catch (e) {
    print('Exception when calling GroupControllerApi->getGroups: $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 ]

removeContactsFromGroup

GroupContactsDto removeContactsFromGroup(groupId, updateGroupContactsOption)

Remove contacts from a group

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 = GroupControllerApi();
final groupId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | groupId
final updateGroupContactsOption = UpdateGroupContacts(); // UpdateGroupContacts | updateGroupContactsOption

try { 
    final result = api_instance.removeContactsFromGroup(groupId, updateGroupContactsOption);
    print(result);
} catch (e) {
    print('Exception when calling GroupControllerApi->removeContactsFromGroup: $en');
}

Parameters

NameTypeDescriptionNotes
groupIdStringgroupId
updateGroupContactsOptionUpdateGroupContactsupdateGroupContactsOption

Return type

GroupContactsDto

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 ]