canvas-lms/doc/api
Dustin Cowles e40552fc63 update docs for getPageContent
refs ADV-80
flag=none

Test plan:
- Generated docs include changes.

Change-Id: I23c43bb18c800ddd5532940c10170616e8201372
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354973
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Dustin Cowles <dustin.cowles@instructure.com>
Product-Review: Dustin Cowles <dustin.cowles@instructure.com>
2024-08-13 18:18:40 +00:00
..
appendix/html RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
data_services Add artifact updated_at and created_at values to LOR LEs 2024-07-16 13:29:16 +00:00
docstring/html RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
fulldoc/html Update LTI Placements Documentation 2024-07-18 16:20:49 +00:00
layout/html Support visibility options in Dynamic Registration 2024-04-10 15:08:31 +00:00
method_details/html raise more helpful exception if API docs can't be generated 2023-05-16 20:01:21 +00:00
tags RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
topic/html rubocop: Style/TernaryParentheses, Style/RedundantParentheses 2023-04-12 14:56:48 +00:00
README.md update the canvas api docs to point to the api policy 2024-01-16 23:16:19 +00:00
api_routes.rb fix more require statements for deploy build 2022-10-04 14:50:54 +00:00
assignment_external_tools.md
assignment_selection_placement.md Update community urls to reflect platform move 2020-08-12 20:17:02 +00:00
assignment_tools.md unify SpeedGrader text 2024-05-29 18:41:43 +00:00
canvas_roles.md doc: create a documentation for Canvas roles 2022-08-25 17:05:03 +00:00
changelog.md Update community urls to reflect platform move 2020-08-12 20:17:02 +00:00
collaborations_placement.md send lti1p1 migration id in Collaborations LTI 1.3 launches 2024-02-22 17:26:06 +00:00
compound_documents.md
content_item.md option for LTI title to not squash assignment name 2024-07-05 17:11:35 +00:00
developer_keys.md Removed old docs about global developer keys 2020-05-07 17:52:45 +00:00
editor_button_placement.md Provide Default Icon for editor_button placement 2024-02-22 03:37:19 +00:00
editor_button_tools.md Provide Default Icon for editor_button placement 2024-02-22 03:37:19 +00:00
endpoint_attributes.md
file_uploads.md error when trying to upload file to deleted folder 2022-12-20 20:09:58 +00:00
graphql.md update graphql documentation 2023-06-13 16:04:00 +00:00
group_category_csv.md don't include group info when none exist 2020-11-05 17:35:29 +00:00
homework_submission_placement.md Update community urls to reflect platform move 2020-08-12 20:17:02 +00:00
homework_submission_tools.md
jwt_access_tokens.md Remove wording about removed feature flag 2020-08-17 18:26:33 +00:00
link_selection_placement.md Update community urls to reflect platform move 2020-08-12 20:17:02 +00:00
link_selection_tools.md
lti_dev_key_config.md support `tool_id` in LTI Dynamic Registration 2024-06-25 14:49:31 +00:00
lti_window_post_message.md update docs for getPageContent 2024-08-13 18:18:40 +00:00
masquerading.md
migration_selection_placement.md Overhaul External Tools API Docs 2019-10-29 18:13:24 +00:00
navigation_tools.md update getPageContent scope 2024-07-18 15:26:51 +00:00
oauth.md update the canvas api docs to point to the api policy 2024-01-16 23:16:19 +00:00
oauth_endpoints.md doc: announce OIDC Auth URL change 2023-06-15 17:06:14 +00:00
object_ids.md allow lti_context_id in Group API calls 2022-12-07 16:24:32 +00:00
originality_report_appendix.md unify SpeedGrader text 2024-05-29 18:41:43 +00:00
outcomes_csv.md Add 255 char limit error when importing friendly desc 2024-02-22 20:22:20 +00:00
pagination.md Add note about lowercase Link header name 2024-05-20 21:24:11 +00:00
placements_overview.md Show warning on saving LTI 1.3 devkeys with resource_selection 2024-08-12 14:35:10 +00:00
plagiarism_platform.md Add information about plagiarism to the LTI manual 2022-05-12 21:36:37 +00:00
provisioning.md send environment specific url in LTI calls 2023-07-05 23:29:10 +00:00
registration.md support `tool_id` in LTI Dynamic Registration 2024-06-25 14:49:31 +00:00
sis_csv.md add documentation for temporary_enrollemnt_source_user_id 2024-06-26 19:32:54 +00:00
subscriptions_appendix.md
throttling.md remove a parenthetical from documentation 2022-04-22 17:22:29 +00:00
tools_intro.md Fix broken links in LTI docs 2023-05-25 18:03:21 +00:00
tools_variable_substitutions.head.md Update community urls to reflect platform move 2020-08-12 20:17:02 +00:00
tools_variable_substitutions.md Use a Group's Course for LTI var expansions 2024-07-31 23:28:41 +00:00
tools_xml.md add canvas_environment to LTI 1.3 login request 2023-03-30 22:45:17 +00:00
xapi.md Update xAPI links 2019-03-27 15:15:57 +00:00

