m-Files Rest Api Rate Limiting

Hello,

I'm having trouble communicating with M-Files DMS via REST APIs.

I generate a token from `/REST/server/authenticationtokens` using my login credentials and afterwards, I am able to communicate with the server using the generated token. But response from the server fails randomly. 

For example, this is the result of 10 consecutive requests with different intervals: (on /REST/server/status endpoint)

Run Number Results (0.5s interval) Results (1s interval) Results (10s interval)
#1 Forbidden Forbidden Success
#2 Forbidden Success Success
#3 Forbidden Success Success
#4 Success Forbidden Forbidden
#5 Success Forbidden Success
#6 Success Success Forbidden
#7 Success Success Success
#8 Forbidden Forbidden Forbidden
#9 Forbidden Forbidden Success
#10 Forbidden Success Success

The results show inconsistency in error response. This causes errors when integrating M-Files into our solution (because sometimes I get 3+ consecutive error responses), and if it is caused by rate limiting, this will heavily reduce the number of operations can be done by the users.
I would appreciate it if you could look into it.
Thanks,
M. M. Hejazi
Parents Reply
  • Hello Craig,

    Thank you very much for your response.

    I was able to track down the problem. Since I was in a development environment, the `document` JavaScript variable was not persistent, thus couldn't set and save cookies for upcoming requests even though `credentials: "include"` was set.

    Solved it by defining a persistent `document` variable to share the cookies. 

    Have a great weekend!

    M. M. Hejazi

Children
No Data