
The Delivery API is for dealing with the actual binary content of documents in the Reaktor. With the delivery API, you can upload and download binary data.
POST your content to this URL:
http://txtr.com/delivery/document/upload
Parameters (must be passed by URL):
| token | mandatory | a valid txtr token |
| fileName | mandatory | a filename to be set for the document |
| addToList | optional | a list ID (not a view ID!) of a list that the document is to be added to, if not specified the document is added to the user's INBOX |
| timestamp | optional | a unix-style timestamp (ms since 1970) |
| format | optional | a format key indicating the format of the new document. It overrides the auto-detected type of the document |
| contentType | optional | a content type (see format keys) that overrides the auto-detected type of the document and the format parameter if present |
| deAuthenticate | optional | if present and set to "true", the token will be invalidated after this request |
If the format and the contentType parameter are given, the contentType parameter is used. If both parameters are missing, the file type is guessed from the file extension specified in the fileName parameter.
You can also upload to this URL in multipart/form-data format, in which case the fileName parameter will be ignored and the values from the form-data fields will be used.
If everything goes well, this URL will return "OK" and a list of document IDs of documents created through this upload. You may then use this IDs for manipulating metadata, or list membership, etc, via the RPC API.
The request returns only when the Reaktor has performed all checks and modifications. So if you cancel the request, but the upload is already complete and all goes well on the server, the import will still be performed.
In case you want to upload a new version of a document that already exists, POST your data to this URL:
http://txtr.com/delivery/document/$udid/upload/version
Where $udid is the ID of the document you want to update.
Parameters (must be passed by URL):
| token | mandatory | a valid txtr token |
| format | mandatory (if contentType not set) | a format key indicating the format of the version you're uploading |
| contentType | mandatory (if format not set) | a content type of a supported format (see format keys) indicating the format of the version you're uploading |
| timestamp | optional | a unix-style timestamp (ms since 1970) |
| deAuthenticate | optional | if present and set to "true", the token will be invalidated after this request. |
If everything goes well, this URL will return "OK" and the number that identifies the newly created version.
http://txtr.com/delivery/document/$udid
This will download the current version of the document, in its original format unless you supply a format
parameter. $udid must be a valid document ID.
| token | mandatory | a valid txtr token |
| format | optional | a format key. The Reaktor will convert the document to the given format, if it knows how to do so. |
| v | optional | the version of the document to be downloaded. Versions are represented by increasing integer values starting with 1 for the document's initial version. Omit this parameter to download the document's current version. |
Here's a table of supported formats and the keys the API uses.
| Description | Content Type (mime type) | |
|---|---|---|
| ATOM | Atom Feed | application/atom+xml |
| DOC | Microsoft Word Document | application/msword |
| DOCX | Microsoft Word Document (XML format) | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| EPUB | ePub eBook | application/epub+zip |
| HTML | HTML, zipped | text/html |
| JPG | JPEG | image/jpeg |
| application/pdf | ||
| PNG | PNG | image/png |
| PPT | Microsoft PowerPoint presentation | application/vnd.ms-powerpoint |
| PPTX | Microsoft PowerPoint presentation (XML format) | application/vnd.openxmlformats-officedocument.presentationml.presentation |
| RSS | RSS feed | application/rss+xml |
| RTF | Rich text format | application/rtf |
| TEXT | Plain text (UTF-8) | text/plain |
| XLS | Microsoft Excel sheet | application/vnd.ms-excel |
| XLSX | Microsoft Excel sheet (XML format) | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |