[API-users] Getting server error 500 while trying to post a download request

Tim Robertson trobertson at gbif.org
Tue May 26 09:51:57 CEST 2015


Hi Priyank

The TAXON_KEY currently only supports the equals predicate.  We will look to support an array of values in the future.

Please let me know if that solves your problem.

Thanks,
Tim


>> From: Priyank Tiwari <priyankgt at gmail.com>
>> Subject: [API-users] Getting server error 500 while trying to post a download request
>> Date: 26 May 2015 08:16:09 GMT+2
>> To: api-users at lists.gbif.org
>> 
>> Hi,
>> 
>> I am trying to post a download request which is as follows,
>> 
>> curl -i -u username:password -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"creator":"username","notification_address": ["username at domain.com"],"predicate":{"type":"and","predicates":[{"type":"equals","key":"HAS_COORDINATE","value":"true"},{"type":"equals","key":"HAS_GEOSPATIAL_ISSUE","value":"false"},{"type":"greaterThanOrEquals","key":"YEAR","value":1995},{"type":"greaterThanOrEquals","key":"MONTH","value":1},{"type":"equals","key":"COUNTRY","value":"IN"},{"type":"in","key":"TAXON_KEY","values":[797]}]}}' http://api.gbif.org/v1/occurrence/download/request
>> 
>> But the server is throwing a 500 error. The relevant part among the entire printed error trace I think is
>> 
>> Caused by: java.lang.IllegalArgumentException: Search parameter TAXON_KEY is not mapped to Hive
>> 
>> at org.gbif.occurrence.download.service.HiveQueryVisitor.toHiveField(HiveQueryVisitor.java:147)
>> 
>> at org.gbif.occurrence.download.service.HiveQueryVisitor.visit(HiveQueryVisitor.java:209)
>> 
>> ... 58 more
>> 
>> It says that search parameter TAXON_KEY is not mapped, but I see TAXON_KEY being used in the examples at http://www.gbif.org/developer/occurrence#predicates.
>> 
>> Is it a documentation issue or 'in' predicate does not support 'TAXON_KEY'?
>> 
>> 
>> Thanks,
>> Priyank
>> _______________________________________________
>> API-users mailing list
>> API-users at lists.gbif.org
>> http://lists.gbif.org/mailman/listinfo/api-users
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gbif.org/pipermail/api-users/attachments/20150526/17913066/attachment.html>


More information about the API-users mailing list