Blueprint attribute of GET Course api always returns false

Jump to solution
Community Member

I am trying to mark courses as blueprint courses via the api. I am using Powershell and to start I am using curl do a GET as follows:

curl -H @{"Authorization" = "Bearer <token>"} -Method GET "<id>"

This call always returns blueprint=false.

I have tried doing an update via curl

curl -H @{"Authorization" = "Bearer <token>"} -Method PUT -Body "course[blueprint]=true" "<id>"

I can change the Name and other attributes. I also can change the Blueprint setting in the Canvas UI but the GET still returns blueprint=false.

Any guidance welcome.




Labels (3)
1 Solution
Community Member


Thanks for the answer. Unfortunately I am using Powershell so -F didn't work but when I researched what the difference was between -Body and -F I found what worked for me. I had to add a -ContentType.

$postParams = @{"course[blueprint]"="true"}
$res = @{"Authorization" = "Bearer <token>"} -Method PUT -Body $postParams -ContentType application/x-www-form-urlencoded "https://<canvasurl>/api/v1/courses/101"

That worked for me and I saw the updates immediately reflected in Canvas UI.


View solution in original post