Internal Server error when using API with Zotero-API-Key

109 views
Skip to first unread message

wsal...@gmail.com

unread,
Jul 24, 2022, 3:42:04 PM7/24/22
to zotero-dev
I have a script that calls the Zotero API and harvests items in a collection for use in another application. The script has been working very well (thanks Zotero team for a very usable API), however I now need to use the script on a collection that requires authorization. I have added the Zotero-API-Key to the header in my API request and can return the first 50 results of the collection, anything above 50 gives me an 'Internal Server' error.

Requests are configured like so:
https://api.zotero.org/groups/MYGROUP/items?start=150&limit=100

With a Zotero-API-Key in the header of the request.

Response looks like this:

<response status="500" message="Internal Server Error" spent-millis="1818">
<header name="date" value="Sat, 23 Jul 2022 15:15:29 GMT"/>
<header name="server" value="Apache/2.4.54 ()"/>
<header name="strict-transport-security" value="max-age=31536000; includeSubDomains; preload"/>
<header name="zotero-api-version" value="3"/>
<header name="zotero-schema-version" value="17"/>
<header name="total-results" value="803"/>
<header name="link" value="..."/>
<header name="content-length" value="17"/>
<header name="connection" value="close"/>
<header name="content-type" value="text/html; charset=UTF-8"/>
<body media-type="text/html; charset=UTF-8"/>
</response>
<html xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">
<body>An error occurred</body>
</html>

Any ideas on where I am going wrong with these requests would be appreciated.
Thank you,
-Winona

Dan Stillman

unread,
Jul 25, 2022, 5:40:00 AM7/25/22
to zoter...@googlegroups.com
On 7/24/22 3:34 PM, wsal...@gmail.com wrote:
Requests are configured like so:
https://api.zotero.org/groups/MYGROUP/items?start=150&limit=100


That's not the request you're making, though — you're using `format=tei`. Be sure to share the full request when reporting problems.

The TEI export translator doesn't work on notes — you'll get an error in the desktop app as well if you include a child note when trying to export to TEI — and so you need to make a request that doesn't include notes. Unless there are standalone notes in the library, you can do that just by using `/items/top` instead of `/items`. If you have standalone notes, `&itemType=-note` should do it.

Winona Salesky

unread,
Jul 25, 2022, 7:04:25 AM7/25/22
to zoter...@googlegroups.com
Well, I feel sheepish, I thought I was requesting JSON. That does indeed solve my problem. 
Thank you, 
-Winona


--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/0100018234ba3f77-922d36de-6045-497c-9a75-152d7200ffd1-000000%40email.amazonses.com.
Reply all
Reply to author
Forward
0 new messages