Commit 0af9f0da by Mark Hoeber Committed by Xavier Antoviaque

API Doc

parent ca20a710
###############################
edX ReST API Resources
###############################
**********
Courses
**********
.. list-table::
:widths: 20 60
:header-rows: 1
* - Goal
- Resource
* - :ref:`Get a List of Courses`
- GET /api/courses
* - :ref:`Get Course Content`
- GET /api/courses/{course_id}/content?type=content_type
* - :ref:`Get Course Details`
- GET /api/courses/{course_id}?depth=n
* - :ref:`Get Content Details`
- GET /api/courses/{course_id}/content/{content_id}?type=content_type
* - :ref:`Get a Course Overview`
- GET /api/courses/{course_id}/overview?parse=true
* - :ref:`Get Course Updates`
- GET /api/courses/{course_id}/updates?parse=true
* - :ref:`Get Pages`
- GET /api/courses/{course_id}/static_tabs?detail=true
* - :ref:`Get Page Detail`
- GET /api/courses/{course_id}/static_tabs/{tab_id}
* - :ref:`Get Users in a Course`
- GET /api/courses/{course_id}/users
* - :ref:`Add a User to a Course`
- POST /api/courses/{course_id}/users
* - :ref:`Get Details of a User in a Course`
- POST /api/courses/{course_id}/users/{user_id}
* - :ref:`Unenroll a User from a Course`
- DELETE /api/courses/{course_id}/users/{user_id}
**********
Sessions
**********
.. list-table::
:widths: 20 60
:header-rows: 1
* - Goal
- Resource
* -
-
\ No newline at end of file
###############################
Testing the edX ReST API
###############################
###############################
Gruops API Module
###############################
.. module:: api_manager
The page contains docstrings for:
* `Groups Views`_
* `Groups Tests`_
**************
Groups Views
**************
.. automodule:: groups.views
:members:
:show-inheritance:
**************
Groups Tests
**************
.. automodule:: groups.tests
:members:
:show-inheritance:
\ No newline at end of file
.. _API:
###############################
edX Platform ReST API
###############################
This section contains information on edX Platform ReST API.
View the following chapters to understand the ReST API, how to test it, and the
available endpoints.
.. toctree::
:maxdepth: 2
api_overview
api_testing
courses
groups
sessions
system
users
###############################
Sessions API Module
###############################
.. module:: api_manager
The page contains docstrings for:
*
\ No newline at end of file
###############################
System API Module
###############################
.. module:: api_manager
The page contains docstrings for:
* `System Views`_
* `System Tests`_
**************
System Views
**************
.. automodule:: system.views
:members:
:show-inheritance:
**************
System Tests
**************
.. automodule:: system.tests
:members:
:show-inheritance:
\ No newline at end of file
###############################
Users API Module
###############################
.. module:: api_manager
The page contains docstrings for:
* `Users Views`_
* `Users Tests`_
**************
Users Views
**************
.. automodule:: users.views
:members:
:show-inheritance:
**************
Users Tests
**************
.. automodule:: users.tests
:members:
:show-inheritance:
\ No newline at end of file
...@@ -45,6 +45,7 @@ sys.path.append(root / "common/lib/sandbox-packages") ...@@ -45,6 +45,7 @@ sys.path.append(root / "common/lib/sandbox-packages")
sys.path.append(root / "common/lib/xmodule") sys.path.append(root / "common/lib/xmodule")
sys.path.append(root / "common/lib/opaque_keys") sys.path.append(root / "common/lib/opaque_keys")
sys.path.append(root / "lms/djangoapps") sys.path.append(root / "lms/djangoapps")
sys.path.append(root / "lms/djangoapps/api_manager")
sys.path.append(root / "lms/lib") sys.path.append(root / "lms/lib")
sys.path.append(root / "cms/djangoapps") sys.path.append(root / "cms/djangoapps")
sys.path.append(root / "cms/lib") sys.path.append(root / "cms/lib")
...@@ -188,6 +189,7 @@ def strip_tags(html): ...@@ -188,6 +189,7 @@ def strip_tags(html):
def process_docstring(app, what, name, obj, options, lines): def process_docstring(app, what, name, obj, options, lines):
"""Autodoc django models""" """Autodoc django models"""
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
You can adapt this file completely to your liking, but it should at least You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. contain the root `toctree` directive.
edX Developer's Guide edX Developer's Guide
=================================== ===================================
...@@ -34,6 +35,7 @@ APIs ...@@ -34,6 +35,7 @@ APIs
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
api_manager/index
djangoapps.rst djangoapps.rst
common-lib.rst common-lib.rst
experiments.rst experiments.rst
......
###############################
ReST API for Courses
###############################
The edX ReST API for courses enables you to:
* `Get a List of Courses`_
* `Get Course Details`_
.. _Get a List of Courses:
**********************
Get a List of Courses
**********************
.. http:get:: /api/courses
Retrieves a list of courses in the edX Platform as a JSON representation (array) of the set of Course entities.
**Example request**:
.. sourcecode:: http
GET /api/courses
**Example response**:
.. sourcecode:: http
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"category": "course",
"name": "edX Demonstration Course",
"uri": "http://localhost:8000/api/courses/edX/Open_DemoX/edx_demo_course",
"number": "Open_DemoX",
"due": null,
"org": "edX",
"id": "edX/Open_DemoX/edx_demo_course"
}
{
"category": "course",
"name": "Introduction to Computer Science",
"uri": "http://localhost:8000/api/courses/University/101/1_2014",
"number": "101",
"due": null,
"org": "edX University",
"id": "University/101/1_2014"
}
]
.. _Get Course Details:
**********************
Get Course Details
**********************
.. http:get:: /api/courses/{course ID}
Retrieves a list of courses in the edX Platform as a JSON representation (array) of the set of Course entities.
**Example request**:
.. sourcecode:: http
GET /api/courses
**Example response**:
.. sourcecode:: http
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"category": "course",
"name": "edX Demonstration Course",
"uri": "http://localhost:8000/api/courses/edX/Open_DemoX/edx_demo_course",
"number": "Open_DemoX",
"due": null,
"org": "edX",
"id": "edX/Open_DemoX/edx_demo_course"
}
{
"category": "course",
"name": "Introduction to Computer Science",
"uri": "http://localhost:8000/api/courses/University/101/1_2014",
"number": "101",
"due": null,
"org": "edX University",
"id": "University/101/1_2014"
}
]
\ No newline at end of file
###############################
ReST API for Groups
###############################
.. _ReST API:
###############################
ReST API
###############################
The edX ReST API is enabled by the :ref:`API Manager` module
.. toctree::
:maxdepth: 2
api_commands
testing_api
courses
groups
sessions
system
users
###############################
ReST API for Sessions
###############################
\ No newline at end of file
###############################
ReST API for System
###############################
\ No newline at end of file
###############################
ReST API for Users
###############################
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment