getDataAsJsonString

This method verifies the type of AttachmentData and returns the data as a json string.