Important: Direct Message IDs will become 64-bit Snowflake IDs on Sep 30

Friday, 23 September 2011

Hi Developers,

Direct Message IDs will become Snowflake-based 64-bit integers on Friday, September 30th.

Back in March of 2010, we announced that tweets would soon become 64-bit “Snowflake” IDs. That eventually happened, and now you’ve all grown accustomed to these monstrously large identifiers for tweets. Due to the inability for many Javascript-compliant languages to actually consume these numbers this big, we introduced “id_str” fields in most API responses, and began encouraging developers to favor string-based identifiers instead of integer-based identifiers whenever encountered.

Today, I am writing to inform you that we’ll begin using Snowflake for direct message IDs beginning one week from today, on September 30, 2011. This transition cannot be delayed or waylaid and we apologize in advance for any inconvenience this may put on applications not already utilizing the string-based identifier representations or relying on 32-bit integers.

Just as with tweet IDs, we recommend all developers to begin utilizing the “id_str” property of direct messages if you are not already. If you’re using the “id” field with JSON in a Javascript-related language, there is a very high likelihood that the integers will be silently munged by Javascript interpreters. In most cases, this will result in behavior such as being unable to load or delete a specific direct message, because the ID you’re sending to the API is different than the actual identifier associated with the message. See Twitter IDs, JSON and Snowflake for more information on this topic.

If you’re already storing & utilizing the “id_str” value as a string, there shouldn’t be any action required on your part. It is still most advisable to sort by an object’s created_at date rather than relying on the identifiers as having any kind of meaning — however, Snowflake IDs are generated in such a way that you should have little to no issues sorting by ID.

If you have any questions or concerns, please follow up on the discussion forums.

Thank you for your attention to this very important announcement.

The @twitterapi Team