enrollment.rst 4.51 KB
Newer Older
1
###################################
2
Enrollment API Enrollment Resource
3
###################################
4

5 6
With the Enrollment API **Enrollment** resource, you can complete the
following tasks.
7

8 9 10
.. contents::
   :local:
   :depth: 1
11

12 13 14 15 16 17 18 19 20 21 22

.. _Get the Users Enrollment Status in a Course:

********************************************
Get the User's Enrollment Status in a Course
********************************************

.. autoclass:: enrollment.views.EnrollmentView

**Example response showing the user's enrollment status in a course**

23
.. code-block:: none
24 25 26 27 28 29 30

    HTTP 200 OK
    Content-Type: application/json
    Vary: Accept
    Allow: GET, HEAD, OPTIONS

    {
31 32 33
        "created": "2014-11-19T04:06:55Z",
        "mode": "honor",
        "is_active": true,
34
        "course_details": {
35 36
            "course_id": "edX/DemoX/Demo_Course",
            "enrollment_end": null,
37 38
            "course_modes": [
                {
39 40 41 42 43 44
                    "slug": "honor",
                    "name": "Honor Code Certificate",
                    "min_price": 0,
                    "suggested_prices": [],
                    "currency": "usd",
                    "expiration_datetime": null,
45 46
                    "description": null
                }
47 48
            ],
            "enrollment_start": null,
49
            "invite_only": false
50
        },
51
        "user": "staff"
52 53 54 55
    }

.. _Get Enrollment Details for a Course:

56 57 58
**************************************************
Get the User's Enrollment Information for a Course
**************************************************
59

60
.. autoclass:: enrollment.views.EnrollmentCourseDetailView
61

62
**Example response showing a user's course enrollment information**
63

64
.. code-block:: none
65 66 67 68 69 70 71

    HTTP 200 OK
    Content-Type: application/json
    Vary: Accept
    Allow: GET, HEAD, OPTIONS

    {
72 73
        "course_id": "edX/DemoX/Demo_Course",
        "enrollment_end": null,
74 75
        "course_modes": [
            {
76 77 78 79 80 81
                "slug": "honor",
                "name": "Honor Code Certificate",
                "min_price": 0,
                "suggested_prices": [],
                "currency": "usd",
                "expiration_datetime": null,
82
                "description": null
83
            }
84 85
        ],
        "enrollment_start": null,
86
        "invite_only": false
87 88 89 90 91
    }


.. _View and add to a Users Course Enrollments:

92 93 94
**********************************************************
View a User's Enrollments or Enroll a User in a Course
**********************************************************
95 96 97 98

.. autoclass:: enrollment.views.EnrollmentListView


99
**Example response showing a user who is enrolled in two courses**
100

101
.. code-block:: none
102 103 104 105 106 107 108 109

    HTTP 200 OK
    Content-Type: application/json
    Vary: Accept
    Allow: GET, POST, HEAD, OPTIONS

    [
        {
110 111 112
            "created": "2014-09-19T18:08:37Z",
            "mode": "honor",
            "is_active": true,
113
            "course_details": {
114 115
                "course_id": "edX/DemoX/Demo_Course",
                "enrollment_end": null,
116 117
                "course_modes": [
                    {
118 119 120 121 122 123
                        "slug": "honor",
                        "name": "Honor Code Certificate",
                        "min_price": 0,
                        "suggested_prices": [],
                        "currency": "usd",
                        "expiration_datetime": null,
124
                        "description": null
125
                    }
126 127
                ],
                "enrollment_start": null,
128
                "invite_only": false
129
            },
130
            "user": "honor"
131
        },
132
        {
133 134 135
            "created": "2014-09-19T18:09:35Z",
            "mode": "honor",
            "is_active": true,
136
            "course_details": {
137 138
                "course_id": "ArbisoftX/BulkyEmail101/2014-15",
                "enrollment_end": null,
139 140
                "course_modes": [
                    {
141 142 143 144 145 146
                        "slug": "honor",
                        "name": "Honor Code Certificate",
                        "min_price": 0,
                        "suggested_prices": [],
                        "currency": "usd",
                        "expiration_datetime": null,
147 148
                        "description": null
                    }
149 150
                ],
                "enrollment_start": "2014-05-01T04:00:00Z",
151
                "invite_only": false
152
            },
153 154
            "user": "honor"
        }
155 156 157
    ]


158
**Example response showing that a user has been enrolled in a new course**
159 160 161 162

.. code-block:: json

    {
163 164
        "course_details": {
            "course_id": "edX/DemoX/Demo_Course"
165
        }
166
    }