Using REST API to change an External Tool name/label, resource_selection label doesn't change

phanley
Community Contributor

Updated

I edited this to focus on the resource_selection[label] issue, because as I mentioned below, the editor_button[label] attribute correctly updated when I PUT the change up using editor_button[text], but doing the same thing using resource_selection[text] does not change the name of the tool in the external tools selection modal.

We have a tool that links to library content  - when I originally installed for the Library I followed the directions on the vendor site and used the name LibApps Library Content for the tool.  The Library asked that the tool be renamed Library Resources and since I had set the tool up via Admin > Settings > Apps, I went back to that view and changed the external tool name as requested. 

But then as it turned out the text labels for the tool (e.g. when adding the tool via a module or the editor) didn't change to match the app name. 

So I checked with the REST API:

$ curl -X GET "https://templeu.instructure.com:443/api/v1/accounts/1/external_tools/2074" -H "$canv_auth"
{

    "id": 2074,

           "name": "Library Resources",

....

    "resource_selection": {

      "enabled": "true",

      "label": "LibApps Library Content",

      "selection_width": 800,

      "selection_height": 600,

      "icon_url": "https://libapps.s3.amazonaws.com/apps/libapps/images/favicon_lti.png"

    }, ...

so I did this 

$ curl -X PUT "https://templeu.instructure.com:443/api/v1/accounts/1/external_tools/2074"  -H "$canv_auth" \

 -F 'resource_selection[label]=Library Resources'

 

but what I get back was the same JSON response -- weird, except this caused me to check the docs and I noticed that: 

  1. editor_button[label] and resource_selection[label] are not listed as a parameter at External Tools - Canvas LMS REST API Documentation 
  2. any parameter that is included is [text] not [label] (e.g. link_selection[text] or course_navigation[text]

So I tried

$ curl -X PUT "https://templeu.instructure.com:443/api/v1/accounts/1/external_tools/2074"  -H "$canv_auth"  \

-F 'resource_selection[text]=Library Resources'

 

and got back (edited to be just the resource_selection section because this is getting loonnng):

  "resource_selection": {

    "text": "Library Resources",

    "label": "Library Resources",

    "selection_width": 800,

    "selection_height": 600,

    "icon_url": "https://libapps.s3.amazonaws.com/apps/libapps/images/favicon_lti.png"

  },

Success! Note that PUTting resource_selection[text] also changed resource_selection[label] which is a little weird, but I'll let it go. 

Unfortunately, the links to the tool are still the same:

screen shot showing that the link name has not changed in the Canvas GUI

Does anyone know what's going on? I've checked with a browser that had cache disabled, and it shows up with the old label there as well, so I don't think it's a client-side caching issue. Are tool names & labels cached somewhere in our canvas instance?  I don't want to delete the tool and recreate it, because courses are using it.

Is there a way to force it to recalibrate to the correct name? 

Labels (2)