0

I'm trying to upload pdf file from Salesforce to Quickbooks attachments via Quickbooks API. It works fine with small files, but if file size exceeds 999 bytes, the following error appears:

An application error has occurred while processing your requestSystem Failure Error: Maximum line length limit exceeded

There is no such error, when I try do make such request from Postman.

HEADER:

httpReq.setMethod('POST');
httpReq.setEndPoint0'(https://sandbox-quickbooks.api.intuit.com/v3/company/<Realm_ID>/upload?minorversion=38');
httpReq.setHeader('charset','UTF-8');
httpReq.setHeader('Authorization' , 'Bearer ' + accessToken);
String boundary = 'MYBOUNDARY';
httpReq.setHeader('Content-Type' , 'multipart/form-data; boundary=' + boundary);

BODY:

--MYBOUNDARY
Content-Disposition: form-data; name="file_content_01"; filename="test first 11/07/2019 .pdf"
Content-Type: application/pdf
<my base-64 encoded file>
--MYBOUNDARY--

This code is run from Apex @future method. Are there some limits on Salesforce-Quickbooks connection or limits on callout length from @future maybe?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.