title: Getting 401 'Login Required' while accessing ga api url in browser
body: <p>I am getting following exception in browser</p>
  
  <pre><code>   {  
     "error":{  
        "errors":[  
           {  
              "domain":"global",
              "reason":"required",
              "message":"Login Required",
              "locationType":"header",
              "location":"Authorization"
           }
        ],
        "code":401,
        "message":"Login Required"
     }
  }
  </code></pre>
  
  <p>using this <a href="https://www.googleapis.com/analytics/v3/data/ga?ids=ga:XXX&amp;start-date=2016-06-16&amp;end-date=2016-06-19&amp;metrics=ga:TimeOnPage" rel="nofollow">Google API Service</a> link.</p>
  
  <p>I have obtain auth parameter from developer consol and send these parameter in request header of post request using RestClient and getting response code 404.</p>
  
  <pre><code>   {  
     "web":{  
        "client_id":"XXX.apps.googleusercontent.com",
        "project_id":"XXX-1347",
        "auth_uri":"https://accounts.google.com/o/oauth2/auth",
        "token_uri":"https://accounts.google.com/o/oauth2/token",
        "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
        "client_secret":"XXX",
        "javascript_origins":[  
           "http://localhost:8080"
        ]
     }
  }
  </code></pre>
  
  <p>Can anybody tell me how to use these parameter to get timeOnpage metrics using above url.
  Thanks</p>