Add content by external tool using API

181 views
Skip to first unread message

tapas sahu

unread,
Jun 9, 2015, 7:08:48 AM6/9/15
to canvas-l...@googlegroups.com
Hi,
I Am using "https://<canvas_url>/api/v1/courses/<course_id>/modules/<module_id>/items" for add the content to my canvas from a external tool.
but problem is when i am launch the external tool i am not getting module_id .
Please some one guide me how to get module_id.
Thanks in advance.

Brad Humphrey

unread,
Jun 9, 2015, 11:23:30 AM6/9/15
to canvas-l...@googlegroups.com
Why do you need the module_id in order to add content to canvas.  Are you using resource selection?  https://canvas.instructure.com/doc/api/file.link_selection_tools.html

--

---
You received this message because you are subscribed to the Google Groups "Canvas LMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to canvas-lms-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tapas sahu

unread,
Jun 11, 2015, 3:22:41 AM6/11/15
to canvas-l...@googlegroups.com
Yes  i m  using resource selection.

Brad Humphrey

unread,
Jun 11, 2015, 11:46:04 AM6/11/15
to canvas-l...@googlegroups.com
You can use custom variable substitutions to get the module_id and module_item_id for the current launch.  In your tool configuration you need to add custom variables with the values $Canvas.module.id and $Canvas.moduleItem.id

You won't get this until after you add the item though.

tapas sahu

unread,
Jun 16, 2015, 7:01:47 AM6/16/15
to canvas-l...@googlegroups.com
Thanks Brad Humphrey,
Please suggest me how to
add custom variables in tool configuration.
Thanks

Brad Humphrey

unread,
Jun 16, 2015, 6:16:11 PM6/16/15
to canvas-l...@googlegroups.com

--

tapas sahu

unread,
Jun 17, 2015, 3:46:08 AM6/17/15
to canvas-l...@googlegroups.com

Hi Brad Humphrey,
when i validate the above xml it gives error.
Any help please.
Message has been deleted

tapas sahu

unread,
Jul 1, 2015, 3:47:23 AM7/1/15
to canvas-l...@googlegroups.com

tapas sahu

unread,
Jul 27, 2015, 9:43:23 AM7/27/15
to Canvas LMS Users, br...@instructure.com

Thanks Brad Humphrey,
when i am launch for resource selection

$Canvas.moduleitem.id  is not replaced by its value.
is there any setting for this.
Thanks,
Tapas

tapas sahu

unread,
Jan 8, 2016, 8:51:36 AM1/8/16
to Canvas LMS Users

HI  Brad Humphrey,

when i am launch for resource selection
$Canvas.moduleitem.id  is not replaced by its value.
is there any setting for this.
Thanks,
Tapas

Brad Humphrey

unread,
Jan 8, 2016, 11:02:15 AM1/8/16
to canvas-l...@googlegroups.com
The resource selection variable is actually $Canvas.moduleItem.id instead of $Canvas.moduleitem.id. However, I don't think you will get the module item id during resource selection because the module item hasn't been created yet. You will only get module item id for a basic-lti-launch for a module item, not for creating one.

tapas sahu

unread,
Jan 10, 2016, 11:55:36 PM1/10/16
to Canvas LMS Users

HI  Brad Humphrey,

when i am launch for resource selection

$Canvas.module.id  is not replaced by its value.
Please suggest how to get it.

is there any setting for this.
Thanks,
Tapas

tapas sahu

unread,
Jan 11, 2016, 12:38:06 AM1/11/16
to Canvas LMS Users

HI  Brad Humphrey,
Thank you for your reply.


when i am launch for resource selection

$Canvas.module.id  is also  not replaced by its value but $Canvas.user.id is replaced.
Find the image in which i am getting user id but not getting module id.
Please suggest me how to get module id.


is there any setting for this.
Thanks,
Tapas
2016-01-11 11_04_45-Course Modules_ LMS.png

Brad Humphrey

unread,
Jan 11, 2016, 10:56:50 AM1/11/16
to canvas-l...@googlegroups.com
Resource selection happens during the creation of modules when you are using a tool to select the content for the module item.

Tapas Sahu

unread,
Aug 26, 2016, 7:00:43 AM8/26/16
to Canvas LMS Users
 Thank you  Humphery.
i am using xml  which is provided by canvas official site but when i try to validate this xml it gives error .
below is my xml.please suggest
<?xml version="1.0" encoding="UTF-8"?>
<cartridge_basiclti_link xmlns="http://www.imsglobal.org/xsd/imslticc_v1p0"
    xmlns:blti = "http://www.imsglobal.org/xsd/imsbasiclti_v1p0"
    xmlns:lticm ="http://www.imsglobal.org/xsd/imslticm_v1p0"
    xmlns:lticp ="http://www.imsglobal.org/xsd/imslticp_v1p0"
    xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation = "http://www.imsglobal.org/xsd/imslticc_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticc_v1p0.xsd
    http://www.imsglobal.org/xsd/imsbasiclti_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imsbasiclti_v1p0.xsd
    http://www.imsglobal.org/xsd/imslticm_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticm_v1p0.xsd
    http://www.imsglobal.org/xsd/imslticp_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticp_v1p0.xsd">
    <blti:title>Protractor Tool</blti:title>
    <blti:description>This tool provides an online, interactive protractor for students to use</blti:description>
    <blti:launch_url>https://example.com/tool_redirect</blti:launch_url>
    <blti:extensions platform="canvas.instructure.com">
      <lticm:property name="privacy_level">public</lticm:property>
    </blti:extensions>
</cartridge_basiclti_link>
Reply all
Reply to author
Forward
0 new messages