Skip to content

MailSlurp\GroupControllerApi

All URIs are relative to https://php.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
getGroups() GET /groups Get all groups
removeContactsFromGroup() DELETE /groups/{groupId}/contacts Remove contacts from a group

addContactsToGroup()

addContactsToGroup($group_id, $update_group_contacts): MailSlurpModelsGroupContactsDto

Add contacts to a group

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiGroupControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$group_id = 'group_id_example'; // string
$update_group_contacts = new MailSlurpModelsUpdateGroupContacts(); // MailSlurpModelsUpdateGroupContacts

try {
    $result = $apiInstance->addContactsToGroup($group_id, $update_group_contacts);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupControllerApi->addContactsToGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string
update_group_contacts MailSlurpModelsUpdateGroupContacts

Return type

MailSlurpModelsGroupContactsDto

Authorization

API_KEY

HTTP request headers

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

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

createGroup()

createGroup($create_group_options): MailSlurpModelsGroupDto

Create a group

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiGroupControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$create_group_options = new MailSlurpModelsCreateGroupOptions(); // MailSlurpModelsCreateGroupOptions

try {
    $result = $apiInstance->createGroup($create_group_options);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupControllerApi->createGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
create_group_options MailSlurpModelsCreateGroupOptions

Return type

MailSlurpModelsGroupDto

Authorization

API_KEY

HTTP request headers

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

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

deleteGroup()

deleteGroup($group_id)

Delete group

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiGroupControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$group_id = 'group_id_example'; // string

try {
    $apiInstance->deleteGroup($group_id);
} catch (Exception $e) {
    echo 'Exception when calling GroupControllerApi->deleteGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string

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()

getAllGroups($page, $size, $sort, $since, $before): MailSlurpModelsPageGroupProjection

Get all Contact Groups in paginated format

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiGroupControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$page = 0; // int | Optional page  in list pagination
$size = 20; // int | Optional page size in list pagination
$sort = 'ASC'; // string | Optional createdAt sort direction ASC or DESC
$since = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Filter by created at after the given timestamp
$before = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Filter by created at before the given timestamp

try {
    $result = $apiInstance->getAllGroups($page, $size, $sort, $since, $before);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupControllerApi->getAllGroups: ', $e->getMessage(), PHP_EOL;
}

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

MailSlurpModelsPageGroupProjection

Authorization

API_KEY

HTTP request headers

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

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

getGroup()

getGroup($group_id): MailSlurpModelsGroupDto

Get group

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiGroupControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$group_id = 'group_id_example'; // string

try {
    $result = $apiInstance->getGroup($group_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupControllerApi->getGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string

Return type

MailSlurpModelsGroupDto

Authorization

API_KEY

HTTP request headers

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

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

getGroupWithContacts()

getGroupWithContacts($group_id): MailSlurpModelsGroupContactsDto

Get group and contacts belonging to it

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiGroupControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$group_id = 'group_id_example'; // string

try {
    $result = $apiInstance->getGroupWithContacts($group_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupControllerApi->getGroupWithContacts: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string

Return type

MailSlurpModelsGroupContactsDto

Authorization

API_KEY

HTTP request headers

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

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

getGroupWithContactsPaginated()

getGroupWithContactsPaginated($group_id, $page, $size, $sort, $since, $before): MailSlurpModelsPageContactProjection

Get group and paginated contacts belonging to it

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiGroupControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$group_id = 'group_id_example'; // string
$page = 0; // int | Optional page  in group contact pagination
$size = 20; // int | Optional page size in group contact pagination
$sort = 'ASC'; // string | Optional createdAt sort direction ASC or DESC
$since = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Filter by created at after the given timestamp
$before = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Filter by created at before the given timestamp

try {
    $result = $apiInstance->getGroupWithContactsPaginated($group_id, $page, $size, $sort, $since, $before);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupControllerApi->getGroupWithContactsPaginated: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string
page int Optional page 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']
since DateTime Filter by created at after the given timestamp [optional]
before DateTime Filter by created at before the given timestamp [optional]

Return type

MailSlurpModelsPageContactProjection

Authorization

API_KEY

HTTP request headers

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

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

getGroups()

getGroups(): MailSlurpModelsGroupProjection[]

Get all groups

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiGroupControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);

try {
    $result = $apiInstance->getGroups();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupControllerApi->getGroups: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

MailSlurpModelsGroupProjection[]

Authorization

API_KEY

HTTP request headers

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

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

removeContactsFromGroup()

removeContactsFromGroup($group_id, $update_group_contacts): MailSlurpModelsGroupContactsDto

Remove contacts from a group

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiGroupControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$group_id = 'group_id_example'; // string
$update_group_contacts = new MailSlurpModelsUpdateGroupContacts(); // MailSlurpModelsUpdateGroupContacts

try {
    $result = $apiInstance->removeContactsFromGroup($group_id, $update_group_contacts);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupControllerApi->removeContactsFromGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string
update_group_contacts MailSlurpModelsUpdateGroupContacts

Return type

MailSlurpModelsGroupContactsDto

Authorization

API_KEY

HTTP request headers

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

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