github.com/twilio/twilio-go@v1.20.1/rest/api/v2010/docs/AccountsIncomingPhoneNumbersApi.md (about)

     1  # AccountsIncomingPhoneNumbersApi
     2  
     3  All URIs are relative to *https://api.twilio.com*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**CreateIncomingPhoneNumber**](AccountsIncomingPhoneNumbersApi.md#CreateIncomingPhoneNumber) | **Post** /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json | 
     8  [**DeleteIncomingPhoneNumber**](AccountsIncomingPhoneNumbersApi.md#DeleteIncomingPhoneNumber) | **Delete** /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json | 
     9  [**FetchIncomingPhoneNumber**](AccountsIncomingPhoneNumbersApi.md#FetchIncomingPhoneNumber) | **Get** /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json | 
    10  [**ListIncomingPhoneNumber**](AccountsIncomingPhoneNumbersApi.md#ListIncomingPhoneNumber) | **Get** /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json | 
    11  [**UpdateIncomingPhoneNumber**](AccountsIncomingPhoneNumbersApi.md#UpdateIncomingPhoneNumber) | **Post** /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json | 
    12  
    13  
    14  
    15  ## CreateIncomingPhoneNumber
    16  
    17  > ApiV2010IncomingPhoneNumber CreateIncomingPhoneNumber(ctx, optional)
    18  
    19  
    20  
    21  Purchase a phone-number for the account.
    22  
    23  ### Path Parameters
    24  
    25  This endpoint does not need any path parameter.
    26  
    27  ### Other Parameters
    28  
    29  Other parameters are passed through a pointer to a CreateIncomingPhoneNumberParams struct
    30  
    31  
    32  Name | Type | Description
    33  ------------- | ------------- | -------------
    34  **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource.
    35  **ApiVersion** | **string** | The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`.
    36  **FriendlyName** | **string** | A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number.
    37  **SmsApplicationSid** | **string** | The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application.
    38  **SmsFallbackMethod** | **string** | The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`.
    39  **SmsFallbackUrl** | **string** | The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`.
    40  **SmsMethod** | **string** | The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`.
    41  **SmsUrl** | **string** | The URL we should call when the new phone number receives an incoming SMS message.
    42  **StatusCallback** | **string** | The URL we should call using the `status_callback_method` to send status information to your application.
    43  **StatusCallbackMethod** | **string** | The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
    44  **VoiceApplicationSid** | **string** | The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa.
    45  **VoiceCallerIdLookup** | **bool** | Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`.
    46  **VoiceFallbackMethod** | **string** | The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`.
    47  **VoiceFallbackUrl** | **string** | The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`.
    48  **VoiceMethod** | **string** | The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`.
    49  **VoiceUrl** | **string** | The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set.
    50  **EmergencyStatus** | **string** | 
    51  **EmergencyAddressSid** | **string** | The SID of the emergency address configuration to use for emergency calling from the new phone number.
    52  **TrunkSid** | **string** | The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa.
    53  **IdentitySid** | **string** | The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations.
    54  **AddressSid** | **string** | The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations.
    55  **VoiceReceiveMode** | **string** | 
    56  **BundleSid** | **string** | The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations.
    57  **PhoneNumber** | **string** | The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format.  E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234.
    58  **AreaCode** | **string** | The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only).
    59  
    60  ### Return type
    61  
    62  [**ApiV2010IncomingPhoneNumber**](ApiV2010IncomingPhoneNumber.md)
    63  
    64  ### Authorization
    65  
    66  [accountSid_authToken](../README.md#accountSid_authToken)
    67  
    68  ### HTTP request headers
    69  
    70  - **Content-Type**: application/x-www-form-urlencoded
    71  - **Accept**: application/json
    72  
    73  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
    74  [[Back to Model list]](../README.md#documentation-for-models)
    75  [[Back to README]](../README.md)
    76  
    77  
    78  ## DeleteIncomingPhoneNumber
    79  
    80  > DeleteIncomingPhoneNumber(ctx, Sidoptional)
    81  
    82  
    83  
    84  Delete a phone-numbers belonging to the account used to make the request.
    85  
    86  ### Path Parameters
    87  
    88  
    89  Name | Type | Description
    90  ------------- | ------------- | -------------
    91  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
    92  **Sid** | **string** | The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete.
    93  
    94  ### Other Parameters
    95  
    96  Other parameters are passed through a pointer to a DeleteIncomingPhoneNumberParams struct
    97  
    98  
    99  Name | Type | Description
   100  ------------- | ------------- | -------------
   101  **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resources to delete.
   102  
   103  ### Return type
   104  
   105   (empty response body)
   106  
   107  ### Authorization
   108  
   109  [accountSid_authToken](../README.md#accountSid_authToken)
   110  
   111  ### HTTP request headers
   112  
   113  - **Content-Type**: Not defined
   114  - **Accept**: Not defined
   115  
   116  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   117  [[Back to Model list]](../README.md#documentation-for-models)
   118  [[Back to README]](../README.md)
   119  
   120  
   121  ## FetchIncomingPhoneNumber
   122  
   123  > ApiV2010IncomingPhoneNumber FetchIncomingPhoneNumber(ctx, Sidoptional)
   124  
   125  
   126  
   127  Fetch an incoming-phone-number belonging to the account used to make the request.
   128  
   129  ### Path Parameters
   130  
   131  
   132  Name | Type | Description
   133  ------------- | ------------- | -------------
   134  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   135  **Sid** | **string** | The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to fetch.
   136  
   137  ### Other Parameters
   138  
   139  Other parameters are passed through a pointer to a FetchIncomingPhoneNumberParams struct
   140  
   141  
   142  Name | Type | Description
   143  ------------- | ------------- | -------------
   144  **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to fetch.
   145  
   146  ### Return type
   147  
   148  [**ApiV2010IncomingPhoneNumber**](ApiV2010IncomingPhoneNumber.md)
   149  
   150  ### Authorization
   151  
   152  [accountSid_authToken](../README.md#accountSid_authToken)
   153  
   154  ### HTTP request headers
   155  
   156  - **Content-Type**: Not defined
   157  - **Accept**: application/json
   158  
   159  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   160  [[Back to Model list]](../README.md#documentation-for-models)
   161  [[Back to README]](../README.md)
   162  
   163  
   164  ## ListIncomingPhoneNumber
   165  
   166  > []ApiV2010IncomingPhoneNumber ListIncomingPhoneNumber(ctx, optional)
   167  
   168  
   169  
   170  Retrieve a list of incoming-phone-numbers belonging to the account used to make the request.
   171  
   172  ### Path Parameters
   173  
   174  This endpoint does not need any path parameter.
   175  
   176  ### Other Parameters
   177  
   178  Other parameters are passed through a pointer to a ListIncomingPhoneNumberParams struct
   179  
   180  
   181  Name | Type | Description
   182  ------------- | ------------- | -------------
   183  **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resources to read.
   184  **Beta** | **bool** | Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`.
   185  **FriendlyName** | **string** | A string that identifies the IncomingPhoneNumber resources to read.
   186  **PhoneNumber** | **string** | The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit.
   187  **Origin** | **string** | Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included.
   188  **PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000.
   189  **Limit** | **int** | Max number of records to return.
   190  
   191  ### Return type
   192  
   193  [**[]ApiV2010IncomingPhoneNumber**](ApiV2010IncomingPhoneNumber.md)
   194  
   195  ### Authorization
   196  
   197  [accountSid_authToken](../README.md#accountSid_authToken)
   198  
   199  ### HTTP request headers
   200  
   201  - **Content-Type**: Not defined
   202  - **Accept**: application/json
   203  
   204  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   205  [[Back to Model list]](../README.md#documentation-for-models)
   206  [[Back to README]](../README.md)
   207  
   208  
   209  ## UpdateIncomingPhoneNumber
   210  
   211  > ApiV2010IncomingPhoneNumber UpdateIncomingPhoneNumber(ctx, Sidoptional)
   212  
   213  
   214  
   215  Update an incoming-phone-number instance.
   216  
   217  ### Path Parameters
   218  
   219  
   220  Name | Type | Description
   221  ------------- | ------------- | -------------
   222  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   223  **Sid** | **string** | The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to update.
   224  
   225  ### Other Parameters
   226  
   227  Other parameters are passed through a pointer to a UpdateIncomingPhoneNumberParams struct
   228  
   229  
   230  Name | Type | Description
   231  ------------- | ------------- | -------------
   232  **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update.  For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers).
   233  **AccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update.  For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers).
   234  **ApiVersion** | **string** | The API version to use for incoming calls made to the phone number. The default is `2010-04-01`.
   235  **FriendlyName** | **string** | A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number.
   236  **SmsApplicationSid** | **string** | The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application.
   237  **SmsFallbackMethod** | **string** | The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`.
   238  **SmsFallbackUrl** | **string** | The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`.
   239  **SmsMethod** | **string** | The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`.
   240  **SmsUrl** | **string** | The URL we should call when the phone number receives an incoming SMS message.
   241  **StatusCallback** | **string** | The URL we should call using the `status_callback_method` to send status information to your application.
   242  **StatusCallbackMethod** | **string** | The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
   243  **VoiceApplicationSid** | **string** | The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa.
   244  **VoiceCallerIdLookup** | **bool** | Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`.
   245  **VoiceFallbackMethod** | **string** | The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`.
   246  **VoiceFallbackUrl** | **string** | The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`.
   247  **VoiceMethod** | **string** | The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`.
   248  **VoiceUrl** | **string** | The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set.
   249  **EmergencyStatus** | **string** | 
   250  **EmergencyAddressSid** | **string** | The SID of the emergency address configuration to use for emergency calling from this phone number.
   251  **TrunkSid** | **string** | The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa.
   252  **VoiceReceiveMode** | **string** | 
   253  **IdentitySid** | **string** | The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations.
   254  **AddressSid** | **string** | The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations.
   255  **BundleSid** | **string** | The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations.
   256  
   257  ### Return type
   258  
   259  [**ApiV2010IncomingPhoneNumber**](ApiV2010IncomingPhoneNumber.md)
   260  
   261  ### Authorization
   262  
   263  [accountSid_authToken](../README.md#accountSid_authToken)
   264  
   265  ### HTTP request headers
   266  
   267  - **Content-Type**: application/x-www-form-urlencoded
   268  - **Accept**: application/json
   269  
   270  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   271  [[Back to Model list]](../README.md#documentation-for-models)
   272  [[Back to README]](../README.md)
   273