You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.
49
+
Phone numbers come in two types; Geographic and Toll-Free. Geographic phone numbers are phone numbers associated with a location, whose area codes are associated with the area code of a geographic location. Toll-Free phone numbers are phone numbers with no associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.
51
50
52
-
All geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.
51
+
### Searching and Purchasing and Releasing numbers
53
52
54
-
### Reserving and Acquiring numbers
53
+
Phone numbers can be searched through the search creation API by providing an area code, quantity of phone numbers, application type, phone number type, and capabilities. The provided quantity of phone numbers will be reserved for ten minutes and can be purchased within this time. If the search is not purchased, the phone numbers will become available to others after ten minutes. If the search is purchased, then the phone numbers are acquired for the Azure resources.
55
54
56
-
Phone numbers can be reserved through the begin_reserve_phone_numbers API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This reservation of phone numbers can either be cancelled or purchased. If the reservation is cancelled, then the phone numbers will become available to others. If the reservation is purchased, then the phone numbers are acquired for the Azure resources.
55
+
Phone numbers can also be released using the release API.
57
56
58
-
### Configuring / Assigning numbers
57
+
##Examples
59
58
60
-
Phone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.
59
+
### Get All Phone Numbers
61
60
62
-
# Examples
63
-
The following section provides several code snippets covering some of the most common Azure Communication Services tasks, including:
For Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.
85
+
You can search for available phone numbers by providing the capabilities of the phone you want to acquire, the phone number type, the assignment type, and the country code. It's worth mentioning that for the toll-free phone number type, proving the area code is optional.
86
+
The result of the search can then be used to purchase the number in the corresponding API.
area_code="833", # Area code is optional for toll-free numbers
99
+
quantity=2, # Quantity is optional. If not set, default is 1
100
+
polling=True
116
101
)
117
-
print(location_options_response)
102
+
search_result = poller.result()
118
103
```
119
104
120
-
### Get Area Codes
105
+
### Purchase Phone Numbers
121
106
122
-
Fetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the GetLocationOptions API.
107
+
The result of your search can be used to purchase the specificied phone numbers. This can be done by passing the `search_id` from the search response to the purchase phone number API.
Copy file name to clipboardExpand all lines: sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/__init__.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@
6
6
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
0 commit comments