title: Invalid Credentials error when trying to add post to blogger using API
body: <p>I have trying to add a post to blogger using API since yesterday but no luck. Here is my code. When I run it, I get "Invalid Credentials" error.</p>
  
  <p>I have also posted screenshot below which shows from where I am getting that key in Google Developer Console. May be I am picking up wrong key?</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>&lt;?php
  $key  = "J7c";
  $blog_id = "123456";
  
  $url = 'https://www.googleapis.com/blogger/v3/blogs/'.$blog_id.'/posts/';
  $postData = array(
      'kind' =&gt; 'blogger#post',
      'blog' =&gt; array('id' =&gt; $blog_id),
      'title' =&gt; 'This is title',
      'content' =&gt; 'This is content'
  );
  
  $data_string = json_encode($postData);
  
  $head = array();
  $head[] = 'Authorization: '.$key;
  $head[] = 'Content-Type: application/json';
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  $rsp = curl_exec($ch);
  $results = json_decode($rsp);
  var_dump($rsp);
  ?&gt;
  </code></pre>
  
  <p><strong>Error</strong><br>
  <a href="https://i.stack.imgur.com/mkg9R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mkg9R.png" alt="enter image description here"></a></p>
  
  <p><strong>Google Developer Console</strong><br>
  <a href="https://i.stack.imgur.com/I85wi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I85wi.png" alt="enter image description here"></a></p>