SOLVED: Token Invalidated on use of POST statuses/update

oauth
bug
bugreporting
account-activity

#1

Hey there,

We’re using a combination of the POST statuses/update endpoint and the Account Activity API to automatically respond to users when they interact with our account.

Everything ran smoothly up until this evening when we noticed that the API token we were using became invalidated all of a sudden. Our subscription to the Account Activity API was also removed. We revalidated and resubscribed to our webhook then a few tweets later it was invalidated again. We aren’t getting any rate limit or specific errors when trying to make a tweet via the API. However we do notice after making a tweet (or a couple) that we are unsubscribed from the Account Activity API and our token is invalidated.

We have sent roughly 2500 tweets today to this point. We were approved elevated POST statuses/update rate limits and we also worked with Twitter Staff to alert them of the use of automation with the account in question.

Is anyone else having similar issues here? Is there something we are doing wrong at all?


#2

Thanks for reaching out here.

Which app are you using to post the Tweets? Does your @handle show up when you pull your list list of subscribed users? Also are you seeing any errors around connection to the Account Activity API?

Thanks again!

Jessica


#3

Hey Jessica.

Does your @handle show up when you pull your list list of subscribed users?

That’s a good question, we’ve turned off tweeting from the account now so our tokens aren’t expiring and we aren’t being unsubscribed from the Account Activity API any more. So I assume it wasn’t showing up when we got unsubscribed and is now.

Also are you seeing any errors around connection to the Account Activity API

None at all except for the fact that we got unsubscribed when our access token was invalidated.


#4

We’ve managed to resolve this. It appears there was some issue with altering the rate limits of the Twitter account.

Note for anyone that encounters this type of issue in the future, it’s probably a rate limit error even if you aren’t getting rate limit errors back.

UPDATE: After doing a bit more digging we noticed that every time we created a tweet we were uploading a brand new image along with it. This caused us to hit the rate limit for the upload API. This appears to have been the cause.

UPDATE #2: Investigating unclear behaviour around the reuse of media_id in Tweet objects here…

UPDATE #3: In the case that you are uploading the same image multiple times. Store the media_id you get back from the Twitter API. (For expires_at seconds). This will save you needing to upload multiple times and hitting the rate limit like we did.


#5

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