Python API courses batch_update, doesn't work for 500 courses

Community Explorer

I wrote a Python script to publish a large group of courses at one time using the API for Update courses (  

What I originally wrote was very similar to Mike Nahmias’ post (  

However, it only works for about 350 courses while the limit is listed as 500.  I get a 414 error back instead of 200, because the URL is too long.  Here’s the full error:

<title>414 Request-URI Too Long</title>
<h1>Request-URI Too Long</h1>
<p>The requested URL's length exceeds the capacity
limit for this server.<br />
<address>Apache Server at Port 80</address>

Like Mike, I was using the “requests.put”:
    requests.put(url, headers=headers, params=payload)

So, that explains the error as everything is being put onto the URL and it’s just too long.  

However, when I switch it to use post, it no longer works.  Instead it creates a new course, as do all of these:, headers=headers, params=payload), headers=headers, json=payload), headers=headers, json=json.dumps(payload))

(Thanks to Brian Bennett’s reply and Jason Kocur’s thread for the json ideas, but it doesn’t work for this API.

Has anybody gotten this to work for > 350 courses?  And what’s the secret? Smiley Happy

I’d be happy to try UCF Open’s canvasapi, but I can’t find this batch update for courses.