Direct Message with Media #448
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#448
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?
Twitter now supports leaving a direct message with a media id
See
https://dev.twitter.com/rest/reference/post/direct_messages/events/new
and
https://dev.twitter.com/rest/direct-messages/attaching-media
Using the api.post function doesn't seem to correctly handle a python dictionary that should be converted to a json object and sent with the post message.
Can you offer an example of the correct way to use api.post? or recommend a different approach?
Looks like you can upload media or a video and then attach that media ID to the DM
If that doesn't work, let me know. Looks like there is a
jsonparameter that can be sent using requests that will automatically json encode this for you.Hi, I've been trying to get this to work and not managed to so far. I've taken the example above and added my keys, tokens etc and the recipient. Has anyone got this working recently?
Any help appreciated.
Thanks
Neale
I am trying the following
Unfortunately, I am getting back an error
I came across this today, and the code above is ok, but before you call api.post() you need to do
import json
params = json.dumps(params)
HTH