Leading through Chaos - Insights and Actions • Browse the resources from the keynote presented by the Academic Strategy Team.
Found this content helpful? Log in or sign up to leave a like!
Starting this off with a not sure if there's a way to cross-post here, as I also posted this in the AI community group: Smart Search API
Hi all, I am trying to utilize the Smart Search API, however, I am running into an unexpected error.
When discussing this with a few technical leads at InstructureCon, we understood that the API endpoint should be accessible regardless of whether or not Smart Search is turned on for the account.
However, when hitting the endpoint, I am getting the following error:
b'{"status":"unauthorized","errors":[{"message":"user not authorized to perform that action"}]}'
Here is my code:
def get_embeddings(self, course_id,search_query):
#/api/v1/courses/:course_id/smartsearch
url = f"{self.server_url}/api/v1/courses/{course_id}/smartsearch"
payload = {'q': search_query}
r = requests.get(url, headers=self.headers(), params=payload)
if r.status_code == 200:
return r.json()
else:
r.raise_for_status()
I have verified the following:
- I am a sub account admin.
- I am an instructor in the course I am attempting to run the API on.
- The access token is valid.
Any ideas what may be causing this? Has anyone been able to successfully communicate with the end point?
Hi @DrewHopkins,
According to the Canvas source code, Smart Search needs to be enabled on your account first: https://github.com/instructure/canvas-lms/blob/3b490cb5b33f18723d7349487bb92edd8937af2d/app/controll....
The Smart Search feature may not be released to production yet, depending on when Instructure updates your Canvas instance. IIRC, it was supposed to be coming in today's deploy, though our Canvas instance is still reporting that it's on version 2024-07-03.342 (You can find this information at https://[Your School].instructure.com/health_check.json). I'm pretty sure today's deploy should have version 2024-07-17.335.
To interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in