I’ve been commissioned to overhaul and modernize Gwibber (among other things, I am updating it from API 1 to 1.1). I’m mostly done, however sending new direct messages just utterly refuses to work. I can send public tweets, and I can send replies, and I can receive direct messages, but I cannot send them.
I’ve scoured the API docs, and I’ve found various different potential meanings for a 403 error. One page suggested that 403s would be given in response to duplicate requests – well i’ve tried many different direct messages that could not be considered duplicates. Another page suggested that I don’t have DM permissions – well I can access direct_messages.json and direct_messages/sent.json, so I seem to have that permission.
I really don’t understand why this isn’t working, and I’d appreciate it if somebody could look into it for me. The code is here:
Note that all other methods defined in that class demonstrably work, and I have tested them on my live twitter account with success. It is only direct_messages/new that is giving me 403s and I have no idea why. What have I done wrong here?