Basic API help

I have read the API docs for version 3 READ and WRITE. I get the read part, and was able to get the data I want.

But regarding WRITE, I just don't get where should I use a code like the REST example:

$ URL="https://api.zotero.org/users/1234567/items"
$ API_KEY="P9NiFoyLeZu2bZNvvuQPDWsd"
$ curl -H "Zotero-API-Key: $API_KEY" $URL > items.json
$ vi items.json # edit the item data
$ curl -H "Zotero-API-Key: $API_KEY" -d @items.json -v $URL

How to feed it back to https://api.zotero.org/ ?
  • That's a bash shell script. What are your goals? I'd generally recommend working with a library (most typically pyzotero) if you want to script with the API.
  • It's referring to this section from the documentation:

    https://www.zotero.org/support/dev/web_api/v3/write_requests#rest_approach

    But that assumes a basic understanding of shell commands and curl.
  • My goal: to make basic edits, like change an item's membership in collections, or add a few new items or notes, in my personal library, *from an Android phone*.

    I was surprised that these things can't be done by 3rd party client Zoo for Zotero (and Zandy, it seems, from looking at screenshots), so I wanted to try the API.
  • You can certainly use the API, if you're comfortable with scripting and web APIs. As adamsmith says, you'd probably want to use a library like pyzotero. But the example above isn't really in any way relevant to interacting with the API from a phone — it's basically just a hacky way to do batch editing on the desktop using curl and a text editor.
  • (While I've never tried Zoo or Zandy, I would be pretty surprised if you couldn't add items to a collection in Zoo.)
Sign In or Register to comment.