I have problem to submit message with 140 characters if the message contains a link.
My code abridges tweet to 140 characters, because it is limit defined by Twitter.
But sometimes Twitter cannot consume tweet with 140 characters and throws error message
{“errors”:[{“code”:190,“message”:“Status creation failed: The text of your tweet is too long.”}]}
StatusCode=403
Let’s look at examples.
The following message with 140 characters is consumed
TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMess
StatusCode=200
but the following messages isn’t consumed
TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessag http://bit.ly/14a49oC
Response = {“errors”:[{“code”:190,“message”:“Status creation failed: The text of your tweet is too long.”}]}
StatusCode=403
As you can see both message have 140 characters.
Second message has url that might cause the issue, but I’ve sent the same message with 139 characters and it was consumed properly
TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessage TestMessa http://bit.ly/14a49oC
StatusCode=200
I can correct our code to send tweet with 139 characters if it contains url, but it looks like a trick.
Could anyone tell me if it is a bug in Twitter functionality and what should I do in this case?
Thanks in advance!
Roman