title: Google drive API for upload not working at all
body: <p>I've read a lot of other people with half of this problem, and tried their solutions, but I can't get anywhere with it. </p>
  
  <p>I first ran the example tutorials from google here: 
  <a href="https://campus.codeschool.com/courses/discover-drive/" rel="nofollow noreferrer">https://campus.codeschool.com/courses/discover-drive/</a></p>
  
  <p>Then I ran the example code from here: 
  <a href="https://developers.google.com/picker/docs/index" rel="nofollow noreferrer">https://developers.google.com/picker/docs/index</a></p>
  
  <p>Running those codes with my API and client keys (I've even created new keys, tried using only the part before the .apps.googleusercontent.com for the client key as I've seen in some other example code, etc.)  and I get the same result.</p>
  
  <p>The page loads and asks for permission to access google drive for an account As soon as I give it permission it reverts to the following error:</p>
  
  <p><a href="https://dl.dropboxusercontent.com/u/6405154/googleerror1.PNG" rel="nofollow noreferrer">Jconsole Error</a></p>
  
  <p>I have a useless window error that says: </p>
  
  <blockquote>
    <p>There was an error! 
    The API developer key is invalid.</p>
  </blockquote>
  
  <p>Now Other people have said the error was normal, and that their code still worked.  Mine on the other hand does not work, AND it gives me that error.</p>
  
  <pre><code>&lt;script&gt;
    var clientId = '249642562982-8ss843cvik6r1rrm94i1kt5cf4jf201c.apps.googleusercontent.com';
    var developerKey = 'AIzaSyBeDBmIqzCYCNvrpSwXcLz6ido_qGZL6sg';
    var accessToken;
    function onApiLoad() {
      gapi.load('auth', authenticateWithGoogle);
      gapi.load('picker');
    }
    function authenticateWithGoogle() {
      window.gapi.auth.authorize({
        'client_id': clientId,
        'scope': ['https://www.googleapis.com/auth/drive']
      }, handleAuthentication);
    }
    function handleAuthentication(result) {
      if(result &amp;&amp; !result.error) {
        accessToken = result.access_token;
        setupPicker();
      }
    }
    function setupPicker() {
      var picker = new google.picker.PickerBuilder()
        .setOAuthToken(accessToken)
        .setDeveloperKey(developerKey)
        .addView(new google.picker.DocsUploadView())
        .enableFeature(google.picker.Feature.MULTISELECT_ENABLED)
        .setCallback(myCallback)
        .build();
      picker.setVisible(true);
    }
    function myCallback(data) {
      if (data.action == google.picker.Action.PICKED) {
        alert(data.docs[0].name);
      } else if (data.action == google.picker.Action.CANCEL) {
        alert('goodbye');
      }
    }
  &lt;/script&gt;
  &lt;script src="https://apis.google.com/js/api.js?onload=onApiLoad"&gt;&lt;/script&gt;
  </code></pre>
  
  <p><a href="https://dl.dropboxusercontent.com/u/6405154/error%203.PNG" rel="nofollow noreferrer">Here are my keys</a></p>
  
  <p>This is driving me nuts! It feels like I've tried everything and nothing is working. Why would google spend time to create a tutorial site, with full-on video lessons that check your code's validity if the flippin' resulting code doesn't work!? Take down the videos and example code if it is broken! I've wasted all day on this.  </p>
  
  <p>Can anyone help me figure out what's going on here?</p>
  
  <p>References:</p>
  
  <p><a href="https://stackoverflow.com/questions/27247547/how-to-upload-file-on-google-drive-from-my-website">How to upload file on google drive from my website?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21611152/using-google-drive-in-an-iframe-doesnt-work">Using Google Drive in an iFrame doesn&#39;t work</a></p>
  
  <p><a href="https://stackoverflow.com/questions/22435410/google-drive-picker-api">Google Drive Picker - Developer Key is Invalid Error</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15424441/google-drive-api-oauth-2-0-error-origin-mismatch">Google Drive API OAuth 2.0; Error: origin_mismatch</a></p>