Issue 14266

Support for jsonp in API responses

14266
Reporter: feedback bot
Assignee: mdoering
Type: Improvement
Summary: Support for jsonp in API responses
Priority: Major
Resolution: Duplicate
Status: Resolved
Created: 2013-10-21 08:40:11.396
Updated: 2013-12-19 16:19:56.171
Resolved: 2013-12-19 16:19:56.139
        
        
Description: Incredible new API - well done to everyone.

I am using 2 calls in the API - one to retrieve species names and one to retrieve occurrence records. The occurrence search supports the jsonp callback parameter but it doesnt work for the species name search (this is using dojo.request to make the call):

..
		script.get("http://api.gbif.org/v0.9/occurrence/search", {
			query : {
				geometry : boundingbox,
				taxon_key : 5227762
			},
			jsonp : "callback"
		}).then(function(response) {
			console.log(response);  //works fine!
		});
..
		script.get("http://api.gbif.org/v0.9/species/match", {
			query : {
				name : 'Argusianus argus'
			},
			jsonp : "callback"
		}).then(function(response) {
			taxon_key = response.usageKey; //generates a 406 Not Acceptable
		});

Best wishes,
Andrew Cottam
Joint Research Centre

]]>