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:write_requests [2013/03/03 16:50] – [Updating Multiple Objects] dstillmandev:web_api:v2:write_requests [2017/11/27 04:17] (current) – Remove Zotero 5 warning bwiernik
Line 1: Line 1:
 ====== Zotero Server Write Requests ====== ====== Zotero Server Write Requests ======
  
-**This is not currently the default [[read_requests#api_versioning|version]] of the Zotero API. Include the HTTP header ''Zotero-API-Version: 2'' to access this version.**+**This is version of the Zotero Web API. For new development, use [[:dev/web_api/v3/start|API version 3]].**
  
-This page documents the write methods of the [[start|Zotero Server API]]. See the [[Read Requests]] page for basic information on accessing the API, including possible HTTP status codes not listed here.+This page documents the write methods of the [[start|Zotero Web API]]. See the [[Read Requests]] page for basic information on accessing the API, including possible HTTP status codes not listed here.
  
 An API key with write access to a given library is necessary to use write methods. An API key with write access to a given library is necessary to use write methods.
Line 205: Line 205:
  
 See [[#creating_multiple_objects|Creating Multiple Objects]] for more information on the response format. See [[#creating_multiple_objects|Creating Multiple Objects]] for more information on the response format.
 +
 ==== Creating Multiple Items ==== ==== Creating Multiple Items ====
  
 See [[#creating_multiple_objects|Creating Multiple Objects]]. See [[#creating_multiple_objects|Creating Multiple Objects]].
 +
 ==== Updating an Existing Item ==== ==== Updating an Existing Item ====
  
Line 289: Line 291:
 ==== Updating Multiple Items ==== ==== Updating Multiple Items ====
  
-See the [[#updating_multiple_objects|Updating Multiple Objects]].+See [[#updating_multiple_objects|Updating Multiple Objects]]. 
 ==== Deleting an Item ==== ==== Deleting an Item ====
  
Line 463: Line 466:
 ==== Creating Multiple Objects ==== ==== Creating Multiple Objects ====
  
-Multiple collections, saved searches, and items can be created in the same requests by including multiple objects in the ''collections'', ''searches'', and ''items'' properties:+Up to 50 collections, saved searches, or items can be created in a single request by including multiple objects in the ''collections'', ''searches'', or ''items'' property:
  
   POST <userOrGroupPrefix>/collections   POST <userOrGroupPrefix>/collections
Line 519: Line 522:
  
 === Updating Multiple Objects === === Updating Multiple Objects ===
 +
 +Up to 50 collections, saved searches, or items can be updated in a single request.
  
 Follow the instructions in [[#creating_multiple_objects|Creating Multiple Objects]], but add an ''itemKey'', ''collectionKey'', or ''searchKey'' property to each object. Pass the current library version as ''If-Unmodified-Since-Version'', replacing ''Zotero-Write-Token'', or include an ''itemVersion'', ''collectionVersion'', or ''searchVersion'' in each object. Follow the instructions in [[#creating_multiple_objects|Creating Multiple Objects]], but add an ''itemKey'', ''collectionKey'', or ''searchKey'' property to each object. Pass the current library version as ''If-Unmodified-Since-Version'', replacing ''Zotero-Write-Token'', or include an ''itemVersion'', ''collectionVersion'', or ''searchVersion'' in each object.
  
-Items can also include ''dateAdded'' and ''dateModified'' properties containing UTC timestamps in SQL DATETIME format (e.g., "2012-10-03 16:42:12"). If ''dateAdded'' is included with an existing item, it must match the existing ''dateAdded'' value or else the API will return a 400 error. If ''dateModified'' is not included with an update to existing item, the item's ''dateModified'' value will be set to the current time.+Items can also include ''dateAdded'' and ''dateModified'' properties containing UTC timestamps in SQL DATETIME format (e.g., "2012-10-03 16:42:12"). If ''dateAdded'' is included with an existing item, it must match the existing ''dateAdded'' value or else the API will return a 400 error. If a new ''dateModified'' time is not included with an update to existing item, the item's ''dateModified'' value will be set to the current time.
  
 Creators, tags, and relations are included in item objects and cannot be modified separately. Creators, tags, and relations are included in item objects and cannot be modified separately.
dev/web_api/v2/write_requests.1362347400.txt.gz · Last modified: 2013/03/03 16:50 by dstillman