POST sis_account_id vs. GET sis_account_id

HansDB
Community Member

Hi,

I've been using the Canvas API for years now, overall I'm happy with the way it works and the way it's documented. However when rewriting some (well all) of the integration code we have with our student information system, I stumbled upon the following problem which I had completely forgotten about since doing the original integration (way back in 2017)

My situation:

I have a sub account with SIS ID "A-FAC-GDT". Requesting the sub-accounts for that sub-account is as simple as doing the following GET request:

https://ehb.test.instructure.com/api/v1/accounts/sis_account_id:A-FAC-GDT/sub_accounts

Works perfectly. However, when I try to do a post tot that same URI to create a new sub-account, I get a "404 Not Found" error. It obviously works fine when using the internal ID of the account in question (which I tend to never use for integrations)

Is this (still) a known limitation in the way sis_account_ids (and other variations on the same for users, courses, etc.) work or am I missing something? It makes no sense to me that you can use the sis_account_id to retrieve sub accounts but not to create one?

Thanks for any and every kind of input.

Hans

PS. Yes I know I could just keep track of the internal id's but that's not my preferred way of working ... and neither is having to rely on something as outdated as a CSV, which does not give me instant and granular feedback when I need it.

0 Likes