Private
Public Access
1
0

change API documentation

This commit is contained in:
Sander Roosendaal
2020-10-20 19:39:55 +02:00
parent 25e0badab9
commit 7297675ce8
3 changed files with 34 additions and 10 deletions

View File

@@ -138,7 +138,7 @@
</ul> </ul>
</p> </p>
<h3>API documentation</h3> <h3>API endpoints</h3>
<p>Once you have a registered app, you have gone through the authorization <p>Once you have a registered app, you have gone through the authorization
and have successfully obtained an access token, you can use it to place and have successfully obtained an access token, you can use it to place
@@ -147,12 +147,28 @@
<p>The workout summary data and the stroke data are obtained and sent <p>The workout summary data and the stroke data are obtained and sent
separately.</p> separately.</p>
<p> <p><em>Challenges</em> are accessed through <a href="/rowers/api/challenges/">/rowers/api/challenges/</a>
<ul class="contentli"> and <a href="/rowers/api/challenges/1">/rowers/api/challenges/{id}</a> where {id} is the ID of the challenge. Allowed method
<li><a href="/rowers/api-docs/">API documentation</a> is GET.</p>
(But refer to the below for stroke data.)</li> <p><em>Entries</em> are accessed through <a href="/rowers/api/entries/">/rowers/api/entries/</a>
</ul> and <a href="/rowers/api/entries/1">/rowers/api/entries/{id}</a> where {id} is the ID of the entry.
</p> Allowed methods are GET.</p>
<p><em>Charts</em> are accessed through <a href="/rowers/api/charts/">/rowers/api/charts/</a>
and <a href="/rowers/api/charts/1">/rowers/api/charts/{id}</a> where {id} is the ID of the chart.
Allowed method are GET, DELETE.</p>
<p><em>Courses</em> are accessed through <a href="/rowers/api/geocourses/">/rowers/api/geocourses/</a>
and <a href="/rowers/api/geocourses/1">/rowers/api/geocourses/{id}</a> where {id} is the ID of the Course.
Allowed method are GET.</p>
<p><em>Course Standard Collections</em> are accessed through <a href="/rowers/api/standardcollections/">/rowers/api/standardcollections/</a>
and <a href="/rowers/api/standardcollections/1">/rowers/api/standardcollections/{id}</a> where {id} is the ID of the Standard Collection.
Allowed method are GET.</p>
<p><em>Individual Course Standards</em> are accessed through <a href="/rowers/api/standards/1">/rowers/api/standards/{id}</a> where {id} is the ID of the Course Standard.
Allowed method are GET.</p>
<p><em>Workouts</em> are accessed through <a href="/rowers/api/workouts/">/rowers/api/workouts/</a>
and <a href="/rowers/api/workouts/1">/rowers/api/workouts/{id}</a> where {id} is the ID of the Workout.
Allowed method are GET, POST, DELETE.</p>
<h3>POST stroke data - API</h3> <h3>POST stroke data - API</h3>

View File

@@ -20,6 +20,7 @@ from rest_framework.permissions import *
from rowers import views from rowers import views
from django.contrib.auth import views as auth_views from django.contrib.auth import views as auth_views
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from django.utils.decorators import method_decorator
from rowers.permissions import ( from rowers.permissions import (
IsOwnerOrNot,IsOwnerOrReadOnly, IsOwnerOrNot,IsOwnerOrReadOnly,

View File

@@ -431,7 +431,7 @@ REST_FRAMEWORK = {
# 'rest_framework.permissions.DjangoModelPermissions' # 'rest_framework.permissions.DjangoModelPermissions'
], ],
'DEFAULT_AUTHENTICATION_CLASSES': ( 'DEFAULT_AUTHENTICATION_CLASSES': (
# 'rest_framework.authentication.BasicAuthentication', 'rest_framework.authentication.BasicAuthentication',
# 'rest_framework.authentication.SessionAuthentication', # 'rest_framework.authentication.SessionAuthentication',
# 'rest_framework.authentication.TokenAuthentication', # 'rest_framework.authentication.TokenAuthentication',
'oauth2_provider.contrib.rest_framework.OAuth2Authentication', 'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
@@ -441,7 +441,7 @@ REST_FRAMEWORK = {
} }
SWAGGER_SETTINGS = { SWAGGER_SETTINGS = {
'SECURITY_DEFINITION': { 'SECURITY_DEFINITIONS': {
'basic': { 'basic': {
'type':'basic' 'type':'basic'
}, },
@@ -449,9 +449,16 @@ SWAGGER_SETTINGS = {
'type':'oauth2', 'type':'oauth2',
'authorizationUrl':'/rowers/o/authorize', 'authorizationUrl':'/rowers/o/authorize',
'flow': 'implicit', 'flow': 'implicit',
} },
'api_key': {
'type': 'apiKey',
'in': 'header',
'name': 'Authorization'
},
}, },
'SHOW_REQUEST_HEADERS': True, 'SHOW_REQUEST_HEADERS': True,
'USE_SESSION_AUTH': True,
'JSON_EDITOR': True,
} }
# Analytics # Analytics