diff --git a/README.md b/README.md index 3ec8ba2..54b263b 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,40 @@ Para Classes que envolvem formulários: * `CreateCourseForm` * `UpdateCourseForm()` + +##API Description +We are using mostly viewsets ( http://www.django-rest-framework.org/api-guide/viewsets/) to build our API endpoints now, so all default methods and API points were kept. + +* model list(GET) = list all objects from that mode in pagination mode, each page has 10 +* model detail(GET) = give the details of the objects and most important fields of the ones objects its has relationships. +* model create + +**Courses (URL: coursesapi)** +* course list ("/coursesapi/") +* course detail ("/coursesapi/id") (id is a parameter) + +**Subject (URL: subjectapi)** +* subject list ("/subjectapi/") +* subject detail ("/subjectapi/id") (id is a parameter) + +**Topic (URL: topicsapi)** +* topics list ("/topicsapi/") +* topic detail ("/topicsapi/id") (id is a parameter) + +**logs (URL: logs)** +* logs list ("/logs/") +* log detail ("/logs/id") (id is a parameter) + +#Obtaining an Access Token +* First build an application o "amadeus/o/applications" following this tutorial: http://django-oauth-toolkit.readthedocs.io/en/latest/tutorial/tutorial_01.html#create-an-oauth2-client-application + +* Then request, using a valid user, an access token using the following template (you'll have to know how to translate a GET Method into a POST one) +curl -X POST -d "grant_type=password&username=&password=" -u":" http://amadeus/o/token/ + +* finally, with your access token you can use test using +curl -H "Authorization: Bearer " -X POST -d"username=foo&password=bar" http://localhost:8000/users/ (inserting a new user) + + ## Link's úteis [Git - Introdução e comandos básicos(PT-BR)](https://github.com/fernandomayer/git-rautu/blob/master/0_configuracao-inicial.md) -- libgit2 0.21.2