manuelgarciaph
Look at the LTI Variable Substitutions documentation page.
When you add a custom field in the LTI configuration, it gets sent along with the API request.
- Canvas.course.id will return the course ID
- Canvas.user.id or user.id will return the user ID. If, for some reason, you need the global ID across all Canvas shards, there is also a Canvas.root_account.global_id and Canvas.user.globalId.
In the custom fields, the left side is the name you want to use and the right side is the variable substitution, prefaced with a $. For example: course.id=$Canvas.course.id
In the LTI launch request, the fields names (left side of assignment in the custom fields) are prefixed with custom_ and periods are changed to underscores: course.id would become custom_course_id.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.