On 3/10/21 9:41 PM, Parker Jackson wrote:
> We are making a call to /top in order to get a response that lists the
> attachmentKey under each top level item. We then use that attachment
> key to make further calls. The problem that we are having with top
> level items with multiple attachments is that there is only reference
> to one attachment in this response.
>
> If you look in the included document, this top level item has an item
> key of 4Q8L3Y8V, it has one attachment listed with an attachmentKey
> of 8FCEB6WH. There is another attachment in the database under this
> item with an attachmentKey of VSSG9IM6 but it is not found anywhere in
> the response.
'attachmentKey' isn't something the API returns, to be clear. You seem
to be referring to `.links.attachment`, which gives you the "best"
attachment for an item — i.e., the same attachment you get if you
double-click on an item in Zotero. That's how the web library shows you
whether there's a PDF or snapshot and lets you open it without loading
all child items.
If you want child items, you have to actually request the child items.
See the `<userOrGroupPrefix>/items/<itemKey>/children` request in the
documentation:
https://www.zotero.org/support/dev/web_api/v3/basics#user_and_group_library_urls