send_direct_message returning 404 page not exist #535
Labels
No labels
Bug
Enhancement
Feature Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: code/twython#535
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm trying to send DM with this it's returning 404 sorry page not exist.
here's what I tried
api.send_direct_message(type='message_create', recipient_id="id", message_data="test message"))This may help.
The 404 response is due to the erroneous endpoint definition. In the
EndpointsMixin.send_direct_messagethe URL is defined asdirect_messages/newit should bedirect_messages/events/new. Unfortunately, this is not enough. The example given in the SO answer linked above is not working because of the_transparent_paramshelper function. We can't pass the whole event dict to thepostmethod:because
_transparent_paramscan't handle dictionaties with embedded dictionaries and our params getting truncated to{}The above comment is valid for 3.7.0 version. I see that in the newest version this should work correctly.