title: Google Container Engine REST API Authorization
body: <p>As mentioned <a href="https://cloud.google.com/container-engine/docs/v1beta1/authorizing" rel="nofollow">here</a> I created API key for using <a href="https://cloud.google.com/container-engine/docs/clusters/operations" rel="nofollow">cluster operations</a>.</p>
  
  <p>For example for this query:</p>
  
  <pre><code>https://www.googleapis.com/container/v1beta1/projects/PROJECT_ID/clusters
  </code></pre>
  
  <p>And as mentioned</p>
  
  <blockquote>
    <p>After you have an API key, your application can append the query
    parameter key=yourAPIKey to all request URLs.</p>
  </blockquote>
  
  <p>I added it to url:</p>
  
  <p><a href="https://www.googleapis.com/container/v1beta1/projects/PROJECT_ID/clusters?key=my_key" rel="nofollow">https://www.googleapis.com/container/v1beta1/projects/PROJECT_ID/clusters?key=my_key</a></p>
  
  <p>But i have error:</p>
  
  <pre><code>{
   "error": {
    "errors": [
     {
      "domain": "global",
      "reason": "required",
      "message": "Login Required",
      "locationType": "header",
      "location": "Authorization"
     }
    ],
    "code": 401,
    "message": "Login Required"
   }
  }
  </code></pre>
  
  <p>I even tried to add key to Authorization part of header...and had this error:</p>
  
  <pre><code>{
   "error": {
    "errors": [
     {
      "domain": "global",
      "reason": "authError",
      "message": "Invalid Credentials",
      "locationType": "header",
      "location": "Authorization"
     }
    ],
    "code": 401,
    "message": "Invalid Credentials"
   }
  }
  </code></pre>
  
  <p>Where is problem? Or did i something wrong?</p>