[This is preliminary documentation and is subject to change.]
Returns a list of countries supported by Phone Sherpa. Countries are supported if they have at least 1 active carrier within the Phone Sherpa system.
Namespace:
PhoneSherpa.ServicesAssembly: App_Code.fxrph_yi (in App_Code.fxrph_yi)
Version: 0.0.0.0
Syntax
| C# |
|---|
public WS..::.GetCountryListResult GetCountryList( string AccessKey ) |
| Visual Basic (Declaration) |
|---|
Public Function GetCountryList ( _ AccessKey As String _ ) As WS..::.GetCountryListResult |
| JScript |
|---|
public function GetCountryList( AccessKey : String ) : WS..::.GetCountryListResult |
Parameters
- AccessKey
- Type: System..::.String
Security key allocated to a developer enabling access to the web service API.
Return Value
An array list of supported countries within the Phone Sherpa system. Each item contains the name, ISO code, and Phone Sherpa internal ID for a given country.
Remarks
This function is most often used in support of an end user interface. The country list can be placed in a drop down or similar UI element and the user can select thier country. The selected country ID value is used in several API calls.
CopyVB.NET
If the user is not presented this list explicitly, it is up to the integrator to map the Phone Sherpa country ID values into its own notion of country or user account information.
Below is an example of how to use this function:
Public Sub Populate_Countries(ByVal ddCountry As DropDownList) Dim SherpaService As New PhoneSherpa.Services.WS Dim Country_Response As PhoneSherpa.Services.GetCountryListResult = Nothing Dim CountryItem As PhoneSherpa.Services.Country = Nothing Dim DefaultCountryID As Integer = 226 'USA Country_Response = SherpaService.GetCountryList("My_WSAccessKey") If Country_Response.Result.ErrorCode = 0 Then For Each CountryItem In Country_Response.Countries If CountryItem.Id = DefaultCountryID Then ddCountry.Items.Add(New ListItem(CountryItem.Name, CountryItem.Id.ToString)) ddCountry.Items(ddCountry.Items.Count - 1).Selected = True Else ddCountry.Items.Add(New ListItem(CountryItem.Name, CountryItem.Id.ToString)) End If Next Else 'error - failed calling the get country list call. Handle this here. End If End Sub