I need assistance for api-here geocoding - geocoding

I would like to know how to obtain all London postal codes that start with "W2", for example, something like this. We are using the geocode api but in the postalCode parameter it asks for the exact postal code. We have also tried to use the autocomplete api but I also do not get a list of all the postal codes, it does a search in different parameters and it is not what we need.
This need arises because we are changing from MapServer to Nokia Here and with MapServer the api geocoding if it returns a list of all the postal codes
We are using something like this https://autocomplete.geocoder.api.here.com/6.2/suggest.json?app_id=xxxxxx&app_code=xxxxxxx&query=W2&country=GBR
We would need to be able to indicate in the query a complete or partial postal code
this example verifies what we need
By the way, we are using a payment license, how can I request this assistance?

You can constraint search result upto maximum 20 using geocoding autocomplete API with the below parameter
maxresults = { Valid range: 1 to 20 }
This constraint is as per API design. For detail information kindly go through the below link.
https://developer.here.com/documentation/geocoder-autocomplete/topics/resource-suggest.html

Related

How to validate US zip code by country and state using Google's Geocoding component filtering?

I am using Google's Geocoding API using the component filtering.
To validate the zip code in a specific country I use the following call for example:
https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:94301|country:USA
I want to add another component to indicate the state. According to the documentation I can do it using the "administrativeArea".
I couldn't get it to work.
For example, calling the API with the zip code 94301 and state "Arizona" should return with no values, while the state "California" should return the relevant address.
I tried:
https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:94301|country:USA|administrativeArea=Arizona
You are using administrativeArea=Arizona in components filtering. Please note that web service should use administrative_area=Arizona according to the documentation.
https://developers.google.com/maps/documentation/geocoding/intro#ComponentFiltering
The following components may be used to influence results, but will not be enforced:
route matches the long or short name of a route.
locality matches against locality and sublocality types.
administrative_area matches all the administrative_area levels.
When I execute the following request
https://maps.googleapis.com/maps/api/geocode/json?components=administrative_area%3AArizona%7Cpostal_code%3A94301%7Ccountry%3AUS&key=MY_API_KEY
I get the response
{
"results":[
],
"status":"ZERO_RESULTS"
}
You can also see this in Geocoder tool:
https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/utils/geocoder/#in_administrative_area%3DArizona%26in_postal_code%3D94301%26in_country%3DUS%26options%3Dtrue
https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/utils/geocoder/#q%3D%26in_country%3DUS%26in_administrative_area%3DCalifornia%26in_postal_code%3D94301
I hope this helps!

How to filter mobile devices by list of e-mail address

I'm working with the Google Admin SDK Directory API, more specifically with Mobile Devices. I already used the tool provided by Google here and also created a program using the .Net client library to get all devices with success.
The problem is, I need now to get all the mobile devices filtered by a list of emails. I was able to filter using a single email address like:
https://www.googleapis.com/admin/directory/v1/customer/ZXXXXX/devices
/mobile?projection=BASIC&query=email:EMAIL_HERE&key={YOUR_API_KEY}
But I couldn't find a way to filter using multiple email values like:
query email: email1:#my-domain.com, email2#my-domain.com, email3#my-domain.com
The documentation provided here on the Search string format does not specify nor give examples for this case.
EDIT: The documentation on the Search String Format does say this:
To Search within a specific field: enter an operator followed by an
argument. For example, user:joesabia. You can use single words or
quoted lists of words as an argument when running an operator query.
So, I tried doing something like this in the query box:
email:"email1#my-domain,com""email2#my-domain,com"
There is no OR in the query format. You'll need to either use multiple API calls with one email query per call or just list all devices and filter by email locally.
You can combine multiple fields search in query string separated by space for example email=test#example.com name:Test. But in your case just give it a try doing this email:test#example.com email:test2#example.com.

Howto add Modifiers to Graph API V2.0

I'm trying to use Facebook GraphAPI 2.0 to fetch user's id, first_name, and the url of profile picture(with special size modifiers) with single request. Here are my attempts:
If simply ask for picture, we can use: "me/picture?redirect=0&height=200&type=square&width=200" ==>It's successful.
If ask batch of information without special requirement of picture, we use: "me?fields=id,picture,first_name" ==> It's also successful.
Now, combining the two together, I tried: "me?fields=id,first_name,picture.fields(redirect(0), type(square),width(100))" as instructed by https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0#reading (the paragraph of "Making Nested Requests"). It returns error...
Thanks for any advice. you can use GraphAPI Explorer to check: https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Did%2Cname&version=v2.0
You don't need the redirect parameter if you also query for other fields:
GET /me?fields=id,first_name,picture.type(square).width(200).height(200)
should do. Note that the format (max. witdth/height) is determined by the largest edge. For my profile pic for example the width/height was 140 when requesting 200 like above.

Amazon ItemSearch API reponse different from amazon.com search results

I am trying to figure out the right parameters for ItemSearch such that the API call will return the same result as on the website. Currently I am using these params it is not consistent with the website.
url_params = dict(
Service='AWSECommerceService',
Operation='ItemSearch',
AssociateTag=AMAZON_ASSOCIATETAG,
SearchIndex='All',
AWSAccessKeyId=AWS_ACCESS_KEY_ID,
Keywords=keywords,
ResponseGroup='Small,OfferSummary,Images'
)
For example if 'iphone%205s' is put in keywords, the API returns a list of iPhone protectors, while searching on the website gives iPhones as top results.
I am also trying to figure out why this is for book searches. One possible answer I found online was that the websites search feature might use more elaborate queries than just one simple API call. For example, it may take into account other factors into the search (not sure what that might be but it may).

Parameter not supported by web service

I want to validate an opinion with you.
I have to design a web service that searches into a database of restaurants affiliated to a discount program in a specific country around a given address.
The REST call to such a webservice will look like http://server/search?country=<countryCode>&language=<languageCode>&address=<address>&zipcode=<zipcode>
The problem is that some countries do not have zipcodes or do not have them in the entire country.
Now, what would you do if the user passes such a parameter for a country that does not have zipcodes, but he/she passes a valid address?
Return 400 Bad request.
Simply igonre the zipcode parameter and return results based on the valid address
Return an error message in a specific format (e.g. JSON) stating that zipcodes are not supported for that country
Some colleagues are also favoring the following option
4. Simply return no results. And state in the documentation that the zipcode parameter is not supported. Also we have to create a webservice method which returns what fields should be displayed in the user interface.
What option do you think is best and why?
Thanks!
Well the OpenStreetMap Nomination Server returns results even if you dont know the ZIP Code and you can look at the results anyway. What if the user doesnt know the zip code but wants to find hist object?
I would try to search for that specific object anyway, especially because you said that some countries have zip codes partially.
If you simply return nothing te user doesnt know what went wrong and he wont know what to do.
That would depend on the use case. How easy is it for a user of the API to trigger that case? Is it a severe error which the user really should know how to avoid? Or is it something that is not entirely clear, where a user may know (or think he knows) a zipcode where officially there shouldn't be one? Does it come down to trial and error for the user how to retrieve correct results from your API? Is it a bad enough error that the user needs to be informed about it and that he needs to handle this on his side?
If you place this restriction in your API, consider that it will have to be clearly documented when this case is triggered, every user of the API will have to read and understand that documentation, it needs to be clear how to avoid the problem, it needs to be possible for the user to avoid the problem and every user will have to correctly implement extra code on his side to avoid this problem. Is it possible for the user to easily know which areas have zipcodes and which don't?
I think the mantra of "be flexible in what you accept, strict in what you output" applies...