Hello there!
I have found myself spending several hours into this issue of mine and couldn’t find a clear answer by browsing the forums. Here’s my situation:
I have written a personal OAuth library for a project I’m working on, and it’s been working wonderfully so far with Twitter both for GET and POST requests. However I can’t quite get it working on the media endpoint; specifically, with the APPEND command. The INIT command works fine, but APPEND returns error code 400 (“Bad authentication data.”)
There does not seem to be much details on this in the docs. Upon further investigation and tests with twurl, it turns out the all the oauth_* parameters must be included in the “Authentication” HTTP request header, and not in the body. So I do just that, but still get the same 400 error code.
It also turns out that twurl adds an oauth parameter called “oauth_body_hash”, which I had never heard of before . So I read the doc, implemented it as you’d expect, and still get the same error.
(As per the documentation, my “oauth_signature” is generated taking only the other oauth_* parameters into consideration.)
I can’t figure out what exactly goes wrong since the error message only says “Bad authentication data.” Is the “oauth_body_hash” parameter mandatory when calling the APPEND command? My guess is that it is, and I’m calculating it wrong, which is totally plausible. Before I dive deeper into my implementation though, I’d like to know for sure that the “oauth_body_hash” parameter is required for such a request.
Or is there something else I’m missing?
Thanks a bunch for your time!