I add and edit entities via API using OAuth, i.s. doing POST/PUT requests.
But the API does not return the “x-daily-requests-left” header in the response.
I tried it on entities “deal”, “activity”, “person”, “organization”.
Example the request:
curl --location --request POST 'https://api.pipedrive.com/v1/activities' \
--header 'Authorization: Bearer 7550228:11547632:ce78bab28bc3b85c0c6b6baacdfe034e0f747590' \
--header 'Content-Type: application/json' \
--header 'Cookie: __cfduid=d7391f8e31df56ca66429e28bb2bd6f5d1604326689; pipedrive-cdl=eu-central-1' \
Example the response headers:
Date: Wed, 04 Nov 2020 10:19:13 GMT
badi: Routing: eu-central-1=>eu-central-1; Version: a0fa; Host: bari;
Access-Control-Expose-Headers: X-RateLimit-Remaining, X-RateLimit-Limit, X-RateLimit-Reset
set-cookie: pipedrive-cdl=eu-central-1;path=/;expires=Thu, 05 Nov 2020 10:19:13 GMT;secure
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000; includeSubDomains
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
What am I doing wrong?
@mykhailo Please, help me.
x-daily-requests-left header is sent only if the request was made with API token (not OAuth). I am not aware of future plans to change that, but if it happens, most likely it will be reflected in the Changelog.
Is there a way to find out what the limit is left? When using OAuth.
Or just getting HTTP 429 error?
It’s hard for me to advise, as I do not know your use case. 429 can be returned also when you make more requests per second than your plan allows (https://pipedrive.readme.io/docs/core-api-concepts-rate-limiting).
But If you want to stop sending requests when any of the limits we have is reached, then 429 should work.
My case is this: I make requests through OAuth.
The documentation says that 10,000 POST/PUT requests are available per day. If I go over the limit of 10,000 requests, is there any way to find out about this other than getting HTTP 429 error. For example, in the header response or endpoint API?
If I get HTTP 429 error, is it possible to differ that the error is:
- more requests per second than my plan allows
- more POST/PUT requests per day than 10000
@a.skibardin to my knowledge in both cases, the error will be the same, 429. But if you make to many requests in 2s window (number of requests is be based on your plan) then
x-ratelimit-remaining header will be 0, meaning you can use that to check if it was to rate limit error related to your plan or number of POST/PUT requests (that could work only if you don’t make POST/PUT requests more often than your plan allows).
Hope it helps. Also, if you building an app that might make more than 10k requests per day per user per company maybe there is another way to achieve the result you need.