Remove restrictions on the DM API for read and delete messages

api-access
directmessages
api

#1

We’ve built an app just for DMs but the Twitter API doesn’t allow us to build an app that is as good as it can be.

The API doesn’t allow us to mark messages as read in our app when they are read on the Twitter server. So, it means when a DM is read inside our app, it shows up as new inside a Twitter client. Is it possible to get access to this info?

The API doesn’t allow us to access the above information regarding “deleted” tweets either. We would like to delete tweets via the API when someone deletes from our app and visa versa.


#2

Unfortunately there’s no API for the DM “read receipt / notification” functions you describe - it’s unlikely to be available (Unread notifications are still a bit inconsistent across devices / apps by Twitter too - Not sure about your users, but it’s not that big of a problem - but that’s just my opinion).

For tweet deletions you can use https://dev.twitter.com/rest/reference/post/statuses/destroy/%3Aid & for DMs https://dev.twitter.com/rest/reference/post/direct_messages/destroy

To check for deleted tweets - you can use any endpoint that returns a tweet - either statuses/show or statuses/lookup - or if you have a user stream monitor for status deletion notices.

Site Streams sound like they could be useful https://dev.twitter.com/streaming/sitestreams but again - unfortunately it looks like no more applications for that.


#3

@IgorBrigadir Thanks for the fast response. Is there an API call to delete a “conversation”?

I think the inconsistence of unread notifications is actually very annoying for everyone I’ve spoken to. But if it’s a bug on Twitter I guess it’s a feature for everyone else :slight_smile: Is there a particular reason as to why it won’t be available via the API? Seems like a very basic feature. I mean, we’re talking about read/write messages.

Do you know if we could squeeze in an application for Site Streams? I’ll make sure you’re the first to get a Chirp t-shit as I was amongst the first to get Twitter shirts from @jack during the early days.


#4

No problem, I’m just here in the forums, so i’ve no bearing on anything to do with changes to the API or anything like that!

As far as I know you’re limited to just the endpoints listed in https://dev.twitter.com/rest/public for direct messages. All the other functionality you see in web interface or in twitter’s own apps isn’t part of the API. Would be cool if it was though!


#5

No, (unfortunately) Twitter is not giving anyone access to the Site Streaming API these days.


#6

Right, as the others have said, these are not “restrictions” as such (although I’m aware this is kind of hair splitting) - these features just haven’t made it into an API.

Never say never - the same applies to group DM features - but they have not yet made it to the priority list, and I can’t comment on when that is likely to happen given other work that is underway.


#7

@andypiper I get why you say they’re not restrictions. They’re not really. But, given that there isn’t much you’d want to do with a DM aside from read, write and send, it’s hardly that useful if we can remove a conversation via the API, or tell when a message has been read, or tell the server that a message has been read in our app.

I just don’t understand why there is even an API if these basic things aren’t available. Any chance you can get the team together and discuss opening this up for us? Wouldn’t take much and although it might sound like a big thing for a single developer, it’s how your company was born and the reason Jack and I met at your first office during the early days :slight_smile:
Make it happen :slight_smile:


#8

I remember the days of the lists and retweet apis being announced weeks in advance allowing apps to support them before they even launched


#9

Fair points - we’ve certainly done that (pre-announcement) with some of the more recent changes, but not all of them. It’s a gap it would be good to reduce as we move forward.


#10

Direct messaging a huge value offering for Twitter. I agree with the calls here to open up the DM API, or at least, show how to get whitelisted for access as written about in the documentation. Private messages are where professionals and everyday people share important messages - incredible potential for the Twitter DM team to build upon.


#11

I was really hoping that there would be an endpoint for leaving a conversation. Imagine being able to quickly remove multiple conversations at once and clean up those pesky DM’s.