Retrieve multiple pictures for each place - google-api

Is there a way to retrieve multiple place photos per place request?
I am able to retrieve the picture for each place that is contained within the place response, is there a way to retrieve multiple pictures per place?

That depends on the Places SKU you are using. If you are using Find Place, Nearby Search, or Text Search requests, these can only return a single photo reference per place, when relevant. However, if you use a Place Details request, you can retrieve a no. of photo reference per place. For example:
https://maps.googleapis.com/maps/api/place/details/json?place_id=ChIJN1t_tDeuEmsRUsoyG83frY4&fields=name,photos&key=YOUR_API_KEY
Do keep in mind that you will still have to make separate place photo requests for each photo reference.

Related

Identify unique visitor redirected from Qualtrics

I'm trying to redirect respondents within a survey in Qualtrics to a webpage. On this webpage, they need to choose between a couple of options, and after it return to Qualtrics.
I know it is possible to generate an unique URL within qualtrics (e.g. example.com/test?UniqueID=999). However, how can I 'catch' this parameter together with the participant's response?
Thank you!
To "catch" a parameter in Qualtrics, you need to create an embedded data block in your survey flow and then create an embedded data field within that block with the same name (case-sensitive!) as the parameter. Instructions are available in the Qualtrics documentation here.
Please note that if you want to ensure that the parameter will be recorded for all responses, you should place the embedded data block first in your survey flow. (If it's placed after the question block(s), it will only be recorded for respondents who complete all the questions.)

Retrieve images from Instagram that contains more tag

I'm retrieving images from Instagram but I can't figure out why with this call:
https://api.instagram.com/v1/tags/trytag/media/recent?access_token=ACCESS_TOKEN
I can only retrieve images with one single trytag.
So if I post an image with more tags the link above can't retrieve it.
The current Instagram v1.0 API doesn't currently allow for multiple tag search. You could query for each tag separately and combine your results, or an alternative is to use a third party search like Mixagram, which is most likely doing the same thing but doesn't require an enormous amount of storage space upfront.

How to get Places Reference Key?

I have few lat,lng of some Google Places business which I want to search and get detailed information about that place.
I was looking at Place Detail search which require reference key of particular place page.
Here is what I am doing is.
Do Place search via api key for lat,lng
https://maps.googleapis.com/maps/api/place/nearbysearch/xml?location=lat,lng&radius=50&location=lat,lng&name=placenamesensor=false&key=my key
that returns exact place page result in xml and i grab ref key of that page.
then do call
https://maps.googleapis.com/maps/api/place/details/xml?reference=RefKey&sensor=false&key=MyKey
which gives output of particular business.
Now question is on 1st step to get ref key of business what if I dont know name but just know lat,lng and wish to grab ref key of that page. What query I have to fire to reduce api calls limit?
You can find it here:
I believe this is what you are looking for
https://developers.google.com/maps/documentation/javascript/places
you need to work with places api and implement the the typeahead feature
https://developers.google.com/maps/documentation/javascript/places#TextSearchRequests

Filter the form choices visible in the browseable API

I am using a filter to apply object level permissions to a collection. Resources in a second collection have a many-to-many relationship with the first. On the browsable API, when creating resources in the second collection, the user is presented with a list of resources from the first to link it to. However, this list is not filtered, so the user can see values that they should not be able to see.
I've poked around the documentation and source a bit and I cannot see a way to add filtering to the queryset that generates the choices without overloading or modifying a bunch of code to pass the request data down (probably removing some of the collection specific data on the way) and then apply the filters.
Is there a better way to achieve this?
Currently there's nothing to support this out of the box. Pull requests are always welcome. If it's something you want to work on you may want to either open a ticket on GitHub or hit up the mailing list to discuss it first.

How to retrieve an image from a database using imageid in the controller

Saving the image in a web directory and storing the URL in the database using this approach, I stored the image URL in the database. Based on that image id (I need to pass this image id to the controller from an Ajax call). I need to retrieve the image.
I got the image id using a jQuery template, so I have passed that image id to the controller. What should I write in the controller, filepathresult or fileresult? Or is there another approach?
OK, you're a bit confused.
You have the actual image file, file.jpg and you have the physical path to the file, D:\some\path\to\file.jpg.
You have the URL path to the file and a surrogate identity (your id).
id: 1337 (some random number)
URL: ????
First question:
You say you're storing the URL. Is it really the complete URL? Is it just a partial path to the image? Is the path from the root of the website or the root of the application? Is it just a partial physical path?
Second question:
What are you actually trying to do?
Do you just want to get the full path to the image? Why do you need Ajax to do this, if you already have the id? You might want to rethink how you're storing the images if any performance needs to come out of this.
Once an image gets a new identity, it often makes sense to use that new identity everywhere; you might ought to consider copy/rename the file for the new identity after it's uploaded (and possibly save the old filename for record keeping purposes). If you need to keep the file names (more or less) as-is, however, it'd be better to provide the ability to grab the URLs for a whole set of ids rather than to individually make an Ajax request id-by-id.
If you request a resource (AKA navigate to a URL) that has a physical file, IIS is going to serve it directly (that is, if you ask for www.mysite.com/Images/Image3.jpg IIS is going to serve it directly). I really don't understand exactly what you are doing, but if you mean that you get the associated URL for an image using an Ajax call to an MVC controller with the id of the image, you could do several things.
You could simply return the URL and use JavaScript code to create an image tag with that URL and inserting it in the DOM.
You could return a view like <img src="{yoururl}" /> and insert it in the DOM using JavaScript.
You could store the images on the database directly and use the File method to return the image bits indicating the correct MIME type.

Resources