API === Intro ----- By default, and if installed :ref:`as described ` on the front page, *drf-sendables* comes with two *entities*: :ref:`messages ` and :ref:`notices `. The following specification refers to the default configuration, but most aspects, such as URL paths, request/response data/format, field names, and searching mechanisms can be adjusted through :doc:`settings ` and :doc:`customized usage `. Some endpoints, as shown below, accept URL query parameters, which are all optional, serving searching purposes. The default search filters are of 3 types: *equals*, *contains*, and *datetime*. The first one requires equality between the search term and the field value and the second one requires the search term being part (substring) of the field value. The third search filter type supports `Django field lookups `_ such as ``sent_on__gte=`` and requires `timestamps `_ as values. All non-URL request fields are required, and lists cannot be empty. Requests to any endpoint missing a field or having an empty list-type field get responded with :http:statuscode:`400`. According to default settings all requests must be authenticated, and :http:post:`send notice ` must be made while authenticated as an administrator user. Requests lacking the required authentication get responded with :http:statuscode:`403`. Each endpoint only allows for a single HTTP method. If requested using any other, they respond with :http:statuscode:`405`. The requests and responses can be of any content type that your Django REST Framework project is configured for (either out of the box, or manually), but the following examples use *application/json*. Endpoints --------- You can find a summary of the endpoints at the :ref:`routing table `. Below is their detailed description: Messages ~~~~~~~~ **Messages** are sent from a user to others. By default, apart from ``content`` and the :class:`other fields `, they store "sender" information. Endpoints concerning messages require authenticated requests. .. http:post:: /messages/send/ :synopsis: Send a message to selected recipients Send a message to selected recipients **Example request**: .. sourcecode:: http POST /messages/send/ HTTP/1.1 { "content": "Hello there", "recipient_ids": [ 5, 8, 26 ] } **Example response**: .. sourcecode:: http HTTP/1.1 201 Created Content-Type: application/json { "content": "Hello there", "recipient_ids": [ 5, 8, 26 ] } :