cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
steven_hill
Community Participant

Diffing Mode and curl

We current import our data from Banner to Canvas with a script.   The .csv files are generated and a curl command issued to send it off to Canvas.  This all works well.  The question is how to use Diffing Mode with curl.  I see examples of the curl command and examples of Diffing Mode, but not both together.  Alternately, we're looking for a way to deactivate students via the curl command.Find Answers@

7 Replies
kona
Community Coach
Community Coach

 @steven_hill , welcome to the Community! Due to the technical nature of this question I'm going to share it with the https://community.canvaslms.com/groups/canvas-developers?sr=search&searchId=ad927705-2c06-43bb-b093-...‌ group to see if they can assist. They are the ones who work on these types of things and you might consider joining this group so you have access to their resources. 

steven_hill
Community Participant

Thanks!  I have joined.

James
Community Champion

I haven't used the diffing mode, but it looks like it's just another parameter that you pass to the query like anything else in the API. The SIS Imports API gives the particulars of the query parameters for diffing mode.

That page, however, is lacking on supplying parameters, which seems to be propagating to other pages and it's harder to find examples. It might be -F for get statements and possibly -d for post commands. I use CURL from within a program not the command line version, so I don't know for sure. Canvas API documentation suggests -F in one spot and -d in another, but both with a POST.

pklove
Community Champion

curl -F attachment=@$file \
     -F "diffing_data_set_identifier=2018S1" \
     -H "Authorization: Bearer $token" \
    "$server/api/v1/accounts/$account_id/sis_imports.json?import_type=instructure_csv"
steven_hill
Community Participant

So, some testing later and it seems to be working.  A few caveats to Peter's post for future questions:

The identifier (2018S1) is just a string and not associated with any term.  We used MainFeed.

The identifier is what is in quotes, not the diffing_data_set_identifier.

 

Our code looked like this:

curl -F attachment=@<full path to file to import> -F diffing_data_set_identifier="MainFeed" -F diffing_drop_status="inactive" -H "Authorization: Bearer <token>" 'https://<site>/api/v1/accounts/self/sis_imports.json?import_type=instructure_csv'

Thanks for the help!

Hello Steven, 

I am trying to figure out this line:

diffing_data_set_identifier="MainFeed"

 

Should I use the import ID from the previous file as the diffing data set indentifier, or if my file name was "file3", then, the diffing data set identifier should be set to "file3"?