3

I'm trying to use the Twitter v1.1 API endpoint:

POST : https://api.twitter.com/1.1/statuses/update.json?status=%2A

-or-

POST : https://api.twitter.com/1.1/statuses/update.json?status=*

After seeing some suggestions about URL Encoding (percent encoding) I'm trying to encode the asterisk (*) character using %2A

Other character encoding works, as expected. But the asterisk character results in the following error:

{ "errors": [{ "code": 32, "message": "Could not authenticate you." }]}

You can reproduce the error using the API Console Tool:

https://dev.twitter.com/rest/tools/console2

For Authentication I chose the Oauth 1 option.

Ian Tunbridge
  • 172
  • 2
  • 14
  • I found that there is indeed an issue with Twitter's API with regards to the standard * character. As a work around, I'm using the unicode values for 'small asterisk' (0xFE61) – Ian Tunbridge Feb 04 '16 at 16:30

2 Answers2

1

It is possible to send a single * as a status update via the API - see https://twitter.com/edent/status/664713007268823040

I suspect that the library you're using isn't properly calculating the OAuth signature. It would help if you showed us the code you use and which library you're relying on.

Terence Eden
  • 14,034
  • 3
  • 48
  • 89
  • As I mentioned, you can see the error with Twitter's own API Console Tool. I have the same issue in my app. We are using a popular ruby gem : https://github.com/sferik/twitter to interface with the API. – Ian Tunbridge Nov 12 '15 at 15:36
  • Again, it would be helpful if you show your code. Or, raise a bug with that gem. – Terence Eden Nov 12 '15 at 18:17
  • This appears to be a bug in the Ruby Gem - https://github.com/sferik/twitter/issues/677 – Terence Eden Nov 12 '15 at 18:18
  • This still dismisses the fact that the issue exists in the common testing area that Twitter provides. I'm not sure how it works for you, but using the API Console Tool seems like one of the most direct ways to test and eliminate where the problem exists. What does your raw post data look like? – Ian Tunbridge Nov 12 '15 at 19:01
-1

Just replace the asterisk * with the wide-asterisk . It is perfectly working for me

String tweet_text="Tweet text with asterisk *"; tweet_text= tweet_text.replaceAll("[*]","*");

  • Depending on the font that’s used for displaying the resulting the tweet, these two characters look massively different. The font may not even contain the wide asterisk, which means that it might not be displayed at all, or replaced by a replacement character like a question mark or box. – scy Feb 15 '20 at 12:31