function postComplex() { // to show that stringifying real dates does work as well var date = new Date(); var events = { name: "Olli", events: [ { title: "Strategy Meeting", startTime: "Fri Feb 01 10:00:00 CET 2013", endTime: "Fri Feb 01 11:30:00 CET 2013", description: "Discussion of the floreysoft strategy", location: "Telemannstraße 22, 20255 Hamburg" }, { title: "Dinner", startTime: "Fri Feb 01 20:00:00 CET 2013", endTime: date, description: "Dinner with Le Chef", location: "Gaußstraße 3, 22765 Hamburg" } ] }; var options = { contentType: "application/json", method : "post", payload : Utilities.jsonStringify(events) }; var response = UrlFetchApp.fetch('http://www.ultradox.com/ultradoc/execute?id=kNjCQaAALBCCtRH7gSJvasHF5fqJIW&action=DOWNLOAD&locale=DE',options) var blob = response.getBlob(); var code = response.getResponseCode(); Logger.log(code === 200 ? "Success" : "Error Code: " + code); // sending out email just for demo purposes // in real applications send out personalized emails using Ultradox instead GmailApp.sendEmail("[your email goes here to send this to yourself]", "Your generated document", "See attachment", { attachments: [ {fileName: blob.getName(), mimeType: "application/pdf", content: blob.getBytes()} ] }); }