Skip to content

PhoneControllerAPI

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
    open class func createEmergencyAddress( createEmergencyAddressOptions: CreateEmergencyAddressOptions) -> Promise<EmergencyAddress>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let createEmergencyAddressOptions = CreateEmergencyAddressOptions(customerName: "customerName_example", address1: "address1_example", city: "city_example", region: "region_example", postalCode: "postalCode_example", isoCountryCode: "isoCountryCode_example", displayName: "displayName_example") // CreateEmergencyAddressOptions | 

PhoneControllerAPI.createEmergencyAddress(createEmergencyAddressOptions: createEmergencyAddressOptions).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

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 ]

    open class func deleteEmergencyAddress( addressId: UUID) -> Promise<EmptyResponseDto>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let addressId = 987 // UUID | 

PhoneControllerAPI.deleteEmergencyAddress(addressId: addressId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

Name Type Description Notes
addressId UUID

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 ]

    open class func deletePhoneNumber( phoneNumberId: UUID) -> Promise<Void>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let phoneNumberId = 987 // UUID | 

PhoneControllerAPI.deletePhoneNumber(phoneNumberId: phoneNumberId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

Name Type Description Notes
phoneNumberId UUID

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 ]

    open class func getEmergencyAddress( addressId: UUID) -> Promise<EmergencyAddress>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let addressId = 987 // UUID | 

PhoneControllerAPI.getEmergencyAddress(addressId: addressId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

Name Type Description Notes
addressId UUID

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 ]

    open class func getEmergencyAddresses() -> Promise<[EmergencyAddressDto]>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp


PhoneControllerAPI.getEmergencyAddresses().then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

This endpoint does not need any parameter.

Return type

[EmergencyAddressDto]

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

    open class func getPhoneNumber( phoneNumberId: UUID) -> Promise<PhoneNumberDto>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let phoneNumberId = 987 // UUID | 

PhoneControllerAPI.getPhoneNumber(phoneNumberId: phoneNumberId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

Name Type Description Notes
phoneNumberId UUID

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 ]

    open class func getPhoneNumbers( phoneCountry: PhoneCountry_getPhoneNumbers? = nil,  page: Int? = nil,  size: Int? = nil,  sort: Sort_getPhoneNumbers? = nil,  since: Date? = nil,  before: Date? = nil) -> Promise<PagePhoneNumberProjection>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let phoneCountry = "phoneCountry_example" // String | Optional phone country (optional)
let page = 987 // Int | Optional page  for list pagination (optional) (default to 0)
let size = 987 // Int | Optional page size for list pagination (optional) (default to 20)
let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc)
let since = Date() // Date | Filter by created at after the given timestamp (optional)
let before = Date() // Date | Filter by created at before the given timestamp (optional)

PhoneControllerAPI.getPhoneNumbers(phoneCountry: phoneCountry, page: page, size: size, sort: sort, since: since, before: before).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

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 Date Filter by created at after the given timestamp [optional]
before Date 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 ]

    open class func getPhonePlans() -> Promise<[PhonePlanDto]>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp


PhoneControllerAPI.getPhonePlans().then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

This endpoint does not need any parameter.

Return type

[PhonePlanDto]

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

    open class func testPhoneNumberSendSms( phoneNumberId: UUID,  testPhoneNumberOptions: TestPhoneNumberOptions,  xTestId: String? = nil) -> Promise<Void>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let phoneNumberId = 987 // UUID | 
let testPhoneNumberOptions = TestPhoneNumberOptions(message: "message_example") // TestPhoneNumberOptions | 
let xTestId = "xTestId_example" // String |  (optional)

PhoneControllerAPI.testPhoneNumberSendSms(phoneNumberId: phoneNumberId, testPhoneNumberOptions: testPhoneNumberOptions, xTestId: xTestId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

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