Error on posting a zpl file for SendFileToPrint API

R Raja Karuppasamy 2 years 11 months ago
7 1 0

I am trying to submit a simple 'Hello World' zpl command text file via SendFileToPrint API from my web application hosted in Salesforce cloud platform. I could successfully establish the connection and print from Postman but from Salesforce I couldn't print.
Salesforce has its own programming language called Apex. Apex doesn't directly support multipart/form-data but we write custom logic to frame form data body and we POST the form data as a blob. When I try to post the same txt file which worked in PostMan as a blob, it gives me back the below error
{"fault":{"faultstring":"Execution of JS-ExtractPrinterList failed with error: Javascript runtime error: \"TypeError: Cannot read property \"1\" from null. (JS-ExtractPrinterList.js:7)\"","detail":{"errorcode":"steps.javascript.ScriptExecutionFailed"}}}
Headers:
----------
apikey
tenant
Form data body parameters:
--------------------------------------
sn
zpl_file
Can anyone help on this? I can share the code that submits the request if needed.
I would like to know if this problem is because Zebra API doesn't accept blob? And is there any way to talk to Zebra technical team about this? Thank you for your help!

Please register or login to post a reply

1 Replies

R Raja Karuppasamy

***** UPDATE *****
I have solved the use case using latest Zebra feature 'SendFileToPrinter'. This technology uses simple REST API call and works for all operating systems

CONTACT
Can’t find what you’re looking for?