How to enable external tool using API for course that was installed at account level

Jump to solution
ddieckma
Community Novice

I am installing an external tool with course navigation at the account level that is disabled by default using the API.  The tool shows up in the courses for the account with the proper disabled status in the Navigation settings.  At a later time I want to enable that tool for a specific course within the account using the API.  However, it is unclear to me how to update the course-specific navigation settings for this tool as the external_tool ID does not seem to be valid within the context of a specific course.

I think the concept that I'm missing is how to manage course-specific settings for external tools defined in the account.

POST /api/v1/accounts/5/external_tools

{

    "course_navigation": {

     "url": "https://www.hostname.com/url.html",

      "text": "TEST",

      "visibilitys": "members",

      "default": "disabled",

      "enabled": "True",

      "label": "TEST",

      "selection_width": 800,

      "selection_height": 400,

      "icon_url": "https://www.hostname.com/icon.gif"

    }

   ...

}

This works great and gives me back an external_tool (with id = 123) that shows up in all the courses in my account with a disabled status in the Navigation settings.  Now I want to enable the tool for a specific course (with id = 456) using the API

PUT /api/v1/courses/456/external_tools/123

Returns a 404.  Same with PUT /api/v1/accounts/5/courses/456/external_tools/123

How do I enable the navigation placement for  a tool defined at the account level for a specific course?

Labels (2)
1 Solution
RobDitto
Community Champion

How do I enable the navigation placement for a tool defined at the account level for a specific course?

Navigation order and hidden/visible can be edited using the Tabs API PUT ​method. 

You'll need to specify the tab's :tab_​id; this can be obtained either by GETting all current tabs using that API, or by constructing a value based on the "id" returned in the External Tools API POST response. For example, if the External Tools API POST response contained "id": 780, the :tab_​id value for use with Tabs API should be ​context_external_tool_780​.

View solution in original post