urlfetchapp

How do you create and then insert an image file from Google Drive into a Google Apps Script UrlFetchApp.fetch call to an External API?

青春壹個敷衍的年華 提交于 2020-03-03 03:01:28
问题 I am using Google Apps Script to call an external API to post both text and an image to a contact in an external system. I have posted the text fine, many times, no problems. I have not worked with sending or even using images in Apps Script before, so I am unsure of how to send the image as a file. I've done quite a bit of research on Stack Overflow and elsewhere, but have not found the answer to this yet. The API documentation for the external system says that it needs the following: