Your Community is getting an upgrade!
Read about our partnership with Higher Logic and how we will build the next generation of the Instructure Community.
I'm trying to Create Groups in a Group Category through a CSV import using CANVAS API.
I get a 200 OK response, in the canvas GUI all groups get added correctly as mentioned in the CSV file. But the students assigned under each group is not matching with the CSV file data.
I get the workflow state as queued and failed in the response.
CSV file has the following headers:-
name |
canvas_user_id |
user_id |
login_id |
sections |
group_name |
canvas_group_id |
group_id |
curl request:-
curl --location --request POST '<base canvas url>/api/v1/group_categories/:group_category_id/import' \
--header 'Authorization: Bearer <token>\
--form 'attachment= <csv file>
{
"id": ###,
"context_id": ###,
"context_type": "GroupCategory",
"user_id": null,
"tag": "course_group_import",
"completion": 0.0,
"workflow_state": "queued",
"created_at": "####",
"updated_at": "####",
"message": null,
"url": "https://<canvas base url>/api/v1/progress/<progress_id>"
}
I tried using the progress_id from the above response to check the completion and status information about the asynchronous job,
GET /api/v1/progress/:progress_id
{
"id": ###,
"context_id": ###,
"context_type": "GroupCategory",
"user_id": null,
"tag": "course_group_import",
"completion": 76.33587786259542,
"workflow_state": "failed",
"created_at": "###",
"updated_at": "###",
"message": "Unexpected error, ID: 89690000000109630",
"url": "https://<canvas base url>/api/v1/progress/<progress_id>"
}
Has anyone encountered this issue? Need assistance in Creating Groups in a Group Category through a CSV import using CANVAS API.
What, specifically, are you trying to create?
When I look at the docs for the API you're calling, "Import category groups" (https://canvas.instructure.com/doc/api/group_categories.html#method.group_categories.import ) it looks like the API is for creating group categories, and says
For more information on the format that's expected here, please see the “Group Category CSV” section in the API docs.
The Group Category CSV section of the docs ( https://canvas.instructure.com/doc/api/file.sis_csv.html ) shows the header/fields in the group_category.csv as being
group_category_id,account_id,course_id,category_name,status
which is not what's in your CSV, as far as I can tell...
Where did you get the list of header fields that you used for your CSV file?
i referred to https://canvas.instructure.com/doc/api/file.group_category_csv.html
for CSV headers
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
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.