My app authenticates via PIN. A user can compose tweets. Sometimes we get this error

{"code":89,"message":"Invalid or expired token."}

This is very rare. The app is still very much in development, so it’s being reinstalled a lot, and we do store the tokens locally, so something on our end could be “breaking” the tokens.

But I’m wondering if there is a method for testing the tokens before composing a tweet. Is there an API call maybe?

Thanks!

2 Likes

Sure! I would use https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials

Or make a call to https://developer.twitter.com/en/docs/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status (but remember that posting statuses does not have a defined rate limit, it is adaptive and limited to 300 in 3 hours per-user and per app)

1 Like

Thank you for those links!

What you are saying is that one specific user can send 300 tweets in three hours from our app, correct?

1 Like

Yes, a specific user can only send 300 tweets in 3 hours using an app. Also your entire app can only send 300 tweets in 3 hours across all your users: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update, unless you get permission: New POST endpoint rate limit enforcement begins today in that case many of your users will be able to send their individual limit of 300 tweets in 3 hours. There is no way to increase the limit for an individual account.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.