urschrei / pyzotero

Pyzotero: a Python client for the Zotero API
https://pyzotero.readthedocs.org
Other
910 stars 100 forks source link

can't delete tags #128

Closed clsnyder closed 3 years ago

clsnyder commented 3 years ago

General

Platform:
Python version:
Pyzotero version: installed today?

Problem description

I can access all my tags easily, but in Trying to delete tags from my unshared library - even with a single tag, I get:

UserNotAuthorised: Code: 403 URL: https://api.zotero.org/users/18471/tags?tag=hyponatremia Method: DELETE Response: Write access denied

A code example:

from pyzotero import zotero
zot = zotero.Zotero('18471', 'user', 'API#')
all_tags = zot.everything(zot.tags())
#create a first subset of this list
tags_part1 = all_tags[:50]
#delete first 50 tags
zot.delete_tags(*tags_part1)

If possible, paste the full traceback in a code block below, and fill in the summary

urschrei commented 3 years ago

The only thing I can think of is that your API key doesn't have write access for the library you're trying to edit. Can you go to https://www.zotero.org/settings/keys and check that the key you're using has all the permissions? If you select 'edit key', you can then verify that it has write access for your personal library and whatever groups you're trying to access.

clsnyder commented 3 years ago

Thanks I will check that.

On Sat, Mar 20, 2021 at 8:13 AM Stephan Hügel @.***> wrote:

The only thing I can think of is that your API key doesn't have write access for the library you're trying to edit. Can you go to https://www.zotero.org/settings/keys and check that the key you're using has all the permissions? If you select 'edit key', you can then verify that it has write access for your personal library and whatever groups you're trying to access.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/urschrei/pyzotero/issues/128#issuecomment-803316588, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANWOZAIQDQWCHB47RFSBTTESNOVANCNFSM4ZP3D2ZA .

clsnyder commented 3 years ago

Hi Stephan

I'm sorry I was too dim to check the permissions in the first place. Once I added write permissions, it worked perfectly.!

Thanks again for your help.

Charles

BTW, was in Dublin a few yrs ago - great city! Looking forward to going (anywhere) again....

On Sat, Mar 20, 2021 at 8:13 AM Stephan Hügel @.***> wrote:

The only thing I can think of is that your API key doesn't have write access for the library you're trying to edit. Can you go to https://www.zotero.org/settings/keys and check that the key you're using has all the permissions? If you select 'edit key', you can then verify that it has write access for your personal library and whatever groups you're trying to access.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/urschrei/pyzotero/issues/128#issuecomment-803316588, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANWOZAIQDQWCHB47RFSBTTESNOVANCNFSM4ZP3D2ZA .

urschrei commented 3 years ago

Great, glad it's working!