============== Authentication ============== .. include:: ../../complete.rst Authentication to the API is handled via a token that is placed into the header of every request. To obtain your token, you need to make a POST request to the ``/api/v1/api-token-auth/`` endpoint. Once you have your token, you will include it in request header as the ``Authorization`` key, and the value should be ``Token `` where ```` is the token returned by this endpoint. .. http:post:: /api/v1/api-token-auth/ Get a Authentication token. **Example Request**: .. code:: POST /api/v1/api-token-auth/ Accept: application/json { "username": "someone@email.com", "password": "SomeSecretPassword" } **Example Response**: .. code:: HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "token": "7297b3ebb0e7f7baf5f54d39908dda99f5ea8665" } :json string token: the token to be used in future requests :reqheader Accept: the response content type depends on ``Accept`` header :resheader Content-Type: this depends on ``Accept`` header of request :statuscode 200: OK :statuscode 400: Bad Authentication