504 Server Error:

I have been trying to download record with the API, i encounter 504 Bad Gataway. The record is 40,800.

@sarman_traning1, you could download your data by filtering it by dates as outlined in this post discussed previously:

@sarman_traning1 the system now allows you to download your data by filtering it by date (from the UI), as explained in this support article: Advanced options for exporting data.