Skip to main content
Question

Box for Salesforce - Gateway Time-out and Unauthorized Error

  • May 22, 2025
  • 4 replies
  • 19 views

Forum|alt.badge.img

When I try to upload 10000 files to box from salesforce by using Toolkit and apex,

After process finished, I got 9998 files are successfully uploaded but two files got following errors.

All files are same size with 1KB. Why these only two files got error?

Status=Unauthorized, StatusCode=401

and

Status=Gateway Time-out, StatusCode=504

Thanks.

4 replies

Forum|alt.badge.img

Hey Lin, 

Do you happen to have the request ids from the errors? This could be a few things... one being our servers being overloaded too quickly, rate limits being hit or in the case of the unauthorized upload - inadequate permissions.

Thanks, 

Alex, Box Developer Advocate


Forum|alt.badge.img

Thanks Alex,

If so, is there best or perfect implementation to cover "overloaded too quickly" and "rate limits being hit", could you please share?

What do you mean request ids for?


Forum|alt.badge.img

This article talks about our rate limits. In general, you should write code that speaks to Box within those rate limit guidelines - meaning if you have 500 files to upload for a user - you should write code that can only send 240 per minute based on the specs in that article. 

Hope this helps!


Forum|alt.badge.img

Thanks,

As a result of my verification, it takes 6 minutes for 100 files, so I think the limit is okay.