Commit 4303e086 by Mark Hoeber

Alpha Data Analytics API Doc

parent bf4f5ba3
......@@ -12,9 +12,34 @@ from analytics_data_api.v0.serializers import SequentialOpenDistributionSerializ
class ProblemResponseAnswerDistributionView(generics.ListAPIView):
"""
Distribution of student answers for a particular problem, as used in a particular course.
Results are available for most (but not all) multiple-choice and short answer response types.
Get the distribution of student answers to a specific problem.
**Example request**
GET /api/v0/problems/{problem_id}/answer_distribution
**Response Values**
Returns a collection for each unique answer given to specified
problem. Each collection contains:
* course_id: The ID of the course for which data is returned.
* module_id: The ID of the problem.
* part_id: The ID for the part of the problem. For multi-part
problems, a collection is returned for each part.
* correct: Whether the answer was correct (``true``) or not
(``false``).
* count: The number of times the answer in this collection was
given.
* value_id: The ID of the answer in this collection.
* answer_value_text: The text of this answer, for text problems.
* answer_value_numeric: The number for this answer, for numeric
problems.
* problem_display_name: The display name for the specified problem.
* question_text: The question for the specified problem.
* variant: For randomized problems, the random seed used. If problem
is not randomized, value is null.
* created: The date the count was computed.
"""
serializer_class = ProblemResponseAnswerDistributionSerializer
......@@ -28,7 +53,24 @@ class ProblemResponseAnswerDistributionView(generics.ListAPIView):
class GradeDistributionView(generics.ListAPIView):
"""
Distribution of grades for a particular module in a given course
Get the distribution of grades for a specific problem.
**Example request**
GET /api/v0/problems/{problem_id}/grade_distribution
**Response Values**
Returns a collection for each unique grade given to a specified
problem. Each collection contains:
* course_id: The ID of the course for which data is returned.
* module_id: The ID of the problem.
* grade: The grade being counted in this collection.
* count: The number of times the grade in this collection was
given.
* max_grade: The highest possible grade for this problem.
* created: The date the count was computed.
"""
serializer_class = GradeDistributionSerializer
......@@ -42,7 +84,21 @@ class GradeDistributionView(generics.ListAPIView):
class SequentialOpenDistributionView(generics.ListAPIView):
"""
Distribution of view counts for a particular module in a given course
Get the number of views of a subsection, or sequential, in the course.
**Example request**
GET /api/v0/problems/{module_id}/sequential_open_distribution
**Response Values**
Returns a collection that contains the number of views of the specified
problem. The collection contains:
* course_id: The ID of the course for which data is returned.
* module_id: The ID of the subsection, or sequential.
* count: The number of times the subsection was viewed.
* created: The date the count computed.
"""
serializer_class = SequentialOpenDistributionSerializer
......
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
PAPER ?=
BUILDDIR ?= build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
Q_FLAG =
ifeq ($(quiet), true)
Q_FLAG = -Q
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = $(Q_FLAG) -d $(BUILDDIR)/doctrees -c source $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/edX.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/edX.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/edX"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/edX"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
-r ../../requirements.txt
.. _edX Data Analytics API Authentication:
######################################
edX Data Analytics API Authentication
######################################
The edX Data Analytics API uses the Django REST framework
`TokenAuthentication`_.
**************************
Create a User and Token
**************************
You create users and tokens in the Data Analytics API server. In the server
terminal, enter:
``$ ./manage.py set_api_key <username> <token>``
.. include:: links.rst
\ No newline at end of file
import sys
import os
from path import path
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# sys.path.insert(0, os.path.abspath('..'))
# Add any paths that contain templates here, relative to this directory.
# templates_path.append('source/_templates')
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path.append('source/_static')
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
master_doc = 'index'
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
root = path('../../..').abspath()
sys.path.insert(0, root)
sys.path.append(root / "analytics_data_api/v0/views")
sys.path.append('.')
# -- General configuration -----------------------------------------------------
# django configuration - careful here
if on_rtd:
os.environ['DJANGO_SETTINGS_MODULE'] = 'analyticsdataserver.settings.local'
else:
os.environ['DJANGO_SETTINGS_MODULE'] = 'analyticsdataserver.settings.local'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx',
'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath',
'sphinx.ext.mathjax', 'sphinx.ext.viewcode']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['build']
project = u'edX Data Analytics API Version 0 Alpha'
copyright = u'2014, edX'
##################################################
Course Information API Module
##################################################
This page contains information to:
* `Get Weekly Course Activity`_
* `Get Recent Course Activity`_
* `Get the Course Enrollment`_
* `Get the Course Enrollment by Mode`_
* `Get the Course Enrollment by Birth Year`_
* `Get the Course Enrollment by Education Level`_
* `Get the Course Enrollment by Gender`_
* `Get the Course Enrollment by Location`_
.. _Get Weekly Course Activity:
***************************
Get Weekly Course Activity
***************************
.. autoclass:: analytics_data_api.v0.views.courses.CourseActivityWeeklyView
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"interval_start": "2014-12-08T000000",
"interval_end": "2014-12-15T000000",
"course_id": "edX/DemoX/Demo_Course",
"any": 3013,
"attempted_problem": 206,
"played_video": 1049,
"created": "2014-12-10T193104"
}
]
.. _Get Recent Course Activity:
***************************
Get Recent Course Activity
***************************
.. autoclass:: analytics_data_api.v0.views.courses.CourseActivityMostRecentWeekView
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
{
"interval_start": "2014-12-08T00:00:00Z",
"interval_end": "2014-12-15T00:00:00Z",
"activity_type": "any",
"count": 3013,
"course_id": "edX/DemoX/Demo_Course"
}
.. _Get the Course Enrollment:
***************************
Get the Course Enrollment
***************************
.. autoclass:: analytics_data_api.v0.views.courses.CourseEnrollmentView
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"course_id": "edX/DemoX/Demo_Course",
"date": "2014-12-10",
"count": 1892,
"created": "2014-12-10T193146"
}
]
.. _Get the Course Enrollment by Mode:
*********************************
Get the Course Enrollment by Mode
*********************************
.. autoclass:: analytics_data_api.v0.views.courses.CourseEnrollmentModeView
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"course_id": "edX/DemoX/Demo_Course",
"date": "2014-12-10",
"count": 1890,
"created": "2014-12-10T193146",
"honor": 945,
"professional": 189,
"verified": 756
}
]
.. _Get the Course Enrollment by Birth Year:
****************************************
Get the Course Enrollment by Birth Year
****************************************
.. autoclass:: analytics_data_api.v0.views.courses.CourseEnrollmentByBirthYearView
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"course_id": "edX/DemoX/Demo_Course",
"date": "2014-12-10",
"birth_year": 1960,
"count": 11,
"created": "2014-12-10T193146"
},
{
"course_id": "edX/DemoX/Demo_Course",
"date": "2014-12-10",
"birth_year": 1961,
"count": 58,
"created": "2014-12-10T193146"
}
]
.. _Get the Course Enrollment by Education Level:
************************************************
Get the Course Enrollment by Education Level
************************************************
.. autoclass:: analytics_data_api.v0.views.courses.CourseEnrollmentByEducationView
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"course_id": "edX/DemoX/Demo_Course",
"date": "2014-12-10",
"education_level": "bachelors",
"count": 634,
"created": "2014-12-10T193146"
},
{
"course_id": "edX/DemoX/Demo_Course",
"date": "2014-12-10",
"education_level": "doctorate",
"count": 88,
"created": "2014-12-10T193146"
}
]
.. _Get the Course Enrollment by Gender:
************************************************
Get the Course Enrollment by Gender
************************************************
.. autoclass:: analytics_data_api.v0.views.courses.CourseEnrollmentByGenderView
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"course_id": "edX/DemoX/Demo_Course",
"date": "2014-12-10",
"female": 732,
"male": 1155,
"other": 435,
"unknown": 0,
"created": "2014-12-10T193146"
}
]
.. _Get the Course Enrollment by Location:
************************************************
Get the Course Enrollment by Location
************************************************
.. autoclass:: analytics_data_api.v0.views.courses.CourseEnrollmentByLocationView
See `ISO 3166 country codes`_ for more information.
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"date": "2014-12-10",
"course_id": "edX/DemoX/Demo_Course",
"country": {
"alpha2": "CA",
"alpha3": "CAN",
"name": "Canada"
},
"count": 264,
"created": "2014-12-10T193146"
},
{
"date": "2014-12-10",
"course_id": "edX/DemoX/Demo_Course",
"country": {
"alpha2": "CN",
"alpha3": "CHN",
"name": "China"
},
"count": 416,
"created": "2014-12-10T193146"
}
]
.. include:: links.rst
.. _Data Analytics API:
################################################
edX Data Analytics API Endpoints
################################################
The edX Platform API allows you to view information about users and their course enrollments, course information, and videos and transcripts.
The following tasks and endpoints are currently supported.
.. list-table::
:widths: 10 70
:header-rows: 1
* - To:
- Use this endpoint:
* - :ref:`Get Weekly Course Activity`
- /api/v0/courses/{course_id}/activity/
* - :ref:`Get Recent Course Activity`
- /api/v0/courses/{course_id}/recent_activity/
* - :ref:`Get the Course Enrollment`
- /api/v0/courses/{course_id}/enrollment/
* - :ref:`Get the Course Enrollment by Mode`
- /api/v0/courses/{course_id}/enrollment/mode/
* - :ref:`Get the Course Enrollment by Birth Year`
- /api/v0/courses/{course_id}/enrollment/birth_year/
* - :ref:`Get the Course Enrollment by Education Level`
- /api/v0/courses/{course_id}/enrollment/education/
* - :ref:`Get the Course Enrollment by Gender`
- /api/v0/courses/{course_id}/enrollment/gender/
* - :ref:`Get the Course Enrollment by Location`
- /api/v0/courses/{course_id}/enrollment/location/
* - :ref:`Get the Grade Distribution for a Course`
- /api/v0/problems/{problem_id}/grade_distribution
* - :ref:`Get the Answer Distribution for a Problem`
- /api/v0/problems/{problem_id}/answer_distribution
* - :ref:`Get the View Count for a Subsection`
- /api/v0/problems/{module_id}/sequential_open_distribution
\ No newline at end of file
################################################
edX Data Analytics API Version 0
################################################
.. toctree::
:maxdepth: 2
read_me
overview
setup
authentication
endpoints
courses
problems
\ No newline at end of file
.. _TokenAuthentication: http://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication
.. _Data Analytics API repository: https://github.com/edx/edx-analytics-data-api
.. _ISO 3166 country codes: http://www.iso.org/iso/country_codes/country_codes
\ No newline at end of file
.. _edX Data Analytics API Overview:
################################################
edX Data Analytics API Overview
################################################
The edX Data Analytics API provides the tools for building applications to view
and analyze student activity in your course.
The edX Data Analytics API uses Representational State Transfer (REST) design
principles and supports JavaScript Object Notation (JSON) data-interchange
format. Our REST API is simple, lightweight and optimized.
You can use the edX Data Analytics API for web, desktop, and mobile
applications.
****************************************
edX Data Analytics API Version 0, Alpha
****************************************
The edX Data Analytics API is currently at version 0 and is an Alpha release.
We plan on making significant enhancements and changes to the API.
The Data Analytics API uses key-based authentication and currently has no
built-in authorization mechanism. Therefore third parties cannot currently use
the Data Analytics API with edx.org data.
Open edX users can use the Data Analytics API with their own instances.
EdX plans to make the Data Analytics API available to partners in the future,
and invites feedback.
***********************************
edX Data Analytics API Capabilities
***********************************
With the edX Data Analytics API, you can:
* :ref:`Get Weekly Course Activity`
* :ref:`Get Recent Course Activity`
* :ref:`Get the Course Enrollment`
* :ref:`Get the Course Enrollment by Mode`
* :ref:`Get the Course Enrollment by Birth Year`
* :ref:`Get the Course Enrollment by Education Level`
* :ref:`Get the Course Enrollment by Gender`
* :ref:`Get the Course Enrollment by Location`
* :ref:`Get the Grade Distribution for a Course`
* :ref:`Get the Answer Distribution for a Problem`
* :ref:`Get the View Count for a Subsection`
\ No newline at end of file
##################################################
Problem Information API Module
##################################################
This page contains information to:
* `Get the Grade Distribution for a Course`_
* `Get the Answer Distribution for a Problem`_
* `Get the View Count for a Subsection`_
.. _Get the Grade Distribution for a Course:
***************************************
Get the Grade Distribution for a Course
***************************************
.. autoclass:: analytics_data_api.v0.views.problems.GradeDistributionView
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"module_id": "i4x://edX/DemoX/Demo_Course/problem/97fd93e33a18495488578e9e74fa4cae",
"course_id": "edX/DemoX/Demo_Course",
"grade": 1,
"max_grade": 2,
"count": 5,
"created": "2014-09-12T114957"
},
{
"module_id": "i4x://edX/DemoX/Demo_Course/problem/97fd93e33a18495488578e9e74fa4cae",
"course_id": "edX/DemoX/Demo_Course",
"grade": 2,
"max_grade": 2,
"count": 256,
"created": "2014-09-12T114957"
}
]
.. _Get the Answer Distribution for a Problem:
*******************************************
Get the Answer Distribution for a Problem
*******************************************
.. autoclass:: analytics_data_api.v0.views.problems.ProblemResponseAnswerDistributionView
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"course_id": "edX/DemoX/Demo_Course",
"module_id": "i4x://edX/DemoX/Demo_Course/problem/
268b43628e6d45f79c52453a590f9829",
"part_id": "i4x-edX-DemoX-Demo_Course-problem-
268b43628e6d45f79c52453a590f9829_2_1",
"correct": false,
"count": 9,
"value_id": "choice_0",
"answer_value_text": "Russia",
"answer_value_numeric": null,
"problem_display_name": "Multiple Choice Problem",
"question_text": "Which of the following countries has the largest
population?",
"variant": null,
"created": "2014-12-05T225026"
},
{
"course_id": "edX/DemoX/Demo_Course",
"module_id": "i4x://edX/DemoX/Demo_Course/problem/
268b43628e6d45f79c52453a590f9829",
"part_id": "i4x-edX-DemoX-Demo_Course-problem-
268b43628e6d45f79c52453a590f9829_2_1",
"correct": true,
"count": 15,
"value_id": "choice_1",
"answer_value_text": "Indonesia",
"answer_value_numeric": null,
"problem_display_name": "Multiple Choice Problem",
"question_text": "Which of the following countries has the largest
population?",
"variant": null,
"created": "2014-12-05T225026"
}
]
.. _Get the View Count for a Subsection:
*************************************
Get the View Count for a Subsection
*************************************
.. autoclass:: analytics_data_api.v0.views.problems.SequentialOpenDistributionView
**Example response**
.. code-block:: json
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS
[
{
"module_id": "i4x://edX/DemoX/Demo_Course/sequential/5c6c207e16dd47208c29bd8d3e68861e",
"course_id": "edX/DemoX/Demo_Course",
"count": 23,
"created": "2014-09-12T114838"
}
]
\ No newline at end of file
########
Read Me
########
The edX Data Analytics API documentation is created using RST_
files and Sphinx_. You, the user community, can help update and revise this
documentation project on GitHub:
https://github.com/edx/edx-analytics-data-api/tree/master/docs/api/source
To suggest a revision, fork the project, make changes in your fork, and submit
a pull request back to the original project: this is known as the `GitHub Flow`_.
.. _Sphinx: http://sphinx-doc.org/
.. _LaTeX: http://www.latex-project.org/
.. _`GitHub Flow`: https://github.com/blog/1557-github-flow-in-the-browser
.. _RST: http://docutils.sourceforge.net/rst.html
\ No newline at end of file
.. _Set up the Data Analytics API Server:
######################################
Set up the Data Analytics API Server
######################################
This chapter describes how to set up and test the edX Data Analytics API
server:
#. `Get the Repository`_
#. `Install Server Requirements`_
#. `Run the Server`_
#. `Load Sample Data`_
#. `Test the Data Analytics API`_
Also see :ref:`edX Data Analytics API Authentication`.
**************************
Get the Repository
**************************
You must get the `Data Analytics API repository`_ from GitHub.
From the terminal, enter:
``git clone https://github.com/edx/edx-analytics-data-api``
You may choose to get the repository in a virtual environment.
****************************
Install Server Requirements
****************************
From the terminal at the top level of the server repository, enter:
``$ make develop``
Server requirements are then installed.
****************************
Run the Server
****************************
From the terminal at the top level of the server repository, enter:
``$ ./manage.py runserver``
The server starts.
****************************
Load Sample Data
****************************
From the terminal at the top level of the server repository, enter:
``$ make loaddata``
****************************
Test the Data Analytics API
****************************
After you load sample data and run the server, you can test the API.
#. In a browser, go to: ``http://<server-name>:<port>/docs/#!/api/``
#. Enter a valid key and click **Explore**.
See :ref:`edX Data Analytics API Authentication` for information on keys.
You see an interactive list of API endpoints, which you can use to get
responses with the sample data. Expand the **api** section to see the
available endpoints.
.. image:: images/api_test.png
:alt: The API test web page
3. Expand the section for an endpoint:
.. image:: images/api_test_expand.png
:alt: The API test web page with an expanded endpoint
4. Enter parameters as needed and click **Try it out**. The response opens:
.. image:: images/api_test_response.png
:alt: The API test web page with a response
To get the sample enrollment data, use ``edX/DemoX/Demo_Course`` as the
``course_id``.
.. include:: links.rst
\ No newline at end of file
......@@ -3,7 +3,7 @@ Markdown==2.4.1 # BSD
django-model-utils==1.4.0 # BSD
djangorestframework==2.4.4 # BSD
ipython==2.1.0 # BSD
django-rest-swagger==0.1.14 # BSD
django-rest-swagger==0.2.5 # BSD
djangorestframework-csv==1.3.3 # BSD
iso3166==0.1 # MIT
-e git+https://github.com/edx/opaque-keys.git@d45d0bd8d64c69531be69178b9505b5d38806ce0#egg=opaque-keys
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