Highlighted
Community Member

SIS Import API error

I am trying to call SISimport API with the attachment csv file, there's error indicating "Couldn't find Canvas CSV import headers", and also noted in SIS importing log that "downloadable_attachment_ids" did not get any file information.  While I attached the same csv file, directly call sisimport using cUrl command line, it works fine.  So, is something I missed during passing the file params?    Thanks in advance!

Ruiling

$testcsv= 'enrollments.csv';

$file_name_with_path =realpath('./'$testcsv);

$postdata = array(

    'name'=> $testcsv,

    'file' => '@'.$file_name_with_path);

$testheaders = array(

'Content-Type: text/csv');

    $ch = curl_init();

    curl_setopt_array($ch, array(

        CURLOPT_URL => $myUrl.'accounts/'.$AccountId.'/sis_imports.json?import_type=instructure_csv&extension=csv&access_token='.$apiToken,

        CURLOPT_HTTPHEADER =>array('Content-Type:text/csv'),

         CURLOPT_RETURNTRANSFER => 1,

        CURLOPT_POST => 1,

        CURLOPT_POSTFIELDS => $postdata

    ));

0 Kudos
1 Reply
Highlighted
Navigator

Hi there, tadm9280@vt.edu...

I am reviewing some of the older questions here in the Community, and I came across your question.  Although I don't really have an answer for you, I wanted to check with you because I noticed that we have not heard back from you since you first posted your question on September 4, 2019.  It looks like you may have stumped Community members with your question.  Have you been able to find any solutions on your own since you first posted your question five months ago?  If so, would you be willing to share your findings with us back here in this topic?  Or, if you are still looking for some help with this question, please let us know that as well.  Either way, we would like to hear back from you.  For now, I am going to mark your question as "Assumed Answered"...not because we've been able to find a solution for you...but more because we've not heard back from you and because there hasn't been any new activity in this topic since September.  However, that won't prevent you or others from posting additional questions and/or comments below that are related to this topic.  I hope that's okay with you.  Looking forward to hearing back from you soon.

0 Kudos