Skip to content

MailSlurp\PhoneControllerApi

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

Method HTTP request Description
createEmergencyAddress() POST /phone/emergency-addresses
deleteEmergencyAddress() DELETE /phone/emergency-addresses/{addressId}
deletePhoneNumber() DELETE /phone/numbers/{phoneNumberId}
getEmergencyAddress() GET /phone/emergency-addresses/{addressId}
getEmergencyAddresses() GET /phone/emergency-addresses
getPhoneNumber() GET /phone/numbers/{phoneNumberId}
getPhoneNumbers() GET /phone/numbers
getPhonePlans() GET /phone/plans
testPhoneNumberSendSms() POST /phone/numbers/{phoneNumberId}/test

createEmergencyAddress()

createEmergencyAddress($create_emergency_address_options): MailSlurpModelsEmergencyAddress

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 MailSlurpApiPhoneControllerApi(
    // 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_emergency_address_options = new MailSlurpModelsCreateEmergencyAddressOptions(); // MailSlurpModelsCreateEmergencyAddressOptions

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

Parameters

Name Type Description Notes
create_emergency_address_options MailSlurpModelsCreateEmergencyAddressOptions

Return type

MailSlurpModelsEmergencyAddress

Authorization

API_KEY

HTTP request headers

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

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

deleteEmergencyAddress()

deleteEmergencyAddress($address_id): MailSlurpModelsEmptyResponseDto

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 MailSlurpApiPhoneControllerApi(
    // 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
);
$address_id = 'address_id_example'; // string

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

Parameters

Name Type Description Notes
address_id string

Return type

MailSlurpModelsEmptyResponseDto

Authorization

API_KEY

HTTP request headers

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

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

deletePhoneNumber()

deletePhoneNumber($phone_number_id)

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 MailSlurpApiPhoneControllerApi(
    // 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
);
$phone_number_id = 'phone_number_id_example'; // string

try {
    $apiInstance->deletePhoneNumber($phone_number_id);
} catch (Exception $e) {
    echo 'Exception when calling PhoneControllerApi->deletePhoneNumber: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
phone_number_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 ]

getEmergencyAddress()

getEmergencyAddress($address_id): MailSlurpModelsEmergencyAddress

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 MailSlurpApiPhoneControllerApi(
    // 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
);
$address_id = 'address_id_example'; // string

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

Parameters

Name Type Description Notes
address_id string

Return type

MailSlurpModelsEmergencyAddress

Authorization

API_KEY

HTTP request headers

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

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

getEmergencyAddresses()

getEmergencyAddresses(): MailSlurpModelsEmergencyAddressDto[]

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 MailSlurpApiPhoneControllerApi(
    // 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->getEmergencyAddresses();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PhoneControllerApi->getEmergencyAddresses: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

MailSlurpModelsEmergencyAddressDto[]

Authorization

API_KEY

HTTP request headers

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

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

getPhoneNumber()

getPhoneNumber($phone_number_id): MailSlurpModelsPhoneNumberDto

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 MailSlurpApiPhoneControllerApi(
    // 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
);
$phone_number_id = 'phone_number_id_example'; // string

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

Parameters

Name Type Description Notes
phone_number_id string

Return type

MailSlurpModelsPhoneNumberDto

Authorization

API_KEY

HTTP request headers

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

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

getPhoneNumbers()

getPhoneNumbers($phone_country, $page, $size, $sort, $since, $before): MailSlurpModelsPagePhoneNumberProjection

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 MailSlurpApiPhoneControllerApi(
    // 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
);
$phone_country = 'phone_country_example'; // string | Optional phone country
$page = 0; // int | Optional page  for list pagination
$size = 20; // int | Optional page size for 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->getPhoneNumbers($phone_country, $page, $size, $sort, $since, $before);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PhoneControllerApi->getPhoneNumbers: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
phone_country string Optional phone country [optional]
page int Optional page for list pagination [optional] [default to 0]
size int Optional page size for 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

MailSlurpModelsPagePhoneNumberProjection

Authorization

API_KEY

HTTP request headers

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

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

getPhonePlans()

getPhonePlans(): MailSlurpModelsPhonePlanDto[]

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 MailSlurpApiPhoneControllerApi(
    // 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->getPhonePlans();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PhoneControllerApi->getPhonePlans: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

MailSlurpModelsPhonePlanDto[]

Authorization

API_KEY

HTTP request headers

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

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

testPhoneNumberSendSms()

testPhoneNumberSendSms($phone_number_id, $test_phone_number_options, $x_test_id)

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 MailSlurpApiPhoneControllerApi(
    // 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
);
$phone_number_id = 'phone_number_id_example'; // string
$test_phone_number_options = new MailSlurpModelsTestPhoneNumberOptions(); // MailSlurpModelsTestPhoneNumberOptions
$x_test_id = 'x_test_id_example'; // string

try {
    $apiInstance->testPhoneNumberSendSms($phone_number_id, $test_phone_number_options, $x_test_id);
} catch (Exception $e) {
    echo 'Exception when calling PhoneControllerApi->testPhoneNumberSendSms: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
phone_number_id string
test_phone_number_options MailSlurpModelsTestPhoneNumberOptions
x_test_id string [optional]

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

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

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