Media Upload returning different media_id and media_id_string today


#1

Noticed my implementation broke today and looking more closely I noticed that media_id and media_id_string are different.

{ image: { w: 500, h: 500, image_type: 'image/jpeg' }, media_id: 596476242246946800, media_id_string: '596476242246946817', size: 68421 }

Checked the docs and they should be the same:

{ "media_id": 553656900508606464, "media_id_string": "553656900508606464", "size": 998865, "image": { "w": 2234, "h": 1873, "image_type": "image/jpeg" } }
Tested and media_id_string is the correct value.

Linked from "The validation of media ids failed." Error Code 324


"The validation of media ids failed." Error Code 324
#2

Thanks for reporting this. Let me dig in here.


#3

Hi Jason!

Team got back to me. They pointed me to this post:

https://dev.twitter.com/overview/api/twitter-ids-json-and-snowflake

Basically, we have the *_id_string/str version for platforms like javascript that don’t like large integers.

Does that help?


#4

Hey Ryan,

Thanks for digging into this. That’s interesting how you generate those IDs, I’m curious to learn more about that. Makes a lot of sense as to why I was getting what seemed to be random results, and why it did work at one point.

It might be helpful to include a note about the differences of those fields on the docs https://dev.twitter.com/rest/reference/post/media/upload, and how some platforms can generate unexpected results. On the thread linked in my first comment, there’s confusion about how 324 codes are generated, which only added to the troubleshooting difficulty.

Thanks!

Jason


#5

Thanks for the feedback. I think we can do a better job of surfacing the snowflake thing; it’s not particular to the media/upload endpoints.

Duly noted. Let me think about it, and glad it’s working now!


#6