Naitik Dabhi
Naitik Dabhi

Reputation: 3

spring social Twitter update status not giving id_str

I am using spring social twitter for my project. I am trying to make tweet favorite, for that I need id_str = "your tweet id". But the problem is when I do update status using spring social it's return id = "" but not id_str. I seen that it's returning Tweet class. In that class there is no such field like id_str. So my question is how can I get id_str.

NOTE : id and id_str are note same. it's returning different values.

Upvotes: 0

Views: 123

Answers (2)

Sander Agricola
Sander Agricola

Reputation: 388

The id_str is available in the extraData map:

twitterProfile.getExtraData().get("id_str")

Upvotes: 0

Terence Eden
Terence Eden

Reputation: 14334

id and id_str should be the same. id_str is there because some platforms have difficulty handling very large integers.

You should use getId() and then cast the long into a string.

Upvotes: 0

Related Questions