title: Parse Woocommerce Webhook (JSON)
body: <p>Wommcommerce fires a Webhook when a product is updated or an order is placed. I'm trying to catch this Webhook with a Google Apps Script (GAS), published as a WebApp. What I'm finally trying to achieve is to write incoming orders into a Google Spreadsheet. </p>
  
  <p>I'm having trouble to get the right (or at least some) data out of these webhooks. I tried different ways to write the data into a sheet, but the only thing I ever caught in the sheet was 'undefined'. Honestly I  don't know how to handle the JSON data. My testfunction is now:</p>
  
  <pre><code>function doPost(e){ 
    var doc =     DocumentApp.openById('myDocId');
    var jstring = Utilities.jsonStringify(e);
    doc.appendParagraph(jstring);
  }
  </code></pre>
  
  <p>When firing the webhook (order updated) I get the following output in the document:</p>
  
  <blockquote>
    <p>{"parameter":{},"contextPath":"","contentLength":1523,"queryString":null,"parameters":{},"postData":"FileUpload"}</p>
  </blockquote>
  
  <p>Obviously not parsed at all, but all I tried (e.g. getContentText()) didn't work. The Webhook-Log in Woocommerce tells me that this was sent:</p>
  
  <blockquote>
    <p>{"product":{"title":"testprodukt","id":136,"created_at":"2015-10-06T13:15:38Z","updated_at":"2015-10-09T15:19:04Z","type":"simple","status":"publish","downloadable":true,"virtual":true,"permalink":"<a href="http://MYDOMAIN/produkt/testprodukt/" rel="nofollow">http://MYDOMAIN/produkt/testprodukt/</a>","sku":"","price":"5.00","regular_price":"5.00","sale_price":null,"price_html":"€5,00","taxable":false,"tax_status":"taxable","tax_class":"","managing_stock":false,"stock_quantity":"","in_stock":true,"backorders_allowed":false,"backordered":false,"sold_individually":false,"purchaseable":true,"featured":false,"visible":true,"catalog_visibility":"visible","on_sale":false,"product_url":"","button_text":"","weight":null,"dimensions":{"length":"","width":"","height":"","unit":"cm"},"shipping_required":false,"shipping_taxable":true,"shipping_class":"","shipping_class_id":null,"description":"<p>somedescription</p>n","short_description":"","reviews_allowed":false,"average_rating":"0.00","rating_count":0,"related_ids":[],"upsell_ids":[],"cross_sell_ids":[],"parent_id":0,"categories":[],"tags":[],"images":[{"id":0,"created_at":"2015-10-09T15:19:05Z","updated_at":"2015-10-09T15:19:05Z","src":"<a href="http://MYDOMAIN/wp-content/plugins/woocommerce/assets/images/placeholder.png" rel="nofollow">http://MYDOMAIN/wp-content/plugins/woocommerce/assets/images/placeholder.png</a>","title":"Platzhalter","alt":"Platzhalter","position":0}],"featured_src":false,"attributes":[],"downloads":[],"download_limit":0,"download_expiry":0,"download_type":"","purchase_note":"","total_sales":7,"variations":[],"parent":[]}}</p>
  </blockquote>
  
  <p>I'm looking for a hint, links, examples, a push in the right direction how to get the data out the webhook.</p>