The idea of the task is to create a incident in ticketing platform and attach a screenshot to the ticket created using a chat-bot. For the attachment to be done for the ticket created , i am using a upload attachment API which accepts the image in byte array type only.
API Body :
{"_ProxyDetails":{"Password":"test@123","ProxyID":0,"ReturnType":"JSON","UserName":"user@itsm.com","OrgID":1,"TokenID":""},"eModule":"IM","TicketID":14487, "FileByte":"", "AttachmentFileName":"testtextfile.txt"}
Where FileByte
needs to be a byte array. I need the image to be converted to byte array using built in JavaScript library only. Can anyone help me to convert this image to bytearray
type?