# MailslurpJavascriptApollo.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(groupId, updateGroupContactsOption)

Add contacts to a group

# Example

import MailslurpJavascriptApollo from 'mailslurp-javascript-apollo';
let defaultClient = MailslurpJavascriptApollo.ApiClient.instance;
// Configure API key authorization: API_KEY
let API_KEY = defaultClient.authentications['API_KEY'];
API_KEY.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//API_KEY.apiKeyPrefix = 'Token';
let apiInstance = new MailslurpJavascriptApollo.GroupControllerApi();
let groupId = null; // String | groupId
let updateGroupContactsOption = new MailslurpJavascriptApollo.UpdateGroupContacts(); // UpdateGroupContacts | updateGroupContactsOption
apiInstance.addContactsToGroup(groupId, updateGroupContactsOption, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

# Parameters

Name Type Description Notes
groupId String groupId
updateGroupContactsOption UpdateGroupContacts updateGroupContactsOption

# Return type

GroupContactsDto

# Authorization

API_KEY

# HTTP request headers

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

# createGroup

GroupDto createGroup(createGroupOptions)

Create a group

# Example

import MailslurpJavascriptApollo from 'mailslurp-javascript-apollo';
let defaultClient = MailslurpJavascriptApollo.ApiClient.instance;
// Configure API key authorization: API_KEY
let API_KEY = defaultClient.authentications['API_KEY'];
API_KEY.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//API_KEY.apiKeyPrefix = 'Token';
let apiInstance = new MailslurpJavascriptApollo.GroupControllerApi();
let createGroupOptions = new MailslurpJavascriptApollo.CreateGroupOptions(); // CreateGroupOptions | createGroupOptions
apiInstance.createGroup(createGroupOptions, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

# Parameters

Name Type Description Notes
createGroupOptions CreateGroupOptions createGroupOptions

# Return type

GroupDto

# Authorization

API_KEY

# HTTP request headers

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

# deleteGroup

deleteGroup(groupId)

Delete group

# Example

import MailslurpJavascriptApollo from 'mailslurp-javascript-apollo';
let defaultClient = MailslurpJavascriptApollo.ApiClient.instance;
// Configure API key authorization: API_KEY
let API_KEY = defaultClient.authentications['API_KEY'];
API_KEY.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//API_KEY.apiKeyPrefix = 'Token';
let apiInstance = new MailslurpJavascriptApollo.GroupControllerApi();
let groupId = null; // String | groupId
apiInstance.deleteGroup(groupId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});

# Parameters

Name Type Description Notes
groupId String groupId

# Return type

null (empty response body)

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

# getAllGroups

PageGroupProjection getAllGroups(opts)

Get all Contact Groups in paginated format

# Example

import MailslurpJavascriptApollo from 'mailslurp-javascript-apollo';
let defaultClient = MailslurpJavascriptApollo.ApiClient.instance;
// Configure API key authorization: API_KEY
let API_KEY = defaultClient.authentications['API_KEY'];
API_KEY.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//API_KEY.apiKeyPrefix = 'Token';
let apiInstance = new MailslurpJavascriptApollo.GroupControllerApi();
let opts = {
  'page': 0, // Number | Optional page index in inbox list pagination
  'size': 20, // Number | Optional page size in inbox list pagination
  'sort': "'ASC'" // String | Optional createdAt sort direction ASC or DESC
};
apiInstance.getAllGroups(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

# Parameters

Name Type Description Notes
page Number Optional page index in inbox list pagination [optional] [default to 0]
size Number 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

PageGroupProjection

# Authorization

API_KEY

# HTTP request headers

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

# getGroup

GroupDto getGroup(groupId)

Get group

# Example

import MailslurpJavascriptApollo from 'mailslurp-javascript-apollo';
let defaultClient = MailslurpJavascriptApollo.ApiClient.instance;
// Configure API key authorization: API_KEY
let API_KEY = defaultClient.authentications['API_KEY'];
API_KEY.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//API_KEY.apiKeyPrefix = 'Token';
let apiInstance = new MailslurpJavascriptApollo.GroupControllerApi();
let groupId = null; // String | groupId
apiInstance.getGroup(groupId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

# Parameters

Name Type Description Notes
groupId String groupId

# Return type

GroupDto

# Authorization

API_KEY

# HTTP request headers

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

# getGroupWithContacts

GroupContactsDto getGroupWithContacts(groupId)

Get group and contacts belonging to it

# Example

import MailslurpJavascriptApollo from 'mailslurp-javascript-apollo';
let defaultClient = MailslurpJavascriptApollo.ApiClient.instance;
// Configure API key authorization: API_KEY
let API_KEY = defaultClient.authentications['API_KEY'];
API_KEY.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//API_KEY.apiKeyPrefix = 'Token';
let apiInstance = new MailslurpJavascriptApollo.GroupControllerApi();
let groupId = null; // String | groupId
apiInstance.getGroupWithContacts(groupId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

# Parameters

Name Type Description Notes
groupId String groupId

# Return type

GroupContactsDto

# Authorization

API_KEY

# HTTP request headers

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

# getGroupWithContactsPaginated

PageContactProjection getGroupWithContactsPaginated(groupId, opts)

Get group and paginated contacts belonging to it

# Example

import MailslurpJavascriptApollo from 'mailslurp-javascript-apollo';
let defaultClient = MailslurpJavascriptApollo.ApiClient.instance;
// Configure API key authorization: API_KEY
let API_KEY = defaultClient.authentications['API_KEY'];
API_KEY.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//API_KEY.apiKeyPrefix = 'Token';
let apiInstance = new MailslurpJavascriptApollo.GroupControllerApi();
let groupId = null; // String | groupId
let opts = {
  'page': 0, // Number | Optional page index in group contact pagination
  'size': 20, // Number | Optional page size in group contact pagination
  'sort': "'ASC'" // String | Optional createdAt sort direction ASC or DESC
};
apiInstance.getGroupWithContactsPaginated(groupId, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

# Parameters

Name Type Description Notes
groupId String groupId
page Number Optional page index in group contact pagination [optional] [default to 0]
size Number 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

PageContactProjection

# Authorization

API_KEY

# HTTP request headers

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

# getGroups

[GroupProjection] getGroups()

Get all groups

# Example

import MailslurpJavascriptApollo from 'mailslurp-javascript-apollo';
let defaultClient = MailslurpJavascriptApollo.ApiClient.instance;
// Configure API key authorization: API_KEY
let API_KEY = defaultClient.authentications['API_KEY'];
API_KEY.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//API_KEY.apiKeyPrefix = 'Token';
let apiInstance = new MailslurpJavascriptApollo.GroupControllerApi();
apiInstance.getGroups((error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

# Parameters

This endpoint does not need any parameter.

# Return type

[GroupProjection]

# Authorization

API_KEY

# HTTP request headers

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

# removeContactsFromGroup

GroupContactsDto removeContactsFromGroup(groupId, updateGroupContactsOption)

Remove contacts from a group

# Example

import MailslurpJavascriptApollo from 'mailslurp-javascript-apollo';
let defaultClient = MailslurpJavascriptApollo.ApiClient.instance;
// Configure API key authorization: API_KEY
let API_KEY = defaultClient.authentications['API_KEY'];
API_KEY.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//API_KEY.apiKeyPrefix = 'Token';
let apiInstance = new MailslurpJavascriptApollo.GroupControllerApi();
let groupId = null; // String | groupId
let updateGroupContactsOption = new MailslurpJavascriptApollo.UpdateGroupContacts(); // UpdateGroupContacts | updateGroupContactsOption
apiInstance.removeContactsFromGroup(groupId, updateGroupContactsOption, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

# Parameters

Name Type Description Notes
groupId String groupId
updateGroupContactsOption UpdateGroupContacts updateGroupContactsOption

# Return type

GroupContactsDto

# Authorization

API_KEY

# HTTP request headers

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