New REST API endpoints for Mute functionality

andypiper
@andypiper Andy Piper

Hi Developers,

We’re happy to announce that several new API endpoints are available to you, working with the new Mute feature.

The Mute API endpoints are somewhat analogous to the /blocks/ methods already available, but have quite different results. The function enables a particular user to be “muted” from the timelines of the authenticating user, rather than unfollowing or blocking them.

To mute or unmute a user you would use the POST mutes/users/create and POST mutes/users/destroy endpoints respectively. To find out whether an authenticated user is muting other users you can use the GET mutes/users/ids and GET mutes/users/list endpoints. In addition, GET friendships/show and GET friendships/lookup will also now include information about whether one user is muting another. Some new error responses specific to mute have been added to Error Codes & Responses.

The Twitter web and mobile clients are starting to support this new feature, and we are excited to share these new API endpoints with the developer community for use in your own apps and tools.

We're rolling this change out to users this week, so please try the endpoint within a few days if you do not initially have access. User-facing support information can be found on the Help Center https://support.twitter.com/articles/20171399

9 weeks 2 days ago

Replies

tapbot_paul
@tapbot_paul Paul Haddad

What impact, if any, will mutes have on site/user streams?

9 weeks 2 days ago
andypiper
@andypiper Andy Piper

currently this is a REST API feature. I will check on the impact on streams and update if there are any changes.

9 weeks 1 day ago
richardhyland
@richardhyland Richard Hyland

Does an event fire in user or site streams when a mute is created or destroyed so that we can automatically add a mute without calling the REST API for updates?

9 weeks 12 hours ago
andypiper
@andypiper Andy Piper

not at present. We are looking at features around mutes and streams for a future revision.

9 weeks 8 hours ago
graysky
@graysky Mike Champion

Looks like those documentation pages are still private, I get Access Denied.

Will the tweets be filtered API-side or just decorated in the status itself?

9 weeks 2 days ago
andypiper
@andypiper Andy Piper

Hopefully the docs are showing up for you now?

the tweets are filtered out/muted within the timeline i.e. API side.

9 weeks 1 day ago
MadhuGowthaman
@MadhuGowthaman MadhuGowthaman

I get access denied for those documentation pages.

9 weeks 1 day ago
talkingfrog1950
@talkingfrog1950 Michael Templeman

Still locked out as well

9 weeks 1 day ago
andypiper
@andypiper Andy Piper

sorry! caching issue... should (!) be sorted now.

9 weeks 1 day ago
IronyLLC
@IronyLLC Irony LLC

@andypiper still can't view the pages.

5 weeks 2 days ago
andypiper
@andypiper Andy Piper

are you able to read them if you are logged out of dev.twitter.com? are you seeing a permission issue? This is really odd... will ask the site team again.

5 weeks 1 day ago
talkingfrog1950
@talkingfrog1950 Michael Templeman

Will mute prevent receipt of retweets of muted users?

9 weeks 1 day ago
andypiper
@andypiper Andy Piper

mute will filter tweets from a user from your home and mentions timelines. It will not stop someone else retweeting them and having that show up in one of those timelines.

9 weeks 1 day ago
dekisu
@dekisu dx

"the tweets are filtered out/muted within the timeline i.e. API side. "

I'm not sure if i'm interpreting this correctly, does this mean we don't need to grab a list of muted users manually just like we do with blocked users to filter them client-side? (as mentioned in https://dev.twitter.com/docs/streaming-apis/streams/user ). So, for some reason streams can exclude muted users, but can't exclude blocked ones? I'm probably wrong, since the other announcement seems to suggest this is a client-side feature.

9 weeks 1 day ago
andypiper
@andypiper Andy Piper

this is not a streaming API feature at this stage, REST API only.

9 weeks 23 hours ago
dennisl
@dennisl Dennis Lembrée

Not getting the muting info from the friendships call.

9 weeks 1 day ago
andypiper
@andypiper Andy Piper

