Getting a 404 when trying to read a DM


#1

When querying the URL listed on the docs for reading a DM, I’m getting a 404, even though the ID of the message is a valid one, and the URL is exactly like the one listed on the documentation.

What could I be missing?

Here is an example URL: GET https://api.twitter.com/1.1/direct_messages/show.json?id=315868386716430340
And here is the json response I get:
{“errors”:[{“message”:“Sorry, that page does not exist”,“code”:34}]}

Thanks


#2

Are you sure that that is the valid ID? Are you retrieving it from an “id” field or from an “id_str” field? DM ids are 64-bit integers and many programming languages will silently munge the value if you try to work with the integer variant.


#3

@episod Thanks! That seems to have done the trick!