All URIs are relative to https://api.telnyx.com/v2
Method | HTTP request | Description |
---|---|---|
deletePhoneNumber | DELETE /phone_numbers/{id} | Delete a phone number |
enableEmergencyPhoneNumber | POST /phone_numbers/{id}/actions/enable_emergency | Enable emergency for a phone number |
findPhoneNumberVoices | GET /phone_numbers/voice | List voice settings for multiple phone numbers |
findPhoneNumbers | GET /phone_numbers | List all phone numbers |
getPhoneNumber | GET /phone_numbers/{id} | Get the settings for a phone number |
listPhoneNumberMessagingSettings | GET /phone_numbers/messaging | List all phone numbers' messaging settings |
retrievePhoneNumberMessagingSettings | GET /phone_numbers/{id}/messaging | Retrieve the messaging settings for a phone number |
retrievePhoneNumberVoice | GET /phone_numbers/{id}/voice | Get the voice settings for a phone number |
updatePhoneNumber | PATCH /phone_numbers/{id} | Update the settings for a phone number |
updatePhoneNumberMessagingSettings | PATCH /phone_numbers/{id}/messaging | Update the messaging settings for a phone number |
updatePhoneNumberVoice | PATCH /phone_numbers/{id}/voice | Update the voice settings for a phone number |
DeletePhoneNumberResponse deletePhoneNumber(id)
Delete a phone number
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
String id = "id_example"; // String | Identifies the resource.
try {
DeletePhoneNumberResponse result = apiInstance.deletePhoneNumber(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#deletePhoneNumber");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | Identifies the resource. |
- Content-Type: Not defined
- Accept: application/json
PhoneNumberEnableEmergency enableEmergencyPhoneNumber(body, id)
Enable emergency for a phone number
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
PhoneNumberEnableEmergency body = new PhoneNumberEnableEmergency(); // PhoneNumberEnableEmergency |
String id = "id_example"; // String | Identifies the resource.
try {
PhoneNumberEnableEmergency result = apiInstance.enableEmergencyPhoneNumber(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#enableEmergencyPhoneNumber");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | PhoneNumberEnableEmergency | ||
id | String | Identifies the resource. |
- Content-Type: application/json
- Accept: application/json
ListPhoneNumberVoicesResponse findPhoneNumberVoices(pageNumber, pageSize, filterPhoneNumber, filterConnectionNameContains, filterUsagePaymentMethod, sort)
List voice settings for multiple phone numbers
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
Integer pageNumber = 1; // Integer | The page number to load
Integer pageSize = 20; // Integer | The size of the page
String filterPhoneNumber = "filterPhoneNumber_example"; // String | Filter by phone number. Requires at least three digits. Non-numerical characters will result in no values being returned.
String filterConnectionNameContains = "filterConnectionNameContains_example"; // String | Filter contains connection name. Requires at least three characters
String filterUsagePaymentMethod = "filterUsagePaymentMethod_example"; // String | Filter by usage_payment_method.
String sort = "sort_example"; // String | Specifies the sort order for results. If not given, results are sorted by created_at in descending order
try {
ListPhoneNumberVoicesResponse result = apiInstance.findPhoneNumberVoices(pageNumber, pageSize, filterPhoneNumber, filterConnectionNameContains, filterUsagePaymentMethod, sort);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#findPhoneNumberVoices");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
pageNumber | Integer | The page number to load | [optional] [default to 1] [enum: ] |
pageSize | Integer | The size of the page | [optional] [default to 20] [enum: ] |
filterPhoneNumber | String | Filter by phone number. Requires at least three digits. Non-numerical characters will result in no values being returned. | [optional] |
filterConnectionNameContains | String | Filter contains connection name. Requires at least three characters | [optional] |
filterUsagePaymentMethod | String | Filter by usage_payment_method. | [optional] [enum: pay-per-minute, channel] |
sort | String | Specifies the sort order for results. If not given, results are sorted by created_at in descending order | [optional] [enum: purchased_at, phone_number, connection_name, usage_payment_method] |
- Content-Type: Not defined
- Accept: application/json
ListPhoneNumbersResponse findPhoneNumbers(pageNumber, pageSize, filterTag, filterPhoneNumber, filterStatus, filterVoiceConnectionNameContains, filterVoiceConnectionNameStartsWith, filterVoiceConnectionNameEndsWith, filterVoiceConnectionNameEq, filterUsagePaymentMethod, filterBillingGroupId, sort)
List all phone numbers
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
Integer pageNumber = 1; // Integer | The page number to load
Integer pageSize = 20; // Integer | The size of the page
String filterTag = "filterTag_example"; // String | Filter by phone number tags
String filterPhoneNumber = "filterPhoneNumber_example"; // String | Filter by phone number. Requires at least three digits. Non-numerical characters will result in no values being returned.
String filterStatus = "filterStatus_example"; // String | Filter by phone number status
String filterVoiceConnectionNameContains = "filterVoiceConnectionNameContains_example"; // String | Filter contains connection name. Requires at least three characters
String filterVoiceConnectionNameStartsWith = "filterVoiceConnectionNameStartsWith_example"; // String | Filter starts with connection name. Requires at least three characters
String filterVoiceConnectionNameEndsWith = "filterVoiceConnectionNameEndsWith_example"; // String | Filter ends with connection name. Requires at least three characters
String filterVoiceConnectionNameEq = "filterVoiceConnectionNameEq_example"; // String | Filter by connection name
String filterUsagePaymentMethod = "filterUsagePaymentMethod_example"; // String | Filter by usage_payment_method.
String filterBillingGroupId = "filterBillingGroupId_example"; // String | Filter by the billing_group_id associated with phone numbers. To filter to only phone numbers that have no billing group associated them, set the value of this filter to the string 'null'.
String sort = "sort_example"; // String | Specifies the sort order for results. If not given, results are sorted by created_at in descending order
try {
ListPhoneNumbersResponse result = apiInstance.findPhoneNumbers(pageNumber, pageSize, filterTag, filterPhoneNumber, filterStatus, filterVoiceConnectionNameContains, filterVoiceConnectionNameStartsWith, filterVoiceConnectionNameEndsWith, filterVoiceConnectionNameEq, filterUsagePaymentMethod, filterBillingGroupId, sort);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#findPhoneNumbers");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
pageNumber | Integer | The page number to load | [optional] [default to 1] [enum: ] |
pageSize | Integer | The size of the page | [optional] [default to 20] [enum: ] |
filterTag | String | Filter by phone number tags | [optional] |
filterPhoneNumber | String | Filter by phone number. Requires at least three digits. Non-numerical characters will result in no values being returned. | [optional] |
filterStatus | String | Filter by phone number status | [optional] [enum: purchase_pending, purchase_failed, port_pending, active, deleted, port_failed, emergency_only, ported_out, port_out_pending] |
filterVoiceConnectionNameContains | String | Filter contains connection name. Requires at least three characters | [optional] |
filterVoiceConnectionNameStartsWith | String | Filter starts with connection name. Requires at least three characters | [optional] |
filterVoiceConnectionNameEndsWith | String | Filter ends with connection name. Requires at least three characters | [optional] |
filterVoiceConnectionNameEq | String | Filter by connection name | [optional] |
filterUsagePaymentMethod | String | Filter by usage_payment_method. | [optional] [enum: pay-per-minute, channel] |
filterBillingGroupId | String | Filter by the billing_group_id associated with phone numbers. To filter to only phone numbers that have no billing group associated them, set the value of this filter to the string 'null'. | [optional] |
sort | String | Specifies the sort order for results. If not given, results are sorted by created_at in descending order | [optional] [enum: purchased_at, phone_number, connection_name, usage_payment_method] |
- Content-Type: Not defined
- Accept: application/json
RetrievePhoneNumberResponse getPhoneNumber(id)
Get the settings for a phone number
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
String id = "id_example"; // String | Identifies the resource.
try {
RetrievePhoneNumberResponse result = apiInstance.getPhoneNumber(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#getPhoneNumber");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | Identifies the resource. |
- Content-Type: Not defined
- Accept: application/json
ListMessagingSettingsResponse listPhoneNumberMessagingSettings()
List all phone numbers' messaging settings
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
try {
ListMessagingSettingsResponse result = apiInstance.listPhoneNumberMessagingSettings();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#listPhoneNumberMessagingSettings");
e.printStackTrace();
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
RetrieveMessagingSettingsResponse retrievePhoneNumberMessagingSettings(id)
Retrieve the messaging settings for a phone number
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
String id = "id_example"; // String | Identifies the type of resource.
try {
RetrieveMessagingSettingsResponse result = apiInstance.retrievePhoneNumberMessagingSettings(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#retrievePhoneNumberMessagingSettings");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | Identifies the type of resource. |
RetrieveMessagingSettingsResponse
- Content-Type: Not defined
- Accept: application/json
RetrievePhoneNumberVoiceResponse retrievePhoneNumberVoice(id)
Get the voice settings for a phone number
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
String id = "id_example"; // String | Identifies the resource.
try {
RetrievePhoneNumberVoiceResponse result = apiInstance.retrievePhoneNumberVoice(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#retrievePhoneNumberVoice");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | Identifies the resource. |
RetrievePhoneNumberVoiceResponse
- Content-Type: Not defined
- Accept: application/json
RetrievePhoneNumberResponse updatePhoneNumber(body, id)
Update the settings for a phone number
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
PhoneNumberUpdate body = new PhoneNumberUpdate(); // PhoneNumberUpdate | Updated settings for the phone number
String id = "id_example"; // String | Identifies the resource.
try {
RetrievePhoneNumberResponse result = apiInstance.updatePhoneNumber(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#updatePhoneNumber");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | PhoneNumberUpdate | Updated settings for the phone number | |
id | String | Identifies the resource. |
- Content-Type: application/json
- Accept: application/json
RetrieveMessagingSettingsResponse updatePhoneNumberMessagingSettings(body, id)
Update the messaging settings for a phone number
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
MessagingPhoneNumberUpdate body = new MessagingPhoneNumberUpdate(); // MessagingPhoneNumberUpdate | Updated messaging settings for the phone number
String id = "id_example"; // String | Identifies the type of resource.
try {
RetrieveMessagingSettingsResponse result = apiInstance.updatePhoneNumberMessagingSettings(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#updatePhoneNumberMessagingSettings");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | MessagingPhoneNumberUpdate | Updated messaging settings for the phone number | |
id | String | Identifies the type of resource. |
RetrieveMessagingSettingsResponse
- Content-Type: application/json
- Accept: application/json
RetrievePhoneNumberVoiceResponse updatePhoneNumberVoice(body, id)
Update the voice settings for a phone number
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.NumberConfigurationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
NumberConfigurationsApi apiInstance = new NumberConfigurationsApi();
VoiceUpdate body = new VoiceUpdate(); // VoiceUpdate | Updated voice settings for the phone number
String id = "id_example"; // String | Identifies the resource.
try {
RetrievePhoneNumberVoiceResponse result = apiInstance.updatePhoneNumberVoice(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NumberConfigurationsApi#updatePhoneNumberVoice");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | VoiceUpdate | Updated voice settings for the phone number | |
id | String | Identifies the resource. |
RetrievePhoneNumberVoiceResponse
- Content-Type: application/json
- Accept: application/json