I’ m working on a Twitter client with a bookmarking feature.

After some testing, I found that trying to bookmark a retweet would result in an unintended error.

POST /2/users/:id/bookmarks
request:

{ "tweet_id": "1511634804181463040" }

target tweet: https://twitter.com/TwitterJP/status/1511634804181463040

response:

{
  "title": "Service Unavailable",
  "detail": "Service Unavailable",
  "type": "about:blank",
  "status": 503
}

It would be nice to improve the error message and status or be able to bookmark the original tweet.

Thanks.

1 Like

Hi @takke,

I have been able to replicate this Tweet ID in particular 1511634804181463040, but I can bookmark other retweets.

I’m chatting with the team about this, and I’ll let you know when I hear more.

Best,

Jessica

1 Like

This is an odd one since the Tweet that is being bookmarked is a Retweet. I’m interested in hearing about how you got the Retweet ID and not the Tweet ID.

As an update, we just filled a ticket on the error handling since 503 isn’t the correct error code that you should get here.

2 Likes

Admittedly, trying to bookmark the ID of a retweet may be a bit unusual.

However, it has always been possible to like a retweet, which would have allowed the retweeter to know that they were liked.

I am building a Twitter client so retweets will always have the ID of the retweet and the ID of the original tweet. The following API is an example of how to get them.

GET /2/users/7080152/tweets
7080152 is user id of “TwitterJP”.

{
  "data": [
...
    {
      "id": "1512360290192883712",
      "text": "金曜日よ、多くの人が君を待っていたぞ"
    },
    {
      "id": "1511634804181463040",
      "referenced_tweets": [
        {
          "type": "retweeted",
          "id": "1511632041476911110"
        }
      ],
      "text": "RT @TwitterGovJP: #新成人 や大学生が安心安全に楽しくTwitterを活用するための「Twitterおとなの使い方マニュアル」を、#近畿大学 総合社会学部金井啓子ゼミと協働で作成しました。授業や就活などの情報収集、友人との交流などキャンパスライフにTwitte…"
    },
...

Example request using Twitter API Playground

Of course, I agree with making it impossible to bookmark retweet IDs, so I would suggest that this be clearly stated in the documentation and that the error code or message be changed.

Thank for following up. We are changing the error code regardless since it shouldn’t be a 503. As I mentioned, I was able to Bookmark Retweets that weren’t that particular tweet_id.

I did ask a few follow-up questions to the team to figure out if we want this to happen and what exactly is going on. I’ll let you know when I hear more and update the documentation if that is needed.

1 Like

I just checked again and 400 was returned.

{
  "title": "Bad Request",
  "detail": "You cannot bookmark a Tweet that does not exist.",
  "type": "about:blank",
  "status": 400
}

If this was the intended modification, this would have solved the problem.

1 Like