Woosmap for Flutter - API Services

Get access to Woosmap services for your native mobile developments on hybrid flutter development.

  1. Localities API
  2. Store Search API

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.

lib/service_snippet.dart
        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}");
});

    
lib/service_snippet.dart
        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}");
});

    
lib/service_snippet.dart
        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.

lib/service_snippet.dart
        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}");
});

    
lib/service_snippet.dart
        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}");
});

    
Was this article helpful?
Have more questions? Submit a request