Import category groups through CSV via Canvas API

Sindhuja
Community Member

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>
 
I get the following as the response :-
{
"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

I get the following as response:

{

   "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. 

 

 

Labels (2)
0 Likes