Retrieves a set of geographic Regions.
A RegionsResponse containing the requested Regions.
Use this method to get a set of Regions. Mostly you will use this method to find a suitable location for a car rental request. Because the regional struture is a tree-node-like datastructure, you are able to either load the entire region list or only a part of it. Partial loads can be achieved by passing a parent region id, the order of levels, a country code or a name wildcard to load regions for.
To comprehend the responsibility of a Region within the complete car rental process, it may be helpful to imagine the regional structure as a tree-node-like datastructure:
To point it out more clearly, Regions are used to categorize geographical areas and group together Locations. Consequently, you will most likely use Regions to search suitable car rental locations.
For example, to get started with the "location finding process", you first can obtain a list of topmost (level 1, root or country level) regions available. Afterwards, you may get the available child regions for a specific root region again using GetRegions.
Another useful way in finding the correct Region would be to specify a Name wildcard. This way you may search and query regions by name. Note that name wildcard search is language-dependent. In addition the search term supports following wildcard patterns:
Pattern | Description |
---|---|
* (Asterisk) |
Matches any character occuring zero or more times in place of pattern. |
? (Question Mark) |
Matches any character occuring exactly once in place of pattern. |
Use Case Scenario | Resolution Path |
---|---|
You want to provide the end user with a list of available regions for selection. |
Basic Path
|
You want to get the direct (subsequent) child regions of a specific region. | Query regions with ParentId set to the parent region's id and Levels set to 1. |
You want to get the direct (subsequent) child regions of a specific region, whereby you want the result limited to regions which support a specific LocationMeetingType. | Query regions with ParentId set to the parent region's id and Levels set to 1. Additionally set the MeetingAtAirportPreference, MeetingAtCounterPreference, MeetingAtSpecialAddressPreference as preferred. |
You want to check if a region exists for a destination name directly entered by user. | Query regions with Name set to the name entered by user and with LanguageCode set to the ISO 639 two letter language code in which the name is considered to be. |
Error Code | Description |
---|---|
E_INTERNAL_SERVICE | An internal service error occured during the process. |
E_TICKET_TOKEN_INVALID | The provided token is invalid. This error occurs if:
|
E_REGION_NOT_FOUND | The requested regions cannot be found. This error occurs if:
|
E_PARENT_REGION_NOT_FOUND | The requested parent region cannot be found. |
E_COUNTRY_NOT_FOUND | The associated country for specified country code cannot be found. |
E_REQUEST_AMBIGIOUS | The performed request ambigious. This error occurs if:
|
E_REQUEST_INVALID | The performed request is invalid or malformed. |
Warning Code | Description |
---|---|
W_LANGUAGE_NOT_SUPPORTED | The requested language code is not supported for localization. Using default language instead. |
Example 1: Get a list of toplevel / root regions available (usually countries) in english language
[C#]
RegionsRequest rq = new RegionsRequest();
rq.Ticket = this.serviceTicket;
rq.Operation.Target = OperationTarget.Test;
rq.Level = 1;
rq.LanguageCode = "EN";
RegionsResponse rs = this.service.GetRegions(rq);
foreach (Region rootRegion in rs.Region)
{
Console.WriteLine("Root Region {0} = {1}", rootRegion.Id, rootRegion.Name);
}
Example 2: Get all regions for Spain (ES) in german language [C#]
RegionsRequest rq = new RegionsRequest();
rq.Operation.Target = OperationTarget.Test;
rq.CountryCode = "ES";
rq.LanguageCode = "DE";
RegionsResponse rs = this.service.GetRegions(rq);
CarRentalAgentService Class | SunnyCars.Services.Osi.WsReservation Namespace