Woosmap for Flutter - API Services
Get access to Woosmap services for your native mobile developments on hybrid flutter development.
The Woosmap API is a RESTful API built on HTTP. It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body.
Localities API
Woosmap Localities API is a web service that returns a great amount of geographical places in response to an HTTP request. Among others are city names, postal codes, suburbs, addresses or airports. Request is done over HTTPS using GET. Response is formatted as JSON. You must specify a key in your request, included as the value of a key parameter for your public key or private_key for your private key. This key identifies your application for purposes of quota management.
-
Autocomplete for Localities
Autocomplete on worldwide suggestions for a for text-based geographic searches. It can match on full words as well as substrings. You can therefore send queries as the user types, to provide on-the-fly city names, postal codes or suburb name suggestions.
Request parameters
input
: The text string on which to search, for example: “london”types
: “locality” “postal_code” “address” “admin_level” “country” “airport” “train_station” “metro_station” “shopping” “museum” “tourist_attraction” “amusement_park” “art_gallery” “zoo”components
: A grouping of places to which you would like to restrict your results. Components can be used to filter over countries.language
: The language code, using ISO 3166-1 Alpha-2 country codes, indicating in which language the results should be returnedlocation
: This parameter is used to add a bias to the autocomplete feature. The location defines the point around which to retrieve results in priority.radius
: This parameter may be used in addition to the location parameter to define the distance in meters within which the API will return results in priority.data
: Two values for this parameter: standard or advanced. By default, if the parameter is not defined, value is set as standard. The advanced value opens suggestions to worldwide postal codes in addition to postal codes for Western Europe. A dedicated option subject to specific billing on your license is needed to use this parameter.extended
:If set, this parameter allows a refined search over locality names that bears the same postal code.customDescription
: This parameter allows to choose the description format for all or some of the suggestion types selected. The custom formats are described as follows (available fields depend on the returned type):custom_description=type_A:"{field_1}, {field_2}, [...]"|type_B:"{field_1}, {field_2}, [...]"
LocalitiesAutocompleteRequest request = LocalitiesAutocompleteRequest(
input: "87 Rue montmatre",
);
WoosmapApi woosmapApi = WoosmapApi(WoosKey(publicKey: "YOUR-PUBLIC-KEY"));
woosmapApi.localities.autocomplete(request).then((value) {
debugPrint(jsonEncode(value?.toJson()));
}).catchError((error) {
debugPrint("An error occurred: ${error.message}");
});
-
Details of a Locality
Provides details of an autocomplete suggestion (using the suggestion’s
publicId
).Request parameters
publicId
: A textual identifier that uniquely identifies a locality, returned from a Localities Autocomplete.language
: The language code, using ISO 3166-1 Alpha-2 country codes, indicating in which language the results should be returnedfields
: Used to limit the returning fields, default it is geometrycountryCodeFormat
: To specify the format for the short country code expected to be returned in the address_components field (default is alpha3).
LocalitiesDetailsRequest request = LocalitiesDetailsRequest(
publicId: "1234567890",
);
WoosmapApi woosmapApi = WoosmapApi(WoosKey(publicKey: "YOUR-PUBLIC-KEY"));
woosmapApi.localities.details(request).then((value) {
debugPrint(jsonEncode(value?.toJson()));
}).catchError((error) {
debugPrint("An error occurred: ${error.message}");
});
-
Geocode a locality or Reverse Geocode a latlng
Provides details for an address or a geographic position. Either parameter
address
orlatlng
is required.Request parameters
address
: The input string to geocode. Can represent an address, a street, a locality or a postal code.latLng
: The latlng parameter is used for reverse geocoding, it’s required if the address parameter is missing.components
: A grouping of places to which you would like to restrict your results. Components can be used to filter over countries. Countries must be passed as an ISO 3166-1 Alpha-2 or Alpha-3 compatible country code.language
: The language code, using ISO 3166-1 Alpha-2 country codes, indicating in which language the results should be returnedfields
: Used to limit the returning fieldsdata
: Two values for this parameter: standard or advanced. By default, if the parameter is not defined, value is set as standard. The advanced value opens suggestions to worldwide postal codes in addition to postal codes for Western Europe. A dedicated option subject to specific billing on your license is needed to use this parameter.countryCodeFormat
: To specify the format for the short country code expected to be returned in the address_components field.listSubBuildings
: Allows to retrieve all addresses at the same location for a common street number or building. WhenlistSubBuildings=true
and according to actual addresses at the provided location, results may contain an additional keysubBuildings
as a list of address summaries. It will provide apublicId
and adescription
for every address at the provided location (flats, organisations..).
LocalitiesGeocodeRequest request = LocalitiesGeocodeRequest(
address: "87 Rue montmatre",
);
WoosmapApi woosmapApi = WoosmapApi(WoosKey(publicKey: "YOUR-PUBLIC-KEY"));
woosmapApi.localities.geocode(request).then((value) {
debugPrint(jsonEncode(value?.toJson()));
}).catchError((error) {
debugPrint("An error occurred: ${error.message}");
});
Store Search API
Stores Search API lets you search among your own Points of Interest. Find stores by geography, by attributes or by autocomplete on store names.
-
Autocomplete for assets
Autocomplete on localizedNames with highlighted results on asset name. Use the field localized in your query parameter to search for localized names.
Request parameters
query
: Search query combining one or more search clauses. Example:query=name:'My cool store'|type:'click_and_collect'
language
: The preferred language to match against name (defaults on Accept-Language header)limit
: You can then request stores by page usinglimit
parameters
StoresAutocompleteRequest request = StoresAutocompleteRequest(
query: "name:'My cool store'|type:'click_and_collect'",
);
WoosmapApi woosmapApi = WoosmapApi(WoosKey(publicKey: "YOUR-PUBLIC-KEY"));
woosmapApi.stores.autocomplete(request).then((value) {
debugPrint(jsonEncode(value?.toJson()));
}).catchError((error) {
debugPrint("An error occurred: ${error.message}");
});
-
Search for assets
Used to retrieve assets from query.
Request parameters
query
: Search query combining one or more search clauses. Example:query=name:'My cool store'|type:'click_and_collect'
latLng
: To bias the results around a specific latlngradius
: To bias the results within a given circular area.polyline
: Find stores nearby an encoded polyline and inside a defined radius.storesByPage
: You can then request stores by page usingpage
andstoresByPage
parameters (Default is 100, max is 300).page
: Page number when accessing paginated storeszone
: whether to search for stores intersecting a zone
StoresSearchRequest request = StoresSearchRequest(
query: "idStore:31625406",
);
WoosmapApi woosmapApi = WoosmapApi(WoosKey(publicKey: "YOUR-PUBLIC-KEY"));
woosmapApi.stores.search(request).then((value) {
debugPrint(jsonEncode(value?.toJson()));
}).catchError((error) {
debugPrint("An error occurred: ${error.message}");
});