You need to sign in to do that
Don't have an account?
VINODKUMAR REDDY KALUVA
Sending PDF file from Salesforce to XERO, but it's not happening
I want to send PDF file from Salesforce to XERO
XERO syntax they told is like below
here is what I'm doing
If I'm I'm doing like below with filename mentioning in the URL, the PDF file is inserting but it is showing below error:
Somebody help me right way to pass PDF content body over here??
XERO syntax they told is like below
POST /api.xro/2.0/Receipts/e59a2c7f-4078-a0f3-73537afcbba9/Attachments/Image00394.png
here is what I'm doing
string pdfcon='asdasdasdasd'; Blob pdfBody = EncodingUtil.base64Decode(pdfcon); String endpoinurl='callout:Xero_Integration/api.xro/2.0/Invoices/32b8b9-4b5-45da-84ba-80e1bb47881/Attachments/'; HttpRequest req= new HttpRequest(); // set endpoint destination req.SetEndpoint(endpoinurl); req.setMethod('POST'); req.setHeader('xero-tenant-id','7bc01e1-d87-4a8b-9b96-2ffbc88f1cb8'); req.setHeader('Content-Type','application/pdf'); req.setBodyAsBlob(pdfBody); Http http = new Http(); // send the request HttpResponse response = http.send(req); System.debug(response.getBody());
If I'm I'm doing like below with filename mentioning in the URL, the PDF file is inserting but it is showing below error:
String endpoinurl='callout:Xero_Integration/api.xro/2.0/Invoices/322cb8b9-40b5-45da-84ba-80e1bb437881/Attachments/'+pdfBody+'.pdf';
Somebody help me right way to pass PDF content body over here??