Recently my app has been running into “Status: 429 Too Many Requests” errors when hitting the
https://ads-api.twitter.com/1/stats endpoint. I think this is because of an error on our end when generating new advertiser oauth tokens. I would like to confirm this is the case and how to address this problem.
Currently, for every client we onboard, we do the following:
- Ask the client to add us as admins via their Twitter UI.
- We sign in to Twitter as @pulsepointcmp via our platform as described here, thus generating and saving new set of oauth tokens for that client.
- Every subsequent request for this client (creating campaigns, pulling numbers, etc.) is made with those tokens + the as_user_id param where appropriate (creating PromotedOnlyTweets, etc.).
The documentation states that
"Using an Advertiser OAuth Token, rate limits are distinct per Advertiser and you can create Tweets on behalf of a User." This leads me to believe that each client should have its own
x-rate-limit-remaining counter. However, I see that I only get 1 global counter that is always decremented, even when making requests with different clients/tokens.
Here are my questions:
- Is the reason we’re seeing these global counters instead of one counter per client that we’re signing in as @pulsepointcmp every time instead of asking the client to sign in themselves with their credentials?
- If so, would the solution for spreading out my current number of requests be as simple as asking them to sign in to Twitter via our app themselves, thus replacing the current token (which I suppose is tied to our account)?
- Are there any pitfalls with regards to this switch? Will we be able to CRUD the current objects we’ve created using our tokens?
- We would still like to have the ability to see the campaigns created in our clients’ Twitter Ads UI. Will we still need to have them give us admin rights to their account to do this?