I am currently developing a use case for a web application, where the architecture is defined in such a way that the frontend code picks up the attachment from the user's machine, is turned into the base64 format and sent to the backend code where the /api/now/attachment/file will be used to insert the attachment to a newly created incident.
Now, I have a few questions over here:
What data format does the /api/now/attachment/file accept? Is it binary? If so, how to convert a file into the required binary in Angular?
Is it possible to attach the document by converting it to base64 format and calling the /api/now/attachment/file API? If so, how?
I am looking for implementation in TypeScript in the backend code similar to the post- https://www.servicenow.com/community/developer-articles/attachment-api-rest-call-using-java/ta-p/2329743
Please note that I can not use the scripted rest API examples that use inbound tables that are suggested in the different developer forums and the internet. I have gone through the product documentation pages of /api/now/attachment/file. And lastly, I am not using any scripted API so no question about using the setRequestBodyFromAttachment function of RESTMessageV2.
I have also visited the following article which was quite similar to my query. https://www.servicenow.com/community/developer-forum/what-s-raw-data-in-rest-attachment-api/m-p/1599915#M256841
Any help would be very much appreciated.