This is being rolled out through this week so you should start to see the info (which is just the one additional "muting" field) returned shortly.

9 weeks 1 day ago
dennisl
@dennisl Dennis Lembrée

Update? Still not receiving the 'muting' value in the relationship JSON response.

7 weeks 3 days ago
andypiper
@andypiper Andy Piper

Hi Dennis, very sorry for the delay. Can you confirm whether you are getting the right values in the response data now? we should be available to all at this point.

7 weeks 3 hours ago
artesea
@artesea Ryan Cullen

Finally getting them here, but wasn't when @dennisl commented before.

7 weeks 3 hours ago
andypiper
@andypiper Andy Piper

ok thanks for confirming, and apologies for the issue!

6 weeks 6 days ago
dennisl
@dennisl Dennis Lembrée

Yes, it's finally working now. Thank you!

6 weeks 3 days ago
artesea
@artesea Ryan Cullen

Having similar gaps in returned data.
I was able to successfully mute someone I was following but nothing was returned in either friendships/show or in the user object within statuses/user_timeline to allow me to highlight people to unmute them.
I did find muting in friendships/lookup but it seems unnecessary to make a third api call.

9 weeks 1 day ago
andypiper
@andypiper Andy Piper

You'll currently get the muting field in the User objects returned from the mutes API calls, and in friendships/show. I'll clarify with the team whether we should expect to see it in all instances of the User object like statuses/user_timeline.

9 weeks 1 day ago
artesea
@artesea Ryan Cullen

I'd expect a cached user object in statuses/user_timeline so it's not a huge problem if it wasn't there. Just not seeing it at all in friendships/show will wait a week before pushing the code live.

9 weeks 1 day ago
artesea
@artesea Ryan Cullen

I know it's not a week but still nothing in friendships/show apigee snapshot of someone who is currently muted
https://snap.apigee.com/1owJRjq

8 weeks 5 days ago
andypiper
@andypiper Andy Piper

I understand that this isn't completely useful as a response, as obviously I do have mute available to my account at the moment... but here's what I see:

  1. twurl "/1.1/friendships/show.json?source_screen_name=artesea&target_screen_name=KirstieMAllsopp"

Response:

  1. {
  2.   "relationship": {
  3.     "source": {
  4.       "id": 5717352,
  5.       "id_str": "5717352",
  6.       "screen_name": "artesea",
  7.       "following": true,
  8.       "followed_by": false,
  9.       "notifications_enabled": null,
  10.       "can_dm": false,
  11.       "blocking": null,
  12.       "muting": null,
  13.       "want_retweets": null,
  14.       "all_replies": null,
  15.       "marked_spam": null
  16.     },
  17.     "target": {
  18.       "id": 33018114,
  19.       "id_str": "33018114",
  20.       "screen_name": "KirstieMAllsopp",
  21.       "following": false,
  22.       "followed_by": true
  23.     }
  24.   }
  25. }

(obviously showing null instead of false/true here, because I'm not one of the users in the relationship). I also validated that it works for me with ids instead of screen_names.

We've done a small amount of work around the API this week so bear with us as we make it available to everyone, it may take a few days more.

8 weeks 5 days ago
andypiper
@andypiper Andy Piper

Edited the original post to add information on Error Codes & Responses and GET friendships/lookup.

8 weeks 2 days ago
isodera
@isodera NR

Hi! Why is the mute function not working the last couple of weeks? FYI I'm still seeing tweets from tweeps I've muted on my @connect page AFTER I've mute them/even after I've refreshed the page or log-out/re-logged in. HELP!! I don't want to block too many tweeps, as I understand Twitter discourages that.. Thanks for troubleshooting this problem for me! Cheers!

5 days 13 hours ago
isodera
@isodera NR

Hmm. Funny! Now it's working! ;-) Thanks! Whatever you or @twittersupport did! Cheers!

5 days 13 hours ago