canvas-lms/doc/api
Jeremy Stanley ac7e8d3c52 add data-api-endpoint for module links in user content
test plan:
 - in a wiki page, use the wiki sidebar to create links to the
   Modules List and to a specific module
 - save the page
 - inspect the page source and you should find data-api-endpoint
   and data-api-returntype attributes on these links
   as documented at /doc/api/file.endpoint_attributes.html

fixes CNVS-22381

Change-Id: If805689a3974f6e101d5c640521da53b19db585d
Reviewed-on: https://gerrit.instructure.com/60235
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-08-07 20:46:09 +00:00
..
appendix/html integrate yard-appendix plugin with canvas YARD cfg 2013-02-08 11:50:37 -07:00
docstring/html rename doc/templates/rest to doc/api 2011-12-30 09:00:27 -07:00
fulldoc/html endpoint for identifying assignments for bulk grade export 2015-05-27 15:33:37 +00:00
layout/html add headers to inform the client where they stand for throttling 2015-04-09 15:52:22 +00:00
method_details/html endpoint for identifying assignments for bulk grade export 2015-05-27 15:33:37 +00:00
tags integrate yard-appendix plugin with canvas YARD cfg 2013-02-08 11:50:37 -07:00
topic/html converting @object notation to @model part 11/11 2014-02-12 15:55:10 +00:00
README.md add note in api documentation about 64 bit ids 2013-08-01 19:56:37 +00:00
assignment_tools.md add resultTotalScore for LTI 1 outcome service 2015-01-27 17:59:08 +00:00
compound_documents.md define canvas-style compound API documents 2013-07-17 02:48:45 +00:00
editor_button_tools.md fixes improperly formatted external tool documentation 2013-10-31 20:43:09 +00:00
endpoint_attributes.md add data-api-endpoint for module links in user content 2015-08-07 20:46:09 +00:00
file_uploads.md document the time the signature is good for 2013-10-29 20:21:04 +00:00
homework_submission_tools.md fixes improperly formatted external tool documentation 2013-10-31 20:43:09 +00:00
link_selection_tools.md fixes improperly formatted external tool documentation 2013-10-31 20:43:09 +00:00
live_events.md send asset accesses as live events 2015-05-05 12:52:50 +00:00
masquerading.md document as_user_id 2012-12-04 13:28:10 -07:00
navigation_tools.md extension tool launches default to settings from main tool 2012-06-26 12:10:36 -06:00
oauth.md update link in api doc to request a Developer key 2014-11-12 16:07:26 +00:00
object_ids.md fix formatting of special ids in api docs 2014-02-13 19:39:38 +00:00
pagination.md change api pagination to include the current page link 2013-08-16 19:13:25 +00:00
sis_csv.md allow setting auth providers on sis import 2015-08-07 20:23:45 +00:00
throttling.md add headers to inform the client where they stand for throttling 2015-04-09 15:52:22 +00:00
tools_intro.md fixes broken links in api documentation to LTI 2014-06-26 15:27:13 +00:00
tools_xml.md fixes improperly formatted external tool documentation 2013-10-31 20:43:09 +00:00
xapi.md add documentation for xapi service 2014-10-31 02:38:32 +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.

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.

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

would translate into this JSON request:

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

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.

API Terms of Service

Please carefully review The Canvas Cloud API Terms of Service before using the API.

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 itself. 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