Hi Stuart,
I tried the Canvas Live API, and it doesn't work either, but I think for
some other reasons. It doesn't work there even without an attachment id,
and I'm using the identical access token as I was using previously. That
token seems operational since other queries seem to work.
But I did try directly using the JavaScript Developer Console on chrome,
and got exactly the say 500 response error as when going through the canvas
python sdk. And it also succeeds when sending without an attachment. So
this does narrow it down a bit as it shows it is nothing to do with the
api, and seems to have something to do with including an attachment id. I
also tried changing the recipient, and it is the same error even when I
make the recipient myself. Here's the query I used that worked (no
attachment_id)
$.post("/api/v1/conversations?body=testoftheemailsystem.Pleaseignore.&recipients=1586543&subject=Thisisatest.Ignore.&group_conversation=False&mode=sync",
function(data) { console.log(data); },'json');
and this is one that failed:
$.post("/api/v1/conversations?body=testoftheemailsystem.Pleaseignore.&recipients=1586543&subject=Thisisatest.Ignore.&group_conversation=False&attachment_ids=58928187&mode=sync",
function(data) { console.log(data); },'json');
with the response:
jquery.js:8240 POST
https://cole2.uconline.edu/api/v1/conversations?body=testoftheemailsystem.Pleaseignore.&recipients=1586543&subject=Thisisatest.Ignore.&group_conversation=False&attachment_ids=58928187&mode=sync
500 (Internal Server Error)
and the response text: "{"errors":[{"message":"An error
occurred.","error_code":"internal_server_error"}],"error_report_id":"99293251"}
"
I guess the question is, has anyone else successfully included an
attachment this way through the REST API? If so, I guess I should check if
other users with our same Canvas instance, that we're using at the
University of California, have the same problem. I've been successfully
using the REST API to do all sorts of things involving downloading student
data, and uploading pages, and haven't encountered a problem like this
before.
Cheers,
Josh
On Sun, Dec 10, 2017 at 1:53 AM, stuart.ryan@uts.edu.au <