<div dir="ltr"><div><div><div><div>Thanks Peter,<br><br></div>Yes, I was authenticated. Thanks also for your (off the record) hint to <a href="https://github.com/sckott/pygbif" target="_blank">pygbif. </a><br></div>That makes a nice abstraction of the API and with that I'm able to request a download from my python code:<br><span style="font-family:monospace,monospace"><br>from pygbif import occurrences<br><br>user = 'me'<br>email = '<a href="mailto:me@myself.be" target="_blank">me@myself.be</a>'<br>pwd = 'pwd'<br><br>dataset_ids = [<br>    'key1',<br>    'key2'<br>]<br>queries = ['datasetKey = {}'.format(x) for x in dataset_ids]<br>results = occurrences.download(queries, user=user, pwd=pwd, email=email, pred_type='or')</span> <br><br></div>Regards,<br><br></div>Bart<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-28 13:44 GMT+02:00 Peter Desmet <span dir="ltr"><<a href="mailto:peter.desmet.work@gmail.com" target="_blank">peter.desmet.work@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Bart,<br>
<br>
Did you authenticate your request?<br>
<br>
Peter<br>
<div><div class="h5"><br>
On 28 March 2017 at 13:25, Bart Aelterman <<a href="mailto:bart.aelterman@gmail.com">bart.aelterman@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I am trying to create a downloads file using the GBIF Occurrence Download<br>
> API, but I'm not getting the expected result. I want to pass in a dataset<br>
> key from which I want all occurrences.<br>
><br>
> The predicate I defined is this one:<br>
><br>
> {<br>
>   "creator": "bartaelterman",<br>
>   "notification_address": ["<a href="mailto:bart.aelterman@gmail.com">bart.aelterman@gmail.com</a>"],<br>
>   "predicate": {<br>
>     "value": "7d5a76b9-819f-4fb8-aab0-<wbr>664d4089aa54",<br>
>     "key": "DATASET_KEY",<br>
>     "type": "equals"<br>
>   }<br>
> }<br>
><br>
> I've also set the following headers:<br>
><br>
> Content-Type:'application/<wbr>json,<br>
> Accept: application/json<br>
><br>
> Yet, I get a 500 response from the API. Am I doing something wrong in my<br>
> predicate definition?<br>
><br>
> Thanks,<br>
><br>
> Bart<br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> API-users mailing list<br>
> <a href="mailto:API-users@lists.gbif.org">API-users@lists.gbif.org</a><br>
> <a href="https://lists.gbif.org/mailman/listinfo/api-users" rel="noreferrer" target="_blank">https://lists.gbif.org/<wbr>mailman/listinfo/api-users</a><br>
><br>
</blockquote></div><br></div>