Differences

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

Link to this comparison view

Next revision
Previous revision
dev:web_api:v2:fulltext_content [2013/10/29 17:13] – created dstillmandev:web_api:v2:fulltext_content [2017/11/27 04:19] (current) – Remove Zotero 5 warning bwiernik
Line 1: Line 1:
-====== Full-text Content Requests ====== +====== Full-Text Content Requests ======
- +
-** DRAFT **+
  
 This page documents the methods to access full-text content of Zotero items via 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 methods to access full-text content of Zotero items via 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.
Line 8: Line 6:
  
   GET <userOrGroupPrefix>/fulltext?newer=<version>   GET <userOrGroupPrefix>/fulltext?newer=<version>
- 
-<itemKey> should correspond to an existing attachment item. <version> should be the Last-Modified-Version returned from the previous check, or 0 if none. 
  
   Content-Type: application/json   Content-Type: application/json
Line 30: Line 26:
   GET <userOrGroupPrefix>/items/<itemKey>/fulltext   GET <userOrGroupPrefix>/items/<itemKey>/fulltext
  
-<itemKey> should correspond to an existing attachment item.+''<itemKey>'' should correspond to an existing attachment item.
  
-  Content-Type: text/plain; charset=UTF-8+  Content-Type: application/json
   Last-Modified-Version: <version of item's full-text content>   Last-Modified-Version: <version of item's full-text content>
      
-  <UTF-8—encoded full-text content>+<code javascript>
 +    "content": "This is full-text content.", 
 +    "indexedPages": 50, 
 +    "totalPages": 50 
 +}</code> 
 + 
 +''indexedChars'' and ''totalChars'' may be provided instead of ''indexedPages'' and ''totalPages''.
  
 ^ Common responses ^^ ^ Common responses ^^
Line 44: Line 46:
  
   PUT <userOrGroupPrefix>/items/<itemKey>/fulltext   PUT <userOrGroupPrefix>/items/<itemKey>/fulltext
-  Content-Type: text/plain+  Content-Type: application/json
      
-  <UTF-8—encoded full-text content>+<code javascript>
 +    "content": "This is full-text content.", 
 +    "indexedChars": 26, 
 +    "totalChars": 26 
 +}</code>
  
-<itemKey> should correspond to an existing attachment item. The request body should contain the raw UTF-8–encoded full-text content.+''<itemKey>'' should correspond to an existing attachment item. 
 + 
 +''indexedPages'' and ''totalPages'' can be provided instead of ''indexedChars'' and ''totalChars''.
  
 ^ Common responses ^^ ^ Common responses ^^
 | ''204 No Content'' | The item's full-text content was updated. | | ''204 No Content'' | The item's full-text content was updated. |
 +| ''400 Bad Request'' | Invalid JSON was provided. |
 | ''404 Not Found'' | The item wasn't found or was not an attachment. | | ''404 Not Found'' | The item wasn't found or was not an attachment. |
 +
 +==== Searching for items by full-text content ====
 +
 +See the ''q'' and ''qmode'' [[read_requests#search_parameters|search parameters]].
dev/web_api/v2/fulltext_content.1383081218.txt.gz · Last modified: 2013/10/29 17:13 by dstillman