I need to write a workflow that reads the content of attachment of a list item, convert it to base64 encoded string and then invoke a custom REST service.
I know I can access
/_api/web/lists/getbytitle('MyList')/items(" + id + ")/AttachmentFiles and get the server relative URL of the attachment from result.
But I'm not sure how to get the contents of that file and convert it to base64 string.
I've found the following REST API that allows me to read the content of the attachment:
/_api/web/getfilebyserverrelativeurl('server relative URL of attachment from earlier call')/$value
Now the question remains that how to get this content in base64 format?