Dropbox submission using Python trouble shooting

25 views
Skip to first unread message

Brian Looker

unread,
Sep 26, 2014, 5:26:46 PM9/26/14
to valenc...@googlegroups.com
Hi all,

I cannot figure out what I'm doing wrong with a post call to submit a file to a dropbox. I'm working in Python and I have both worked with my own code through the interpreter and tried using the d2lvalence_util.service code. I'm getting a 403 in either case--the response's .content gives me an "Invalid token" error. I've looked through the API material, checked stack overflow and this group, but cannot track down what I'm doing wrong. I've freshly generated a user context, checked that the user's role has permission to submit files to Dropbox, double checked the format of the post data, but found no luck. I'm hoping to not think about it this weekend, but I get really drawn into puzzles like this. I'm hoping you'll spot the thing that I've missed.

And just a quick thanks to you folks for this service and all the help you provide on here. Have an enjoyable weekend.

Brian

Desire2Learn Staff: Viktor

unread,
Sep 27, 2014, 8:03:55 AM9/27/14
to valenc...@googlegroups.com
From a quick look at your code, it looks like you're forming your authenticated URL with the default value for the HTTP method parameter, which is 'GET', but you're wanting to use a POST route. Thus, the service's response that your token is invalid: it's doing signature generation on its end assuming POST is the method being used.

Desire2Learn Staff: Viktor

unread,
Sep 27, 2014, 8:08:23 AM9/27/14
to valenc...@googlegroups.com
The 403 you're getting when using the service code is a 'forbidden' error, not an invalid token... That would suggest that for some reason it's not thinking you have permissions to do the action you're attempting. But it looks like there's two different errors happening here?

Brian Looker

unread,
Oct 1, 2014, 12:56:44 PM10/1/14
to valenc...@googlegroups.com
That did it! That was the small (yet major) thing I was overlooking. Thank you very much, Viktor!

Desire2Learn Staff: Viktor

unread,
Oct 7, 2014, 9:40:09 AM10/7/14
to valenc...@googlegroups.com
No problem -- you're most welcome.
Reply all
Reply to author
Forward
0 new messages