# mailslurp.Api.GroupControllerApi
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
AddContactsToGroup | PUT /groups/{groupId}/contacts | Add contacts to a group |
CreateGroup | POST /groups | Create a group |
DeleteGroup | DELETE /groups/{groupId} | Delete group |
GetAllGroups | GET /groups/paginated | Get all Contact Groups in paginated format |
GetGroup | GET /groups/{groupId} | Get group |
GetGroupWithContacts | GET /groups/{groupId}/contacts | Get group and contacts belonging to it |
GetGroupWithContactsPaginated | GET /groups/{groupId}/contacts-paginated | Get group and paginated contacts belonging to it |
GetGroups | GET /groups | Get all groups |
RemoveContactsFromGroup | DELETE /groups/{groupId}/contacts | Remove contacts from a group |
# AddContactsToGroup
GroupContactsDto AddContactsToGroup (Guid groupId, UpdateGroupContacts updateGroupContactsOption)
Add contacts to a group
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class AddContactsToGroupExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new GroupControllerApi(config);
var groupId = new Guid(); // Guid | groupId
var updateGroupContactsOption = new UpdateGroupContacts(); // UpdateGroupContacts | updateGroupContactsOption
try
{
// Add contacts to a group
GroupContactsDto result = apiInstance.AddContactsToGroup(groupId, updateGroupContactsOption);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GroupControllerApi.AddContactsToGroup: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
groupId | Guid | groupId | |
updateGroupContactsOption | UpdateGroupContacts | updateGroupContactsOption |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
201 | Created | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# CreateGroup
GroupDto CreateGroup (CreateGroupOptions createGroupOptions)
Create a group
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class CreateGroupExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new GroupControllerApi(config);
var createGroupOptions = new CreateGroupOptions(); // CreateGroupOptions | createGroupOptions
try
{
// Create a group
GroupDto result = apiInstance.CreateGroup(createGroupOptions);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GroupControllerApi.CreateGroup: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
createGroupOptions | CreateGroupOptions | createGroupOptions |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# DeleteGroup
void DeleteGroup (Guid groupId)
Delete group
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class DeleteGroupExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new GroupControllerApi(config);
var groupId = new Guid(); // Guid | groupId
try
{
// Delete group
apiInstance.DeleteGroup(groupId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GroupControllerApi.DeleteGroup: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
groupId | Guid | groupId |
# Return type
void (empty response body)
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
# HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
401 | Unauthorized | - |
403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# GetAllGroups
PageGroupProjection GetAllGroups (int? page = null, int? size = null, string sort = null)
Get all Contact Groups in paginated format
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetAllGroupsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new GroupControllerApi(config);
var page = 56; // int? | Optional page index in inbox list pagination (optional) (default to 0)
var size = 56; // int? | Optional page size in inbox list pagination (optional) (default to 20)
var sort = sort_example; // string | Optional createdAt sort direction ASC or DESC (optional) (default to ASC)
try
{
// Get all Contact Groups in paginated format
PageGroupProjection result = apiInstance.GetAllGroups(page, size, sort);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GroupControllerApi.GetAllGroups: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | int? | Optional page index in inbox list pagination | [optional] [default to 0] |
size | int? | Optional page size in inbox list pagination | [optional] [default to 20] |
sort | string | Optional createdAt sort direction ASC or DESC | [optional] [default to ASC] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# GetGroup
GroupDto GetGroup (Guid groupId)
Get group
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetGroupExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new GroupControllerApi(config);
var groupId = new Guid(); // Guid | groupId
try
{
// Get group
GroupDto result = apiInstance.GetGroup(groupId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GroupControllerApi.GetGroup: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
groupId | Guid | groupId |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# GetGroupWithContacts
GroupContactsDto GetGroupWithContacts (Guid groupId)
Get group and contacts belonging to it
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetGroupWithContactsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new GroupControllerApi(config);
var groupId = new Guid(); // Guid | groupId
try
{
// Get group and contacts belonging to it
GroupContactsDto result = apiInstance.GetGroupWithContacts(groupId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GroupControllerApi.GetGroupWithContacts: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
groupId | Guid | groupId |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# GetGroupWithContactsPaginated
PageContactProjection GetGroupWithContactsPaginated (Guid groupId, int? page = null, int? size = null, string sort = null)
Get group and paginated contacts belonging to it
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetGroupWithContactsPaginatedExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new GroupControllerApi(config);
var groupId = new Guid(); // Guid | groupId
var page = 56; // int? | Optional page index in group contact pagination (optional) (default to 0)
var size = 56; // int? | Optional page size in group contact pagination (optional) (default to 20)
var sort = sort_example; // string | Optional createdAt sort direction ASC or DESC (optional) (default to ASC)
try
{
// Get group and paginated contacts belonging to it
PageContactProjection result = apiInstance.GetGroupWithContactsPaginated(groupId, page, size, sort);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GroupControllerApi.GetGroupWithContactsPaginated: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
groupId | Guid | groupId | |
page | int? | Optional page index in group contact pagination | [optional] [default to 0] |
size | int? | Optional page size in group contact pagination | [optional] [default to 20] |
sort | string | Optional createdAt sort direction ASC or DESC | [optional] [default to ASC] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# GetGroups
List<GroupProjection> GetGroups ()
Get all groups
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetGroupsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new GroupControllerApi(config);
try
{
// Get all groups
List<GroupProjection> result = apiInstance.GetGroups();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GroupControllerApi.GetGroups: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
This endpoint does not need any parameter.
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# RemoveContactsFromGroup
GroupContactsDto RemoveContactsFromGroup (Guid groupId, UpdateGroupContacts updateGroupContactsOption)
Remove contacts from a group
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class RemoveContactsFromGroupExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new GroupControllerApi(config);
var groupId = new Guid(); // Guid | groupId
var updateGroupContactsOption = new UpdateGroupContacts(); // UpdateGroupContacts | updateGroupContactsOption
try
{
// Remove contacts from a group
GroupContactsDto result = apiInstance.RemoveContactsFromGroup(groupId, updateGroupContactsOption);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GroupControllerApi.RemoveContactsFromGroup: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
groupId | Guid | groupId | |
updateGroupContactsOption | UpdateGroupContacts | updateGroupContactsOption |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
204 | No Content | - |
401 | Unauthorized | - |
403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]