spaceport/apiserver/docs/source/apioverview.rst

81 lines
2.1 KiB
ReStructuredText
Raw Normal View History

API Overview
============
The current API URL is: https://api.spaceport.dns.t0.vc/
The Spaceport API uses REST. JSON is returned by all API responses including
errors and HTTP response status codes are to designate success and failure.
Request bodies can be JSON or form data.
All API routes require a trailing slash. This is a Django default and you'll get
a 301 redirect if you forget it.
Authentication
--------------
All API routes require authentication with a token. The
token is returned on registration and login. The token needs to be placed in the
``Authorization`` request header like this: ``Token <token>``.
**Example**
Login response:
.. sourcecode:: json
{"key":"1fb8ef73f118c5de1f9ba4939a76b3f3b0bc7444"}
Add the following header to requests:
.. sourcecode:: text
Authorization: Token 1fb8ef73f118c5de1f9ba4939a76b3f3b0bc7444
Quick Reference
---------------
.. http:post:: /registration/
.. http:post:: /rest-auth/login/
.. http:get:: /user/
.. http:post:: /password/change/
2020-06-20 03:49:18 +00:00
.. http:post:: /password/reset/
2020-06-23 20:59:58 +00:00
.. http:post:: /password/reset/confirm/
.. http:get:: /members/(id)/
.. http:post:: /members/
.. http:patch:: /members/(id)/
.. http:put:: /members/(id)/
.. http:post:: /members/(id)/pause/
.. http:post:: /members/(id)/unpause/
.. http:post:: /search/
.. http:get:: /search/(id)/
.. http:get:: /transactions/(id)/
2020-02-04 08:39:26 +00:00
.. http:get:: /transactions/
.. http:post:: /transactions/
.. http:patch:: /transactions/(id)
.. http:put:: /transactions/(id)/
2020-02-04 08:39:26 +00:00
.. http:post:: /transactions/(id)/report/
.. http:get:: /courses/
.. http:get:: /courses/(id)/
.. http:post:: /courses/
.. http:put:: /courses/(id)/
.. http:patch:: /courses/(id)/
.. http:get:: /sessions/
.. http:get:: /sessions/(id)/
.. http:post:: /sessions/
.. http:put:: /sessions/(id)/
.. http:patch:: /sessions/(id)/
.. http:get:: /training/(id)/
.. http:post:: /training/
.. http:put:: /training/(id)/
.. http:patch:: /training/(id)/
.. http:get:: /cards/(id)/
2020-01-23 20:50:40 +00:00
.. http:post:: /cards/
.. http:put:: /cards/(id)/
.. http:patch:: /cards/(id)/
.. http:delete:: /cards/(id)/
.. http:get:: /door/
.. http:post:: /door/(card_number)/seen/
2020-02-04 08:39:26 +00:00
.. http:post:: /ping/