Skip to content

[Applications] Register

Julian Curtis-Zilius edited this page May 17, 2018 · 8 revisions

Using this API, you can register your application through CanvasTools Applications and get your own Canvas LMS access token to perform actions on behalf of the user. Applications have unrestricted access and can be managed through the CanvasTools Control Panel.

Request Body


  • name: The name of the application.
  • description: A description of what the application does.
  • owner: The plain text name of the owner of the application.
  • homepageURL: The URL of your application.
  • details: We recommend using this field to explain to the user why you need to have account access.
  • tokenName: The name of the token that will show up in Canvas settings.

Response Body


If user hit the "deny" button, the response will return back false. Otherwise you will receive an Application:

  • token: The access token you can use with the Canvas API. Token can be appended to all Canvas API requests (https://canvas.instructure.com/api/v1/courses?access_token=)
  • userID: The ID of the Canvas LMS user. This will be needed to perform any actions on the user.
  • canvasDomain: Needed for all API calls, this is the domain you call from. (https://canvas.instructure.com)
  • tokenID: The ID of the token, this is required for future CanvasTools API calls. We recommend storing it in your database or in cookies.
  • The response will also contain your request body.

Building a Canvas API URL


To call the Canvas API, use a format like this after receiving a response from the CanvasTools API. This URL is for the Canvas "Get user profile" API.

var url = response.canvasDomain + '/api/v1/users/' + response.userID + '/profile?access_token=' + token;
console.log(url)

API Use


// The ID of the CanvasTools Chrome Extension (Don't change this)
var editorExtensionId = "gmdmngbeceipkojacdoljnllcnfpdgce";
  var application = {
    register: {
      details: 'In order to use your Canvas account for a demo.',
      owner: 'CanvasTools Demo',
      homepageURL: 'https://canvastools-demo.glitch.me/',
      description: 'CanvasTools Demo allows user to see what CanvasTools Applications looks like in action!',
      tokenName: 'CanvasTools Demo',
      name: 'CanvasTools Demo'
    }
  }
  chrome.runtime.sendMessage(editorExtensionId, {application: application}, function(response) {
    if (response === false) {
      // The user clicked the "Deny" button. 
    } else {
      console.log(response);
    }
  });

Executing the above code would result in a message popup that looks like this: