{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/62054839","id":62054839,"diff_hunk":"@@ -0,0 +1,347 @@\n+.. _Courses API Blocks Resource:\n+\n+########################################\n+Courses API Blocks Resource\n+########################################\n+\n+With the Courses API **Blocks** resource, you can complete the\n+following tasks.\n+\n+\n+.. contents::\n+   :local:\n+   :depth: 1\n+\n+.. _Get a list of the course blocks in a course:\n+\n+****************************************\n+Get a List of Course Blocks in a Course\n+****************************************\n+\n+The endpoint to get a list of course blocks in a course is\n+``/api/courses/v1/blocks/?course_id=<course_id>``.\n+\n+=====================\n+Use Case\n+=====================\n+\n+Get a list of course blocks in a specified course. Response results depend on\n+the requesting user's access level.\n+\n+=====================\n+Example Request\n+=====================\n+\n+GET /api/courses/v1/blocks/?course_id=<course_id>\n+\n+GET /api/courses/v1/blocks/?course_id=edX%2FDemoX%2FDemo_Course\n+&all_blocks=true&requested_fields=graded,format,student_view_multi_device\n+\n+=====================\n+Parameters\n+=====================\n+\n+This view accepts the following parameters.\n+\n+* block_counts: to return the aggregate number of blocks (including child\n+  blocks) of each type specified in the \"block_counts\" response value.\n+  Example: ``block_counts=video,problem``.\n+\n+* block_types_filter: Specify the types of blocks to be included in results.\n+  Possible values are: ``sequential``, ``vertical``, ``html``, ``problem``,\n+  ``video``   and ``discussion``. Example: ``block_types_filter=problem,html``.\n+\n+* course_id: (string, required) The URL-encoded ID of the course whose block\n+  data you are requesting. Example: ``course_id=edX%2FDemoX%2FDemo_Course``.\n+\n+* depth: (integer or ``all``) Specify how far down in the course blocks\n+  hierarchy to traverse down. A value of ``all`` specifies the entire\n+  hierarchy. The default value is 0. Example: ``depth=all``.\n+\n+* requested_fields: (list) Indicates fields to return for each block, in\n+  addition to id, type, and display_name, which are always returned. For the\n+  list of possible fields, see the fields listed under ``blocks`` in the\n+  **Response Values** section below. Example:\n+  ``requested_fields=graded,format,student_view_multi_device``.\n+\n+* return_type: (string) Indicates in what data type to return the block data.\n+  Supported values are ``dict`` and ``list``. The default value is ``dict``.\n+\n+* student_view_data: (list) Indicates for which block types the JSON data is\n+  returned in the \"student_view_data\" response value. Example:\n+  ``student_view_data=video``.\n+\n+* username: (string) Required, unless ``all_blocks`` is specified. Example:\n+  ``username=anjali``.\n+\n+\n+=====================\n+Response Values\n+=====================\n+\n+The following fields are returned with a successful response.\n+\n+* root: The ID of the root node of the requested course block structure.\n+\n+* blocks: A dictionary that maps block usage IDs to a collection of information\n+  about each block. Each block contains the following fields.\n+\n+  * id: (string) The usage ID of the block.\n+\n+  * type: (string) The type of block. Possible values include course, chapter,\n+    sequential, vertical, html, problem, video, and discussion. The type can\n+    also be the name of a custom type of block.\n+\n+  * display_name: (string) The display name of the block.\n+\n+  * children: (list) If the block has child blocks, a list of IDs of the child\n+    blocks. Returned only if \"children\" is included in the \"requested_fields\"\n+    parameter.\n+\n+  * block_counts: (dict) For each block type specified in the block_counts\n+    parameter to the endpoint, the aggregate number of blocks of that type for\n+    this block and all of its descendants. Returned only if the \"block_counts\"\n+    input parameter contains this block's type.\n+\n+  * graded (boolean) Whether or not the block or any of its descendants is\n+    graded. Returned only if \"graded\" is included in the \"requested_fields\"\n+    parameter.\n+\n+  * format: (string) The assignment type of the block. Possible values can be\n+    \"Homework\", \"Lab\", \"Midterm Exam\", and \"Final Exam\". Returned only if\n+    \"format\" is included in the \"requested_fields\" parameter.\n+\n+  * student_view_data: (dict) The JSON data for this block. Returned only if the\n+    \"student_view_data\" input parameter contains this block's type.\n+\n+  * student_view_url: (string) The URL to retrieve the HTML rendering of this\n+    block's student view. The HTML can include CSS and Javascript code. This\n+    field can be used in combination with the ``student_view_multi_device``\n+    field to decide whether to display this content to the user. This URL can","path":"docs/en_us/platform_api/source/courses/blocks.rst","position":120,"original_position":120,"commit_id":"56a6f94e9d719f85458c6760b55785839f69b36d","original_commit_id":"56a6f94e9d719f85458c6760b55785839f69b36d","user":{"login":"pdesjardins","id":6510839,"avatar_url":"https://avatars.githubusercontent.com/u/6510839?v=3","gravatar_id":"","url":"https://api.github.com/users/pdesjardins","html_url":"https://github.com/pdesjardins","followers_url":"https://api.github.com/users/pdesjardins/followers","following_url":"https://api.github.com/users/pdesjardins/following{/other_user}","gists_url":"https://api.github.com/users/pdesjardins/gists{/gist_id}","starred_url":"https://api.github.com/users/pdesjardins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdesjardins/subscriptions","organizations_url":"https://api.github.com/users/pdesjardins/orgs","repos_url":"https://api.github.com/users/pdesjardins/repos","events_url":"https://api.github.com/users/pdesjardins/events{/privacy}","received_events_url":"https://api.github.com/users/pdesjardins/received_events","type":"User","site_admin":false},"body":"> to decide whether to display this content to the user\r\n\r\nIt took me a while to understand this sentence. It seems mobile development centered.","created_at":"2016-05-04T15:01:30Z","updated_at":"2016-05-04T15:01:30Z","html_url":"https://github.com/edx/edx-platform/pull/12311#discussion_r62054839","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/12311","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/62054839"},"html":{"href":"https://github.com/edx/edx-platform/pull/12311#discussion_r62054839"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/12311"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/12311","id":68405219,"html_url":"https://github.com/edx/edx-platform/pull/12311","diff_url":"https://github.com/edx/edx-platform/pull/12311.diff","patch_url":"https://github.com/edx/edx-platform/pull/12311.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/12311","number":12311,"state":"open","locked":false,"title":"DOC-2862: Courses API","user":{"login":"catong","id":9041399,"avatar_url":"https://avatars.githubusercontent.com/u/9041399?v=3","gravatar_id":"","url":"https://api.github.com/users/catong","html_url":"https://github.com/catong","followers_url":"https://api.github.com/users/catong/followers","following_url":"https://api.github.com/users/catong/following{/other_user}","gists_url":"https://api.github.com/users/catong/gists{/gist_id}","starred_url":"https://api.github.com/users/catong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catong/subscriptions","organizations_url":"https://api.github.com/users/catong/orgs","repos_url":"https://api.github.com/users/catong/repos","events_url":"https://api.github.com/users/catong/events{/privacy}","received_events_url":"https://api.github.com/users/catong/received_events","type":"User","site_admin":false},"body":"This PR adds documentation for the Courses API to the Open edX Platform APIs guide. Includes doc for the courses and blocks resources.\r\n\r\nDRAFT HTML output is here:\r\nhttp://draft-courses-api.readthedocs.io/en/latest/courses/index.html\r\n\r\nREVIEWERS:\r\n- [ ]  @nasthagiri \r\n- [ ] @pdesjardins \r\n\r\nFYI: @natabene, @jcdyer ","created_at":"2016-04-29T17:23:28Z","updated_at":"2016-05-04T15:01:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b493b2d1a28de91c3e60968fc1d8c052a816af85","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/12311/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/12311/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/12311/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/56a6f94e9d719f85458c6760b55785839f69b36d","head":{"label":"edx:carol/doc/DOC-2862_All","ref":"carol/doc/DOC-2862_All","sha":"56a6f94e9d719f85458c6760b55785839f69b36d","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-platform/deployments","created_at":"2013-05-30T20:20:38Z","updated_at":"2016-05-03T11:23:02Z","pushed_at":"2016-05-04T14:59:17Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":741793,"stargazers_count":2544,"watchers_count":2544,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1548,"mirror_url":null,"open_issues_count":170,"forks":1548,"open_issues":170,"watchers":2544,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"0b6da4cd5a466d71e1467e94e676da7712449591","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-platform/deployments","created_at":"2013-05-30T20:20:38Z","updated_at":"2016-05-03T11:23:02Z","pushed_at":"2016-05-04T14:59:17Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":741793,"stargazers_count":2544,"watchers_count":2544,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1548,"mirror_url":null,"open_issues_count":170,"forks":1548,"open_issues":170,"watchers":2544,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/12311"},"html":{"href":"https://github.com/edx/edx-platform/pull/12311"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/12311"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/12311/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/12311/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/12311/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/56a6f94e9d719f85458c6760b55785839f69b36d"}}}}