Interface ActiveNumberService

All Known Subinterfaces:
NumbersService

public interface ActiveNumberService
Active Number Service
  • Method Details

    • list

      Lists active numbers for a project (using default parameters)

      Lists all active numbers for a project.

      Returns:
      ActiveNumbersListResponse
      Throws:
      ApiException - if fails to make API call
    • list

      Lists active numbers for a project

      Lists all active numbers for a project.

      Parameters:
      queryParameter - (optional)
      Returns:
      ActiveNumbersListResponse
      Throws:
      ApiException - if fails to make API call
    • deprovisionEmergencyAddress

      void deprovisionEmergencyAddress(String phoneNumber) throws ApiException
      Remove the emergency address for a number.

      With this endpoint, you can deprovision the emergency address associated with this number.

      Parameters:
      phoneNumber - Output only. The phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format with leading `+`. (required)
      Throws:
      ApiException - if fails to make API call
    • get

      ActiveNumber get(String phoneNumber) throws ApiException
      Retrieve an active phone number

      Retrieve a specific active phone number.

      Parameters:
      phoneNumber - Output only. The phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format with leading `+`. (required)
      Returns:
      ActiveNumber
      Throws:
      ApiException - if fails to make API call
    • getEmergencyAddress

      EmergencyAddress getEmergencyAddress(String phoneNumber) throws ApiException
      Get the emergency address for a number

      With this endpoint, you can retrieve the emergency address associated with this number.

      Parameters:
      phoneNumber - Output only. The phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format with leading `+`. (required)
      Returns:
      EmergencyAddress
      Throws:
      ApiException - if fails to make API call
    • provisionEmergencyAddress

      EmergencyAddress provisionEmergencyAddress(String phoneNumber, EmergencyAddressRequest emergencyAddressRequest) throws ApiException
      Add a emergency address for a number

      With this endpoint, you can provision an emergency address associated with this number.

      Parameters:
      phoneNumber - Output only. The phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format with leading `+`. (required)
      emergencyAddressRequest - Request to provision an emergency address for a number. (optional)
      Returns:
      EmergencyAddress
      Throws:
      ApiException - if fails to make API call
    • release

      ActiveNumber release(String phoneNumber) throws ApiException
      Release an active number from the project

      With this endpoint, you can cancel your subscription for a specific phone number.

      Parameters:
      phoneNumber - Output only. The phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format with leading `+`. (required)
      Returns:
      ActiveNumber
      Throws:
      ApiException - if fails to make API call
    • update

      ActiveNumber update(String phoneNumber, ActiveNumberUpdateRequest activeNumberUpdateRequest) throws ApiException
      Update an active phone number

      Update an active phone number. You can perform the following updates: * Update the name that displays for a customer by modifying the `displayName` parameter. * Unlink the number from an SMS service or campaign by updating the `smsConfiguration` configuration object. To unlink a number, submit the request with an empty string (`””`) in the service plan ID or campaign ID fields. * Before linking a number to a new service or campaign, it must be unlinked from any existing service or campaign. Then, link the number to a new SMS service or campaign by updating the service plan ID or campaign ID with the new desired value. * Update the Voice app to which the number is assigned by using the voiceConfiguration object. You can update both SMS and Voice in the same object by including both configuration objects. If you only need to update either Voice or SMS, simply omit the other object. If you pass an empty configuration object, the request will fail.

      Parameters:
      phoneNumber - Output only. The phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format with leading `+`. (required)
      activeNumberUpdateRequest - The number body to be updated. (optional)
      Returns:
      ActiveNumber
      Throws:
      ApiException - if fails to make API call
    • validateEmergencyAddress

      ValidateAddressResponse validateEmergencyAddress(String phoneNumber, EmergencyAddressRequest emergencyAddressRequest) throws ApiException
      Validate the emergency address for a number.

      With this endpoint, you can validate the emergency address associated with this number.

      Parameters:
      phoneNumber - Output only. The phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format with leading `+`. (required)
      emergencyAddressRequest - Request to validate an emergency address for a number. (optional)
      Returns:
      ValidateAddressResponse
      Throws:
      ApiException - if fails to make API call