Hi Atlassian Team,
I have a question about the 'X-RateLimit-Limit','X-RateLimit-Resource' and 'X-RateLimit-NearLimit' for response header.
I can't get the Rate limit response headers when I reqeust any rest api, I want to know how can I get it when I request rest api?
Hi @yuan ming
May I know if you're using access token for authentication? Only access token authentication supports the 'X-RateLimit-Limit','X-RateLimit-Resource' and 'X-RateLimit-NearLimit' response headers.
I'd also like to know which endpoint you're querying, as not all endpoints support these headers.
Cheers!
- Ben (Bitbucket Cloud Support)
Hi Ben,
I use the Oauth cusotmer to reqeust 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}' this restapi, if not, can you tell me which restapi support these response headers?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @yuan ming
OAuth Consumer will not work either, you need to use either Repository, Workspace or Project Access Tokens for this header to appear:
The /2.0/repositories endpoint you've specified does support that header, so should be visible when you use it (provided you're using RAT/WAT/PAT for authentication)
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @yuan ming
Unfortunately, this will not work. Only repository/project/workspace access tokens return this header.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The rate limit response headers you mentioned (X-RateLimit-Limit, X-RateLimit-Resource, X-RateLimit-NearLimit) are not necessarily returned on every single API response!
They typically start appearing when your usage is approaching the rate limit threshold. If your request volume is low, you may not see them at all in the response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I continued to request APIs and log request headers until I encountered an error of 429 too many requests, but I did not find these few request headers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.