Skip to main content
Question

Can't upload file from Apex

  • May 23, 2025
  • 2 replies
  • 23 views

Forum|alt.badge.img

Hello. I'm developing integration between box.com and Salesforce. I need to send request from apex class to upload a files from custom component. I have created custom app in developer console and named credential in Saleforce for connect to it and get access token via Auth2.0. I can search folders right now, and preflight check for upload sends its ok, but I can't upload file. Scope is root_readwrite. I can upload file when I manually set access token from postman collection created from docs. I use BoxApiConnection apex class for it. But I want named credential do all the staff. Can you help? I'm receiving Script-thrown exception in apex when I send request to https://upload.box.com/api/2.0/ via named credential

2 replies

Forum|alt.badge.img

Can you provide more information on the error you are getting? 

This may be caused by the file size limits salesforce puts in place for apex.


Forum|alt.badge.img

Hi Team,

Most of the users are getting this below error message, could you please suggest on this issue.?

dbe01HSZCZFX69PR2R8RMSC8N8KQQ.png

Best Regards

Manjunath GK