title: Google Drive Picker - Developer Key is Invalid Error
body: <p>I started to learn Google Drive Picker API and started with my <code>localhost</code> (I have created my client id and browser key for the domain <code>http://localhost/</code> and my files locations are localhost/ch1.html etc. </p>
  
  <p>Here's the script I wrote in the body part of my document:</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://apis.google.com/js/api.js?onload=onApiLoad"&gt;&lt;/script&gt;
  &lt;script&gt;
      function onApiLoad(){
          gapi.load('auth',{'callback':onAuthApiLoad}); 
          gapi.load('picker'); 
      }
      function onAuthApiLoad(){
          window.gapi.auth.authorize({
              'client_id':'545195528713-tihc7u0hp9ihta5mrm4l0eon16fpjogi.apps.googleusercontent.com',
              'scope':['https://www.googleapis.com/auth/drive']
          },handleAuthResult);
      } 
      var oauthToken;
      function handleAuthResult(authResult){
          if(authResult &amp;&amp; !authResult.error){
              oauthToken = authResult.access_token;
              createPicker();
          }
      }
      function createPicker(){    
          var picker = new google.picker.PickerBuilder()
              .addView(new google.picker.DocsUploadView())
              .addView(new google.picker.DocsView())                
              .setOAuthToken(oauthToken)
              .setDeveloperKey('AIzaSyB3I3JOepScrZgySA9tBWL9pXAUaLJ-NFg')
              .build();
          picker.setVisible(true);
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>But when I run the doc it shows nothing. Is it like I can't use the drive api on <code>localhost</code> or I will have to use some button to call it or something like that please help.</p>
  
  <p>Tested Example - </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;head&gt;
      &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"/&gt;
      &lt;title&gt;Google Picker Example&lt;/title&gt;
  
     &lt;script type="text/javascript" src="https://apis.google.com/js/api.js?onload=onApiLoad"&gt;&lt;/script&gt;
  &lt;script&gt;
      function onApiLoad(){
          gapi.load('auth',{'callback':onAuthApiLoad}); 
          gapi.load('picker'); 
      }
      function onAuthApiLoad(){
          window.gapi.auth.authorize({
              'client_id':'545195528713-tihc7u0hp9ihta5mrm4l0eon16fpjogi.apps.googleusercontent.com',
              'scope':['https://www.googleapis.com/auth/drive']
          },handleAuthResult);
      } 
      var oauthToken;
      function handleAuthResult(authResult){
          if(authResult &amp;&amp; !authResult.error){
              oauthToken = authResult.access_token;
              createPicker();
          }
      }
      function createPicker(){    
          var picker = new google.picker.PickerBuilder()
              .addView(new google.picker.DocsUploadView())
              .addView(new google.picker.DocsView())                
              .setOAuthToken(oauthToken)
              .setDeveloperKey('AIzaSyC4N7lg1vN6YrxcD5DDt_Iu0GXsF3QGFDU')
              .setCallback(pickerCallback)
              .build();
          picker.setVisible(true);
      }
  
      function pickerCallback(data) {
          var url = 'nothing';
          if (data[google.picker.Response.ACTION] == google.picker.Action.PICKED) {
            var doc = data[google.picker.Response.DOCUMENTS][0];
            url = doc[google.picker.Document.URL];
          }
          var message = 'You picked: ' + url;
          document.getElementById('result').innerHTML = message;
        }
  &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="result"&gt;&lt;/div&gt;
      &lt;script type="text/javascript" src="https://apis.google.com/js/api.js?onload=onApiLoad"&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/bAO99.png" alt="google-project-keys"><img src="https://i.stack.imgur.com/86Rta.png" alt="terminal-chrome"><img src="https://i.stack.imgur.com/X1Kmk.png" alt="list of image api&#39;s enabled"></p>