Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:web_api:v2:file_upload [2013/02/09 18:48] – [Zotero Server API File Uploads] dstillmandev:web_api:v2:file_upload [2017/11/27 04:18] (current) – Remove Zotero 5 warning bwiernik
Line 1: Line 1:
-====== Zotero Server API File Uploads ======+====== Zotero Web API File Uploads ======
  
-In addition to providing ways to [[read_requests|read]] and [[write_requests|write]] online library data, the Zotero Server API allows you to upload attachment files.+**This is version 2 of the Zotero Web API. For new development, use [[:dev/web_api/v3/start|API version 3]].** 
 + 
 +In addition to providing ways to [[read_requests|read]] and [[write_requests|write]] online library data, the Zotero Web API allows you to upload attachment files.
  
 The exact process depends on whether you are adding a new attachment file or modifying an existing one and whether you are performing a full upload or uploading a binary diff. The exact process depends on whether you are adding a new attachment file or modifying an existing one and whether you are performing a full upload or uploading a binary diff.
Line 28: Line 30:
 ==== ii. Create child attachment item ==== ==== ii. Create child attachment item ====
  
-  POST /users/<userID>/items/<parentItemKey>/children+  POST /users/<userID>/items
   Content-Type: application/json   Content-Type: application/json
-  X-Zotero-Write-Token: <token>+  Zotero-Write-Token: <token>
  
 <code javascript>{ <code javascript>{
Line 36: Line 38:
     {     {
       "itemType": "attachment",       "itemType": "attachment",
 +      "parentItem": "ABCD2345",
       "linkMode": "imported_url",       "linkMode": "imported_url",
       "title": "My Document",       "title": "My Document",
Line 53: Line 56:
 ''contentType'', ''charset'', ''filename'', ''md5'', and ''mtime'' can be edited directly in personal libraries for WebDAV-based file syncing. They cannot be edited directly in group libraries and should not be edited directly in personal libraries using Zotero File Storage, which provides an atomic method (detailed below) for setting the properties along with the corresponding file. ''contentType'', ''charset'', ''filename'', ''md5'', and ''mtime'' can be edited directly in personal libraries for WebDAV-based file syncing. They cannot be edited directly in group libraries and should not be edited directly in personal libraries using Zotero File Storage, which provides an atomic method (detailed below) for setting the properties along with the corresponding file.
  
-Child attachments can also be created along with new top-level items by including the attachment object in the ''attachments'' array of the new item's metadata. +Top-level attachments can be created by excluding the ''parentItem'' property. As in the Zotero client, only file attachments and PDFs—not HTML snapshots or web links—can be added as top-level items.
- +
-Top-level attachments can be created by POSTing to ''<userOrGroupPrefix>/items''. As in the Zotero client, only file attachments and PDFs—not HTML snapshots or web links—can be added as top-level items.+
  
 ===== 1b) Modify an existing attachment ===== ===== 1b) Modify an existing attachment =====
dev/web_api/v2/file_upload.1360453695.txt.gz · Last modified: 2013/02/09 18:48 by dstillman