file attachment to dropbox feedback by API

I am following up on a post that I had last week after consulting with my admin. I am working on a Python API to automate several processes with my LMS (grades, dropbox). I have encountered issues uploading files to the dropbox feedback as an attachment with the resumable process. I pretty sure the established scopes are correct. The code has been setup to give detailed logging. For a reference, the calls I am looking at are: see POST /d2l/api/le/(version)/(orgUnitId)/dropbox/folders/(folderId)/feedback/(entityType)/(entityId)/attach and POST /d2l/api/le/(version)/(orgUnitId)/dropbox/folders/(folderId)/feedback/(entityType)/(entityId)/upload (this is the first step.) As noted, a resumable process is required. ( https://docs.valence.desire2learn.com/basic/fileupload.html#resumable-uploads ).

The code gets the 308 incomplete (returns a filekey) and then subsequently returns 404 errors when I try to upload in chunks. As my admin noted this either could be an incorrect path (I'm taking the /d2l/upload/*key* and appending it to the university's url "https://unversity.edu"-i.e., the same one I use for other calls such as grades, dropbox downloads, etc) or the lifetime of the folder. Has anyone encountered this previously? Is there an alternative path that I should be using? The calls and headers (some information scrubbed) I have used for the two steps are below this email.

Thanks in advance for any help you can provide! When this is done I'd like to make the Python code available to the community. I'm also happy to share the GUI I've started to put together related to dropbox/grades (does an MPI downlaod of dropbox submissions). Some things are customized to a particular course I am teaching.

Sincerely,
Sean

PS. Here is the jist of what my code is calling per the log files and the returned codes. Note that my LMS path is scrubbed as are the tokens.

{

"Authorization": "Bearer TOKEN STRING omitted",

"X-Upload-Content-Type": "text/plain",

"X-Upload-Content-Length": "53",

"X-Upload-File-Name": "test.txt",

"Content-Length": "0",

"Origin": https://university.edu

}

  • It returns:
    • STATUS: 308 Resume Incomplete
    • Location: /d2l/upload/XXXXXX
    • GOOD- as this is expected
  • The subsequent step called is where I get a 404 and have questions. The call is to:

{

"Authorization": "Bearer TOKEN",

"Content-Type": "application/offset+octet-stream",

”Content-Range": "bytes 0-52/53",

"Content-Length": "53",

"Origin": "https://University.edu"