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@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@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@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@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users