API v2
======
v2 API for Racks is RESTful API implementation.
With requests to that version of Racks API you become able to receive the full
JSON-encoded object stored in Racks.

.. http:get:: /api/v2/

   API root

   **Example request**:

   .. sourcecode:: http

      GET /api/v2/ HTTP/1.1
      X-Auth-Application: myapplication
      X-Auth-Token: mytoken

   **Example response**:

   .. sourcecode:: http

      HTTP 200 OK

      Allow: GET, HEAD, OPTIONS
      Content-Type: application/json
      Vary: Accept

      {
          "users": "http://racks/api/v2/users/",
          "objects": "http://racks/api/v2/objects/",
          "ipv4networks": "http://racks/api/v2/ipv4networks/"
      }

   :reqheader X-Auth-Application: application name
   :reqheader X-Auth-Token: application token

API v2 requires authentication by application token or cookies. Certain fields
are only visible to user and groups assigned to objects and labs. Only
superusers can modify fields, create and delete objects. To create acccess
token, visit `Account Applications page`_.

.. toctree::
   objects.rst
   ipv4networks.rst

.. _Account Applications page: /account/applications.html
