We use Forge Data Management API to access project documents. We execute next set of requests:
- project/v1/hubs to get hubs (hubId)
- project/v1/hubs/:hubId/projects to get projects (projectId and rootFolder)
- data/v1/projects/:projectId/folders/:folderId/search?filter[fileType]=rvt,nwc,nwd to get files filtered by extension
On search we often get Too Many Requests status code. We have about 20 files in the project. Sometimes this request is processed instantly, sometimes 8 seconds, sometimes 20 seconds.
Response body:
{"jsonapi":{"version":"1.0"},"errors":[{"id":"GUID","status":"429","detail":"Too Many Requests"}]}
On this page we can see that there is a limit 300 requests/minute. But we get Too Many Requests status after exceeding not more that 10 requests/minute.
Also here we see that response must contain Retry-after header. But the is no such header.
So i have next questions:
- What is the best practice to search project files by the file extension?
- Why we get Too Many Requests even if we don't exceed the limit?
- What should we do for not getting Too Many Requests status?
- Why the is no Retry-after header in the Too Many Requests response?