title: How can I automate preview refresh for Actions on Google test draft?
body: <p>I've created a "conversational app" on Google's Dialogflow (formerly API.AI), integrated it with <em>Google Assistant via Integrations > Google Assistant > Test</em>, and successfully triggered intent from my (account linked) Google Home.</p>
  
  <p>I need to perform testing long term, but the test preview only seems to last for 30 minutes - 24 hours. I can refresh this preview in Actions on Google via <em>Overview > Test Draft</em>. I need a way to automate this refresh process, keeping the preview test available to my linked Google Home for extended period of time, e.g., several days or weeks.</p>
  
  <p>I've successfully imitated the XHR request made from Actions on Google to request the new <em>Test Draft</em> using Postman with my current session cookies and the request's header and content:</p>
  
  <pre><code>POST https://console.actions.google.com/u/0/m/actions/agents/draft/createlocalizeduserpreview
  
  Cookies: 1P_JAR, APISID, HSID, NID, OGPC, OSID, OTZ, S, SAPISID, SID, SIDCC, SSID
  
  Headers:
  Content-Type:application/x-www-form-urlencoded
  x-framework-xsrf-token:abcabcabcabc:1520203076726
  x-client-data:abcabcabc==
  user-agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
  referer:https://console.actions.google.com/u/0/project/logvital-baa11/simulatorcreate
  origin:https://console.actions.google.com
  
  Body:
  projectNumber=123412341234&amp;selectedLocale=en
  </code></pre>
  
  <p>If anyone has recommendation on how to automate the authorization step (i.e. to get authorized session cookies), this request could then be sent via automation such as cron task.</p>
  
  <p>For additional context / reference, here are some previous (now non-working) solutions and posts:</p>
  
  <p><a href="https://stackoverflow.com/questions/41088596/make-google-actions-development-project-preview-persist-longer/41205026#41205026">Make google actions development project preview persist longer</a></p>
  
  <p><a href="https://stackoverflow.com/questions/41052273/can-i-develop-a-private-action-only-accessible-via-my-google-home-or-linked-acco/42150303">Can I develop a private action only accessible via my google home or linked account?</a></p>
  
  <p><a href="https://discuss.api.ai/t/permanent-preview-of-actions-in-google-home/2707" rel="nofollow noreferrer">https://discuss.api.ai/t/permanent-preview-of-actions-in-google-home/2707</a></p>
  
  <p><a href="https://discuss.api.ai/t/timeout-in-google-integration-preview/3742/2" rel="nofollow noreferrer">https://discuss.api.ai/t/timeout-in-google-integration-preview/3742/2</a></p>