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

EmergencyAddress createEmergencyAddress(createEmergencyAddressOptions)

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = PhoneControllerApi()
val createEmergencyAddressOptions : CreateEmergencyAddressOptions =  // CreateEmergencyAddressOptions | 
try {
    val result : EmergencyAddress = apiInstance.createEmergencyAddress(createEmergencyAddressOptions)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling PhoneControllerApi#createEmergencyAddress")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling PhoneControllerApi#createEmergencyAddress")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
createEmergencyAddressOptions CreateEmergencyAddressOptions

Return type

EmergencyAddress

Authorization

Configure API_KEY: ApiClient.apiKey["x-api-key"] = "" ApiClient.apiKeyPrefix["x-api-key"] = ""

HTTP request headers

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

EmptyResponseDto deleteEmergencyAddress(addressId)

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = PhoneControllerApi()
val addressId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | 
try {
    val result : EmptyResponseDto = apiInstance.deleteEmergencyAddress(addressId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling PhoneControllerApi#deleteEmergencyAddress")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling PhoneControllerApi#deleteEmergencyAddress")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
addressId java.util.UUID

Return type

EmptyResponseDto

Authorization

Configure API_KEY: ApiClient.apiKey["x-api-key"] = "" ApiClient.apiKeyPrefix["x-api-key"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

deletePhoneNumber(phoneNumberId)

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = PhoneControllerApi()
val phoneNumberId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | 
try {
    apiInstance.deletePhoneNumber(phoneNumberId)
} catch (e: ClientException) {
    println("4xx response calling PhoneControllerApi#deletePhoneNumber")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling PhoneControllerApi#deletePhoneNumber")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
phoneNumberId java.util.UUID

Return type

null (empty response body)

Authorization

Configure API_KEY: ApiClient.apiKey["x-api-key"] = "" ApiClient.apiKeyPrefix["x-api-key"] = ""

HTTP request headers

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

EmergencyAddress getEmergencyAddress(addressId)

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = PhoneControllerApi()
val addressId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | 
try {
    val result : EmergencyAddress = apiInstance.getEmergencyAddress(addressId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling PhoneControllerApi#getEmergencyAddress")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling PhoneControllerApi#getEmergencyAddress")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
addressId java.util.UUID

Return type

EmergencyAddress

Authorization

Configure API_KEY: ApiClient.apiKey["x-api-key"] = "" ApiClient.apiKeyPrefix["x-api-key"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

kotlin.collections.List getEmergencyAddresses()

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = PhoneControllerApi()
try {
    val result : kotlin.collections.List<EmergencyAddressDto> = apiInstance.getEmergencyAddresses()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling PhoneControllerApi#getEmergencyAddresses")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling PhoneControllerApi#getEmergencyAddresses")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

kotlin.collections.List

Authorization

Configure API_KEY: ApiClient.apiKey["x-api-key"] = "" ApiClient.apiKeyPrefix["x-api-key"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

PhoneNumberDto getPhoneNumber(phoneNumberId)

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = PhoneControllerApi()
val phoneNumberId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | 
try {
    val result : PhoneNumberDto = apiInstance.getPhoneNumber(phoneNumberId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling PhoneControllerApi#getPhoneNumber")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling PhoneControllerApi#getPhoneNumber")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
phoneNumberId java.util.UUID

Return type

PhoneNumberDto

Authorization

Configure API_KEY: ApiClient.apiKey["x-api-key"] = "" ApiClient.apiKeyPrefix["x-api-key"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = PhoneControllerApi()
val phoneCountry : kotlin.String = phoneCountry_example // kotlin.String | Optional phone country
val page : kotlin.Int = 56 // kotlin.Int | Optional page  for list pagination
val size : kotlin.Int = 56 // kotlin.Int | Optional page size for list pagination
val sort : kotlin.String = sort_example // kotlin.String | Optional createdAt sort direction ASC or DESC
val since : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter by created at after the given timestamp
val before : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter by created at before the given timestamp
try {
    val result : PagePhoneNumberProjection = apiInstance.getPhoneNumbers(phoneCountry, page, size, sort, since, before)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling PhoneControllerApi#getPhoneNumbers")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling PhoneControllerApi#getPhoneNumbers")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
phoneCountry kotlin.String Optional phone country [optional] [enum: US, GB]
page kotlin.Int Optional page for list pagination [optional] [default to 0]
size kotlin.Int Optional page size for list pagination [optional] [default to 20]
sort kotlin.String Optional createdAt sort direction ASC or DESC [optional] [default to ASC] [enum: ASC, DESC]
since java.time.OffsetDateTime Filter by created at after the given timestamp [optional]
before java.time.OffsetDateTime Filter by created at before the given timestamp [optional]

Return type

PagePhoneNumberProjection

Authorization

Configure API_KEY: ApiClient.apiKey["x-api-key"] = "" ApiClient.apiKeyPrefix["x-api-key"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

kotlin.collections.List getPhonePlans()

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = PhoneControllerApi()
try {
    val result : kotlin.collections.List<PhonePlanDto> = apiInstance.getPhonePlans()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling PhoneControllerApi#getPhonePlans")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling PhoneControllerApi#getPhonePlans")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

kotlin.collections.List

Authorization

Configure API_KEY: ApiClient.apiKey["x-api-key"] = "" ApiClient.apiKeyPrefix["x-api-key"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

testPhoneNumberSendSms(phoneNumberId, testPhoneNumberOptions, xTestId)

Example

// Import classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = PhoneControllerApi()
val phoneNumberId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | 
val testPhoneNumberOptions : TestPhoneNumberOptions =  // TestPhoneNumberOptions | 
val xTestId : kotlin.String = xTestId_example // kotlin.String | 
try {
    apiInstance.testPhoneNumberSendSms(phoneNumberId, testPhoneNumberOptions, xTestId)
} catch (e: ClientException) {
    println("4xx response calling PhoneControllerApi#testPhoneNumberSendSms")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling PhoneControllerApi#testPhoneNumberSendSms")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
phoneNumberId java.util.UUID
testPhoneNumberOptions TestPhoneNumberOptions
xTestId kotlin.String [optional]

Return type

null (empty response body)

Authorization

Configure API_KEY: ApiClient.apiKey["x-api-key"] = "" ApiClient.apiKeyPrefix["x-api-key"] = ""

HTTP request headers

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