Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Creating a new email case using Basic Auth from Google Apps Script.
var url = "";
var options = {
"method": "post",
"headers": {
"Authorization": "Basic " + Utilities.base64Encode("")
"payload": {
"type": "email",
"subject": "Email Case Subject",
"priority": 4,
"status": "open",
"labels": [
"message": {
"direction": "in",
"body": "Example body",
"to": "",
"from": "",
"subject": "My email subject"
"_links": {
"customer": {
"class": "customer",
"href": "/api/v2/customers/1"
var response = UrlFetchApp.fetch(url, options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.