phanley
Community Contributor

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

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? 

Tags (2)
4 Replies
kona
Coach Emeritus

 @phanley , I’m not sure if the answer to this, but due to the technical nature of the question I’m going to share this with the https://community.canvaslms.com/groups/canvas-developers?sr=search&searchId=2254cdde-f928-4535-9dc0-...‌ group to see if they can help. Hope they can assist!

stuart_ryan
Coach Emeritus

Hi  @phanley ,

I wanted to check in and see how you have gone with this? It has been a while, and unfortunately, it seems as though your query has really stumped the community.

Were you able to make any progress on this, or is it still outstanding?

Cheers,
Stuart

0 Kudos
tdelillo
Community Champion

Have you asked the vendor or your librarians? Unless you are configuring via XML (that you have the ability to tweak), the name of the tool would be coded into the tool on the LibApps side.

ColinMurtaugh
Community Champion

Hi Peter --

I tried experimenting with a test LTI tool in our instance, and I found that if I update the link_selection[text] value that does change the name that I see in the New Module Item > External Tool dialog box.  I haven't played with it enough to say I understand exactly what's going on here, but that might be something to try. 

--Colin