README.md

Welcome to the Canvas LMS API Documentation

Canvas LMS includes a REST API for accessing and modifying data externally from the main application, in your own programs and scripts. This documentation describes the resources that make up the API.

To get started, you'll want to review the general basics, including the information below and the page on Authentication using OAuth2.

API Changes

For API resources, such as the API Change Log for additions, changes, deprecations, and removals, view the Canvas API page in the Canvas Community.

API Policy

Please carefully review the Canvas API Policy before using the API.

Schema

All API access is over HTTPS, against your normal Canvas domain.

All API responses are in JSON format.

All integer ids in Canvas are 64 bit integers. String ids are also used in Canvas.

To force all ids to strings add the request header Accept: application/json+canvas-string-ids This will cause Canvas to return even integer IDs as strings, preventing problems with languages (particularly JavaScript) that can't properly process large integers.

All boolean parameters can be passed as true/false, t/f, yes/no, y/n, on/off, or 1/0. When using JSON format, a literal true/false is preferred, rather than as a string.

For POST and PUT requests, parameters are sent using standard HTML form encoding (the application/x-www-form-urlencoded content type).

POST and PUT requests may also optionally be sent in JSON format format. The content-type of the request must be set to application/json in this case. There is currently no way to upload a file as part of a JSON POST, the multipart form type must be used.

As an example, this HTML form request:

name=test+name&file_ids[]=1&file_ids[]=2&sub[name]=foo&sub[message]=bar&flag=y

would translate into this JSON request:

{ "name": "test name", "file_ids": [1,2], "sub": { "name": "foo", "message": "bar" }, "flag": true }

With either encoding, all timestamps are sent and returned in ISO 8601 format (UTC time zone):

YYYY-MM-DDTHH:MM:SSZ

Authentication

API authentication is done with OAuth2. If possible, using the HTTP Authorization header is recommended. Sending the access token in the query string or POST parameters is also supported.

OAuth2 Token sent in header:

curl -H "Authorization: Bearer <ACCESS-TOKEN>" "https://canvas.instructure.com/api/v1/courses"

OAuth2 Token sent in query string:

curl "https://canvas.instructure.com/api/v1/courses?access_token=<ACCESS-TOKEN>"

Read more about OAuth2 and how to get access tokens.

SSL

Note that if you make an API call using HTTP instead of HTTPS, you will be redirected to HTTPS. However, at that point, the credentials have already been sent in clear over the internet. Please make sure that you are using HTTPS.

About this Documentation

This documentation is generated directly from the Canvas LMS code. You can generate this documentation yourself if you've set up a local Canvas environment following the instructions on Github. Run the following command from your Canvas directory:

bundle exec rake doc:api