Why I am getting You may not delete another user's status while deleting tweet

restapi
ads

#1

I am using endpoint “https://api.twitter.com/1.1/statuses/destroy/{id}.json” but getting
{u’errors’: [{u’message’: u"You may not delete another user’s status.", u’code’: 183}]}

Its working for one of my account but for other account its not working.

Is there any issue at Twitter end?


#2

Hi,

Please see:

https://dev.twitter.com/rest/reference/post/statuses/destroy/id

The authenticating user must be the author of the specified status.

Your code likely is not switching between multiple user tokens to perform these requests.


#3

Our code has exact same token that was used for creating this tweet, the issue is somewhere else.


#4

I haven’t heard of a scenario other than “using the wrong token, maybe sometimes unintentionally” as the root cause for getting this error message.

My recommendation would be to use twurl to try to repro the issue and check which user is being authorized when it does and does not work. You may also narrow down the scenario for us by checking if it really is only a single tweet or if you are able to delete some other tweets.


#5

Hi,
We used both Twitter console
https://dev.twitter.com/rest/tools/console and twurl.

using our app account “app_consumer_key” and “app_consumer_secret” and oauth_token and oauth_secret of the ads account we are able to create a tweet for the ad account, but are not able to delete the same.

twurl -X POST /1.1/statuses/destroy/.json
{“errors”:[{“code”:183,“message”:“You may not delete another user’s status.”}]}

Post authorizing our app.


#6

Hi,
Please let me know for the above


#7

You’ll need to use the token for the account that owns the Tweet itself, I believe.


#8

@ampushdev: Could you please provide the full request you’re using to create the Tweet as well as the account and user IDs you’re creating the Tweet for? We may ask that you share the response headers, too.


#9

@sanjeevchadha84: Please share the full request you’re using to create the Tweet as well as the account and user IDs the Tweet belongs to. Like, above, we may ask for the response headers.


#10

@ampushdev and @sanjeevchadha84: Wanted to follow up here. What we’re looking for is a request, such as the following, so that we can understand what’s happening.

