title: Errors when using DialogFlow "restore agent" API
body: <p>We have suddenly started experiencing an error when using the DialogFlow "<a href="https://cloud.google.com/dialogflow/docs/reference/rest/v2/projects.agent/restore" rel="nofollow noreferrer">restore agent</a>" API. The call is failing with the error:</p>
  
  <blockquote>
    <p>400 com.google.apps.framework.request.BadRequestException: Invalid
    agent zip. Missing required json file agent.json</p>
  </blockquote>
  
  <p>Oddly, it only seems to happen for newly created DialogFlow agents, but not for older/existing ones.  We are using this API so that we can programmatically create a custom agent using our own intents/entities.  This code has been working for about the past two years, with no changes on our side.  We are using the official DialogFlow client library for Python. We have been on version 0.2.0, and I tried updating to the latest (0.8.0) but there was no change.</p>
  
  <p>I tried changing our code to include the agent.json file (by using the "<a href="https://cloud.google.com/dialogflow/docs/reference/rest/v2/projects.agent/export" rel="nofollow noreferrer">export agent</a>" API and getting the agent.json file from there).  In that case, I no longer get the above error and the restore appears to succeed. However, the agent then seems to be corrupt in some way.  When trying to click on any intent -- or various other operations in the DialogFlow console -- I get the error:</p>
  
  <blockquote>
    <p>Failed to get Training Phrases Errorid=xxx </p>
  </blockquote>
  
  <p>(where xxx seems to be a UUID that changes each time)</p>
  
  <p>Trying to export the agent in that state also displays an error:</p>
  
  <blockquote>
    <p>Error downloading agent</p>
  </blockquote>
  
  <p>Occasionally, even including the agent.json as above, the restore will still fail but return the error:</p>
  
  <blockquote>
    <p>500 Internal error encountered.</p>
  </blockquote>
  
  <p>I appreciate any ideas on how we can get this working again. Thanks!</p>