Here is the url. Replace [KEY] with your key.
https://maps.googleapis.com/maps/api/place/radarsearch/json?sensor=true&radius=402&types=accounting|airport|amusement_park|aquarium|art_gallery|bakery|bank|bar|beauty_salon|bicycle_store|book_store|bowling_alley|bus_station|cafe|campground|car_dealer|car_rental|car_repair|car_wash|casino|cemetery|church|city_hall|clothing_store|convenience_store|courthouse|dentist|department_store|doctor|electrician|electronics_store|embassy|establishment|finance|fire_station|florist|food|funeral_home|furniture_store|gas_station|general_contractor|grocery_or_supermarket|gym|hair_care|hardware_store|health|hindu_temple|home_goods_store|hospital|insurance_agency|jewelry_store|laundry|lawyer|library|liquor_store|local_government_office|locksmith|lodging|meal_delivery|meal_takeaway|mosque|movie_rental|movie_theater|moving_company|museum|night_club|painter|park|parking|pet_store|pharmacy|physiotherapist|place_of_worship|plumber|police|post_office|real_estate_agency|restaurant|roofing_contractor|rv_park|school|shoe_store|shopping_mall|spa|stadium|storage|store|subway_station|synagogue|taxi_stand|train_station|travel_agency|university|veterinary_care|zoo&location=37.785834%2C-122.406417&key=[KEY]
When i call this url it will sometimes work but most of the time i get back
{
"html_attributions" : [],
"results" : [],
"status" : "UNKNOWN_ERROR"
}
Steps:
paste the url into Chrome (replace [key] with real key) and just reload the url request several time.
Thank you
Frank
Google itself seems to have this error:
https://developers.google.com/maps/documentation/javascript/examples/place-radar-search
Click the link and their page throws an error.
Related
I'm looking to find gas stations around based on the location I provided. And it seems that the query string that I provide to the Google API is not really correct, leading to the desired result.
Here is the URL
https://maps.googleapis.com/maps/api/place/nearbysearch/json
And this is my query string:
?location=40.316828,%20-82.839840&radius=50000&type=gas_station&keyword=cruise&key=My_Google_Key
Response returned current>:
{
"html_attributions" : [],
"results" : [],
"status" : "ZERO_RESULTS"
}
The solution is simple, just remove the "keyword" parameter then everything will be ok. If this param is declared, the API will only return results with the same value as the param
Here is my original URL:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.316828,%20-82.839840&radius=50000&type=gas_station&keyword=cruise&key=My_Google_Key
Replace with this URL:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.316828,%20-82.839840&radius=50000&type=gas_station&key=My_Google_Key
I'm using Vimeo's official NodeJS API module to build an app, and I can successfully upload a video without issue. I can also set the video's privacy property successfully. Now, I would like to move that uploaded video to an album, and if the album does not exist, I want to create one automatically. I have an access token stored in a file that my application reads from, and the scopes granted to the token are the following
"scope": "interact create edit upload delete video_files private public"
So, I've got the create scope which is needed to create a new album for a user. However, when I make the request to the Vimeo API, I am getting an error of which I cannot resolve or fix.
{
"invalid_parameters":[{
"field":"name",
"error_code":2204,
"error":"You have provided an invalid parameter. Please contact developer of this application.",
"developer_message":"The parameters passed to this API endpoint did not pass Vimeo's validation. Please check the invalid_parameters list for more information."
}]
}
Here is my code that is making the request:
if (!album_uri) {
console.log("Attempting to create a new album named `" + config.params.video.group + "`");
var req_make_album = {
"method" : "POST"
, "path" : "/me/albums"
, "name" : config.params.video.group
, "description" : config.params.video.group
};
api.request(req_make_album, function(error, body, status_code, headers) {
if (error)
throw new Error(error);
step();
})
}
To be sure, the config.params.video.group variable is a string and to be certain that it was in fact a string, I replaced the request options with literal ones as such:
var req_make_album = {
"method" : "POST"
, "path" : "/me/albums"
, "name" : "My First New Album"
, "description" : "My First New Album"
};
Still, I received the above error about the "name" field being invalid. What am I missing here? When I go to the Vimeo API "playground" for this particular endpoint, it does work (even when I authenticate via my app) but I don't understand why it won't work when I make the request via the NodeJS module. Why am I getting this error?
My mistake. The issue is that the Vimeo API requires that the items "name" and "description" to be passed as an object.
So, instead of
var req_make_album = {
"method" : "POST"
, "path" : "/me/albums"
, "name" : "My First New Album"
, "description" : "My First New Album"
};
It should actually be:
var req_make_album = {
"method" : "POST"
, "path" : "/me/albums"
, "query" : {"name" : "My First New Album", "description" : "My First Album's Description"
};
The more you know :)
I have tried deleting instances using https://cloud.google.com/compute/docs/reference/beta/instanceGroupManagers/deleteInstances but it's not working.
In the request body, I am entering
{
"instances": [
"scaler-group-instance-1"
]
}
For project, I used project-name-1
For zone, I used us-west1-a
For instanceGroupManager I am using scaling-group-manager
In response, I am receiving
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid value for field 'instances[0]': 'scaler-group-instance-1'. The URL is malformed.",
"reason" : "invalid"
} ],
"message" : "Invalid value for field 'instances[0]': 'scaler-group-instance-1'. The URL is malformed."
}
I have also tried this in Java as well using this code snippet and have also received a 400 Bad Request
String projectId = "project-name-1";
String zoneName = "us-west1-a";
String instanceGroupName = "scaling-group-manager";
List<String> instancesToDelete = new ArrayList<>();
instancesToDelete.add("scaler-group-instance-1");
InstanceGroupManagersDeleteInstancesRequest deleteInstancesRequest = new InstanceGroupManagersDeleteInstancesRequest().setInstances(instancesToDelete);
Compute.InstanceGroupManagers.DeleteInstances deleteInstances = compute.instanceGroupManagers().deleteInstances(projectId, zoneName, instanceGroupName, deleteInstancesRequest).execute();
Is there something wrong with my request that I'm not seeing?
I found the issue. This request expects the instance string to be a URL and not an instance name.
The instance can be found in the selfLink value in the listInstances requests.
Entering the selfLink URL into the request caused the server to reply correctly.
I would like to do a lookup in the storage using the JSON API client library and only retrieve the name and generation of each object matching a specific prefix but I am having issues with the fields request parameter.
Executing the following returns the expected objects.
Storage.Objects.List listObjects = null;
listObjects.setVersions(true);
listObjects.setPrefix(myprefix);
URL being created for the request in com.google.api.client.http.HttpRequest is https://www.googleapis.com/storage/v1beta2/b/mybucketname/o?prefix=myprefix&versions=true
However, when I add
listObjects.setFields("name,generation");
with URL created being https://www.googleapis.com/storage/v1beta2/b/mybucketname/o?fields=name,generation&prefix=myprefix&versions=true the below is returned:
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"location" : "fields",
"locationType" : "parameter",
"message" : "Invalid field selection name",
"reason" : "invalidParameter"
} ],
"message" : "Invalid field selection name"
}
How am I supposed to be specifying the fields I want returned? Is the hierarchy of the fields I'm specifying not correct?
Thank you!
Ref:
Verified the composition of the URL based on this: https://developers.google.com/storage/docs/json_api/v1/how-tos/performance#partial
I think what you want is:
fields=items(generation,name)
or with the full URL:
https://www.googleapis.com/storage/v1beta2/b/mybucketname/o?fields=items(generation,name)&prefix=myprefix&versions=true
The APIs Explorer is a great tool for experimenting with request fields like this. It will generate the proper fields for you.
I have an android application that was working great but 2 days ago things started failing. After debugging for a bit, I noticed that I was not able to retrieve details on places that I have added to Places API. After doing a places search based on my location, I do see that my added locations are listed. When I take the reference token provided and attempt to do a Places Details request, I get the following JSON back.
{
"html_attributions" : [],
"status" : "NOT_FOUND"
}
Interestingly, if I use the ORIGINAL token provided to do the same Details request, I do in fact get the details back as such..
{
"html_attributions" : [],
"result" : {
"geometry" : {
"location" : {
"lat" : 44.2778780,
"lng" : -88.39451800000002
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png",
"id" : "c52c0ee9bdd0aea66419a0dfeaed32925f18216e",
"name" : "Amc broom closet",
"reference" : "CmRgAAAAGZwx9penijotKZ9lizruTGr8KPbrTc4CD39tPQZ5rpsoEC0ofXDr
2wpP0Ws9Vr1IIwGtTzRNyOYxOxMKQluhU-_SDydaPKJOsT9F2zqN8gBNPH-
8Lenq4tkfLKdRmhF4EhD5KdxkNndh0J_cdy4lNPI
MGhS8l2EdBcalDXfYRbkiFvWa3Bb8Og",
"types" : [ "other" ]
},
"status" : "OK"
}
If I then take that reference token and try to get Details however, I am once again left with ...
{
"html_attributions" : [],
"status" : "NOT_FOUND"
}
I am quite certain this is a new change.. Maybe I did not test thoroughly enough to begin with (quite possible). It leaves me in a huge quandry however. Because according to the documentation, my original token that works presently, might not work in the future! I'm not sure how to program around that.
Please tell me this is a temporary blip in the system, otherwise, my paddle just washed downstream.
This appears to be a bug, please post it here so we can look into this ASAP.