Documented the API and added some help for the config file

This commit is contained in:
Daniel Quinn
2016-03-04 23:59:13 +00:00
parent 66df220bea
commit 1ffce8f52d
4 changed files with 64 additions and 26 deletions

23
docs/api.rst Normal file
View File

@@ -0,0 +1,23 @@
.. _api:
The REST API
############
Paperless makes use of the `Django REST Framework`_ standard API interface
because of its inherent awesomeness. Conveniently, the system is also
self-documenting, so learn more about the access points, schema, what's
accepted and what isn't, you need only visit ``/api`` on your local Paperless
installation.
.. _Django REST Framework: http://django-rest-framework.org/
.. _api-uploading:
Uploading
---------
File uploads in an API are hard and so far as I've been able to tell, there's
no standard way of accepting them, so rather than crowbar file uploads into the
REST API and endure that headache, I've left that process to a simple HTTP
POST, documented on the :ref:`consumption page <consumption-http>`.

View File

@@ -40,9 +40,9 @@ follow the :ref:`consumer <utilities-consumer>` instructions to get it running.
A Note on File Naming
---------------------
Any document you put into the consumption directory will be consumed, but if you
name the file right, it'll automatically set some values in the database for
you. This is is the logic the consumer follows:
Any document you put into the consumption directory will be consumed, but if
you name the file right, it'll automatically set some values in the database
for you. This is is the logic the consumer follows:
1. Try to find the correspondent, title, and tags in the file name following
the pattern: ``Correspondent - Title - tag,tag,tag.pdf``.
@@ -111,11 +111,10 @@ So, with all that in mind, here's what you do to get it running:
HTTP POST
=========
Currently, the API is limited to only handling file uploads, it doesn't do tags
yet, and the URL schema isn't concrete, but it's a start. It's also not much of
a real API, it's just a URL that accepts an HTTP POST.
You can also submit a document via HTTP POST. It doesn't do tags yet, and the
URL schema isn't concrete, but it's a start.
To push your document to *Paperless*, send an HTTP POST to the server with the
To push your document to Paperless, send an HTTP POST to the server with the
following name/value pairs:
* ``correspondent``: The name of the document's correspondent. Note that there