Next revision | Previous revisionNext revisionBoth sides next revision |
dev:web_api:v2:fulltext_content [2013/10/29 17:13] – created dstillman | dev:web_api:v2:fulltext_content [2013/11/05 19:16] – dstillman |
---|
====== 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. |
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. | ''<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 |
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 ^^ |
| |
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]]. |