Zotero write api returning 403

Hi,

can any developer help me in understanding why the zotero write api is returning 403 (forbidden) status.

POST url : 'https://api.zotero.org/users/<userid>/items'

header : 'Content-Type': 'application/json'

data : '{"items": [{"extra": "", "language": "", "itemType": "webpage", "shortTitle": "", "title": "DjangoTricks: Basics", "url": "http://djangotricks.blogspot.in/search/label/Basics", "notes": [], "rights": "", "attachments": [], "accessDate": "2013-03-16 05:04:21", "websiteType": "", "date": "", "abstractNote": "1112233", "creators": [{"lastName": "test", "creatorType": "contributor", "firstName": "test2"}], "tags": [], "websiteTitle": ""}]}'
  • edited April 9, 2013
    Thanks for the comment,

    Actually i figured it out, the zotero API documentation is faulty which states :

    Creating an Item

    POST <userOrGroupPrefix>/items
    Content-Type: application/json
    Zotero-Write-Token: <write token>

    that results in wrong api url:

    'https://api.zotero.org/users/<userid>/items'

    but the actual post url should be:

    'https://api.zotero.org/users/<userid>/items?key=<apikey>;

    It works like a charm after this correction.
  • dstillman Zotero Team
    The documentation isn't faulty. Every authenticated request requires an API key, as explained at the top of the page:
    An API key with write access to a given library is necessary to use write methods.
    And the key parameter itself is explained on the Read Requests page.

    It's assumed that you'll do this in your code automatically for all such requests, so we don't clutter the documentation by showing it with every example.
  • oh gr8 !

    i missed the detail :

    An API key with write access to a given library is necessary to use write methods.

    thanks !
  • dstillman Zotero Team
    Also, the 403 response says this:
    You must specify a key to access the Zotero API.
    Make sure you're looking at error responses when working with the API, since it'll make things much easier for you.

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.

Sign In or Register to comment.