Error from Purecloud Java SDK while retrieving user status

Hi,

 We are trying to retrieve the user status details using the query "/api/v2/analytics/users/details/query". 

our job runs at 5 am everyday and pulls previous 3 days of data using interval parameter of this query.
Actually there are three separate queries each with a 24hr interval parameter running in sequence.

We have been observing that for some days there is no data returned when the job runs, however when we run the scripts manually at a later time in the day, we would then get the data.
We have analysed our logs and found the below mentioned exception in our logs which is thrown by the purecloud API. Can you please let us know what does this error mean ? Are there any restrictions on the number of API calls per minute or on number of simultaneous API requests ?

ERROR 2017-04-27 05:01:51,717 [http-bio-8080-exec-613] com.telstra.belong.purecloud.PureCloudHandler - Error retrieving the User details : , env=, u_id=, agent=
com.mypurecloud.sdk.ApiException: {"status":504,"code":"gateway.timeout","message":"The request timed out.","details":[],"errors":[]}
at com.mypurecloud.sdk.ApiClient.invokeAPIVerbose(ApiClient.java:650)
at com.mypurecloud.sdk.api.UsersApi.getUsersWithHttpInfo(UsersApi.java:1316)
at com.mypurecloud.sdk.api.UsersApi.getUsers(UsersApi.java:1271)
at com.telstra.belong.purecloud.PureCloudHandler.getUsers(PureCloudHandler.java:76)
at com.telstra.belong.purecloud.PureCloudHandler.getUserStatusDetail(PureCloudHandler.java:197)
at com.telstra.belong.purecloud.PureCloudService.getUserStatusDetail(PureCloudService.java:59)
at com.teve.controller.api.purecloud.PurecloudActionController.getUserStatusDetail(PurecloudActionController.java:109)
at sun.reflect.GeneratedMethodAccessor2963.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

Thanks,
Anil

Service outages (5xx errors) need to be investigated through PureCloud Support. Please open a ticket with them and include correlation IDs for any requests with 5xx response codes.

Are there any restrictions on the number of API calls per minute or on number of simultaneous API requests

Yes, but that's API Rate Limiting and will yield 429 responses.