Creating a Promoted-only Tweet

 $ twurl -X POST -H ads-api.twitter.com "/1/accounts/18ce54d4x5t/tweet?status=hello&as_user_id=756201191646691328"
{
  "data_type": "status",
  "data": {
    "created_at": "Thu Dec 15 20:18:53 +0000 2016",
    "id": 809492949390139400,
    "id_str": "809492949390139392",
    "text": "hello",
    "truncated": false,
    "entities": {
      "hashtags": [],
      "symbols": [],
      "user_mentions": [],
      "urls": []
    },
    "source": "<a href=\"https://ads-api.twitter.com\" rel=\"nofollow\">Ads API Internal Test App</a>",
    "in_reply_to_status_id": null,
    "in_reply_to_status_id_str": null,
    "in_reply_to_user_id": null,
    "in_reply_to_user_id_str": null,
    "in_reply_to_screen_name": null,
    "user": {
      "id": 756201191646691300,
      "id_str": "756201191646691328",
      "name": "API McTestface",
      "screen_name": "apimctestface",
      "location": "San Francisco, CA",
      "url": null,
      "description": "Into testing and APIs",
      "protected": false,
      "followers_count": 0,
      "friends_count": 0,
      "listed_count": 0,
      "created_at": "Thu Jul 21 18:56:28 +0000 2016",
      "favourites_count": 0,
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": false,
      "verified": false,
      "statuses_count": 2,
      "lang": "en",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "profile_background_color": "000000",
      "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
      "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
      "profile_background_tile": false,
      "profile_image_url": "http://pbs.twimg.com/profile_images/756348317458509825/DTKcRCpS_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/756348317458509825/DTKcRCpS_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/756201191646691328/1469162431",
      "profile_link_color": "000000",
      "profile_sidebar_border_color": "000000",
      "profile_sidebar_fill_color": "000000",
      "profile_text_color": "000000",
      "profile_use_background_image": false,
      "has_extended_profile": true,
      "default_profile": false,
      "default_profile_image": false,
      "following": false,
      "follow_request_sent": false,
      "notifications": false,
      "translator_type": "none"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "retweet_count": 0,
    "favorite_count": 0,
    "favorited": false,
    "retweeted": false,
    "scopes": {
      "followers": false
    },
    "lang": "en"
  },
  "request": {
    "params": {
      "status": "hello",
      "as_user_id": 756201191646691300,
      "account_id": "18ce54d4x5t"
    }
  }
}

And then trying to delete it.

$ twurl -X POST -H api.twitter.com "/1.1/statuses/destroy/809492949390139392.json" | jq
{
  "errors": [
    {
      "code": 183,
      "message": "You may not delete another user's status."
    }
  ]
}

While I’m able to create a Tweet for @apimctestface (account ID: 18ce54d4x5t; user ID: 756201191646691328), I’m not authenticated as that user.

In order to delete this user’s Tweet, I have to be authenticated as that user.

$ twurl set default apimctestface
$ twurl -X POST -H api.twitter.com "/1.1/statuses/destroy/809492949390139392.json" | jq
{
  "created_at": "Thu Dec 15 20:18:53 +0000 2016",
  "id": 809492949390139400,
  "id_str": "809492949390139392",
  "text": "hello",
  "truncated": false,
  "entities": {
    "hashtags": [],
    "symbols": [],
    "user_mentions": [],
    "urls": []
  },
  "source": "<a href=\"https://ads-api.twitter.com\" rel=\"nofollow\">Ads API Internal Test App</a>",
  "in_reply_to_status_id": null,
  "in_reply_to_status_id_str": null,
  "in_reply_to_user_id": null,
  "in_reply_to_user_id_str": null,
  "in_reply_to_screen_name": null,
  "user": {
    "id": 756201191646691300,
    "id_str": "756201191646691328",
    "name": "API McTestface",
    "screen_name": "apimctestface",
    "location": "San Francisco, CA",
    "description": "Into testing and APIs",
    "url": null,
    "entities": {
      "description": {
        "urls": []
      }
    },
    "protected": false,
    "followers_count": 0,
    "friends_count": 0,
    "listed_count": 0,
    "created_at": "Thu Jul 21 18:56:28 +0000 2016",
    "favourites_count": 0,
    "utc_offset": null,
    "time_zone": null,
    "geo_enabled": false,
    "verified": false,
    "statuses_count": 2,
    "lang": "en",
    "contributors_enabled": false,
    "is_translator": false,
    "is_translation_enabled": false,
    "profile_background_color": "000000",
    "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
    "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
    "profile_background_tile": false,
    "profile_image_url": "http://pbs.twimg.com/profile_images/756348317458509825/DTKcRCpS_normal.jpg",
    "profile_image_url_https": "https://pbs.twimg.com/profile_images/756348317458509825/DTKcRCpS_normal.jpg",
    "profile_banner_url": "https://pbs.twimg.com/profile_banners/756201191646691328/1469162431",
    "profile_link_color": "000000",
    "profile_sidebar_border_color": "000000",
    "profile_sidebar_fill_color": "000000",
    "profile_text_color": "000000",
    "profile_use_background_image": false,
    "has_extended_profile": true,
    "default_profile": false,
    "default_profile_image": false,
    "following": false,
    "follow_request_sent": false,
    "notifications": false,
    "translator_type": "none"
  },
  "geo": null,
  "coordinates": null,
  "place": null,
  "contributors": [
    2417045708
  ],
  "is_quote_status": false,
  "retweet_count": 0,
  "favorite_count": 0,
  "favorited": false,
  "retweeted": false,
  "scopes": {
    "followers": false
  },
  "lang": "en"
}

We first need to make sure that this—the authenticating user issue—isn’t what’s causing what you’re seeing. So please provide us some examples of this flow. Thanks!


#11

@ampushdev and @sanjeevchadha84: We’d like to make sure this issue has been resolved. If it hasn’t, please provide some examples of the flow shown above.