Skip to content

mailslurp.api.PhoneControllerApi

Load the API package

import 'package:mailslurp/api.dart';

All URIs are relative to https://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

EmergencyAddress createEmergencyAddress(createEmergencyAddressOptions)

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 = PhoneControllerApi();
final createEmergencyAddressOptions = CreateEmergencyAddressOptions(); // CreateEmergencyAddressOptions | 

try { 
    final result = api_instance.createEmergencyAddress(createEmergencyAddressOptions);
    print(result);
} catch (e) {
    print('Exception when calling PhoneControllerApi->createEmergencyAddress: $en');
}

Parameters

Name Type Description Notes
createEmergencyAddressOptions CreateEmergencyAddressOptions

Return type

EmergencyAddress

Authorization

API_KEY

HTTP request headers

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

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

EmptyResponseDto deleteEmergencyAddress(addressId)

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

try { 
    final result = api_instance.deleteEmergencyAddress(addressId);
    print(result);
} catch (e) {
    print('Exception when calling PhoneControllerApi->deleteEmergencyAddress: $en');
}

Parameters

Name Type Description Notes
addressId String

Return type

EmptyResponseDto

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

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

try { 
    api_instance.deletePhoneNumber(phoneNumberId);
} catch (e) {
    print('Exception when calling PhoneControllerApi->deletePhoneNumber: $en');
}

Parameters

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

EmergencyAddress getEmergencyAddress(addressId)

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

try { 
    final result = api_instance.getEmergencyAddress(addressId);
    print(result);
} catch (e) {
    print('Exception when calling PhoneControllerApi->getEmergencyAddress: $en');
}

Parameters

Name Type Description Notes
addressId String

Return type

EmergencyAddress

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

List getEmergencyAddresses()

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

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

Parameters

This endpoint does not need any parameter.

Return type

List

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

PhoneNumberDto getPhoneNumber(phoneNumberId)

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

try { 
    final result = api_instance.getPhoneNumber(phoneNumberId);
    print(result);
} catch (e) {
    print('Exception when calling PhoneControllerApi->getPhoneNumber: $en');
}

Parameters

Name Type Description Notes
phoneNumberId String

Return type

PhoneNumberDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

PagePhoneNumberProjection getPhoneNumbers(phoneCountry, page, size, sort, since, before)

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 = PhoneControllerApi();
final phoneCountry = phoneCountry_example; // String | Optional phone country
final page = 56; // int | Optional page  for list pagination
final size = 56; // int | Optional page size for list pagination
final sort = sort_example; // String | Optional createdAt sort direction ASC or DESC
final since = 2013-10-20T19:20:30+01:00; // DateTime | Filter by created at after the given timestamp
final before = 2013-10-20T19:20:30+01:00; // DateTime | Filter by created at before the given timestamp

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

Parameters

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

PagePhoneNumberProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

List getPhonePlans()

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

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

Parameters

This endpoint does not need any parameter.

Return type

List

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(phoneNumberId, testPhoneNumberOptions, xTestId)

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 = PhoneControllerApi();
final phoneNumberId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final testPhoneNumberOptions = TestPhoneNumberOptions(); // TestPhoneNumberOptions | 
final xTestId = xTestId_example; // String | 

try { 
    api_instance.testPhoneNumberSendSms(phoneNumberId, testPhoneNumberOptions, xTestId);
} catch (e) {
    print('Exception when calling PhoneControllerApi->testPhoneNumberSendSms: $en');
}

Parameters

Name Type Description Notes
phoneNumberId String
testPhoneNumberOptions TestPhoneNumberOptions
xTestId 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 ]