Rate limit exceeded when polling state of uploaded/processed video



We have integrated with the video upload API for Twitter Ads and it has been working fine for some time. Today, we started experiencing problems with the ‘Rate limit exceeded’ error.

After uploading a video file using the asynchronous chunked method we poll the API endpoint for the processing status. As a response, we get:

response = {“media_id”:1006514696474824707,“media_id_string”:“1006514696474824707”,“media_key”:“13_1006514696474824707”,“processing_info”:{“state”:“in_progress”,“check_after_secs”:1,“progress_percent”:5}}

The response includes the timeout after which the poll request should be resent (1 second), which we do.

This ping-pong lasts several minutes after which the error is returned:

response = {“errors”:[{“message”:“Rate limit exceeded”,“code”:88}]}

The video we are trying to upload is around 3 minutes long and the processing takes much longer than that (this shouldn’t be the case in the first place). Then, when we try to poll the endpoint with a timeout specified by Twitter, Twitter returns an error message.

Is our flow wrong? Should this be handled differently? Should we ignore the ‘check_after_secs’ field and implement our own backoff strategy to decrese the number of calls?