SIS Import API error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
));
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.