Get userID from username
I'm writing some code that pulls items from a user's library. In time, it may grow authentication to work with private libraries, but for now, I'll settle for working with public libraries.
For a user visiting with a browser, my library is accessible just using my username:
https://www.zotero.org/takowl/items
However, for the API, I need to use my numeric userID, found in my settings. For now, I'm asking users to copy this in manually from their settings, but this is not a very nice experience. Is there a programmatic way to get a userID from a username, without dealing with oauth?
For a user visiting with a browser, my library is accessible just using my username:
https://www.zotero.org/takowl/items
However, for the API, I need to use my numeric userID, found in my settings. For now, I'm asking users to copy this in manually from their settings, but this is not a very nice experience. Is there a programmatic way to get a userID from a username, without dealing with oauth?
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
Zotero.userID
If you want an API way to send a username and get the userID without OAuth, I don't believe that exists.
Just go to
https://www.zotero.org/<username>/items
and you'd be able to scrape the userID from the page.