I am struggling to find a way how I could upload attachments to a ticket securely with my app.
I can't upload an attachment with ZAFClient.Request() because it does not support the header Content-Type to be set as "application/binary", and therefore corrupts the uploads.
So, my only option is to use for example the javascript function fetch to call Zendesk api where I can set the required headers. But because this is not the ZAF client, I need to add a header for authorization.
There is no function to get an authorization header from the ZAFClient, and using Secure settings will not work because the code block where I need to set the authorization header is not in a ZAFClient.Request().
My only option is to set the authorization header as plain text in the code itself. This is extremely bad and makes me nervous. Is there something obvious that I am missing, or is this really the only way to make this work?
Here is my current working (but insecure) way of doing this: