title: google api v3 blogger post insert php ajax
body: <p>I have tried to get blogger blog info by using the api.</p>
  
  <pre><code>    $blogger = new Google_BloggerService($client);
  $data = $blogger-&gt;blogs-&gt;getByUrl(array('url'=&gt;'http://puwaruwa.blogspot.com/'));
  </code></pre>
  
  <p>and it worked fine and gave me the details. </p>
  
  <p>then I tried to insert a post as below </p>
  
  <pre><code>    &lt;?php
  
  $token = json_decode($token, true); //already got the token
  
  ?&gt;
  &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  $.ajax({
                  type:"POST",
                  url: "https://www.googleapis.com/blogger/v3/blogs/55555555555555/posts/",
                  Authorization: "OAuth &lt;?php echo $token['access_token']; ?&gt;",
                  data: {"kind": "blogger#post",
                "blog": {
                  "id": "555555555555555"
                },
                "title": "A new post",
                "content": "With &lt;b&gt;exciting&lt;/b&gt; content..."},
                  dataType: 'json',
                  contentType: 'application/json',
                  success:function(data){alert(data);}
                  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>but it gives me </p>
  
  <pre><code>    {
   "error": {
    "errors": [
     {
      "domain": "global",
      "reason": "required",
      "message": "Login Required",
      "locationType": "header",
      "location": "Authorization"
     }
    ],
    "code": 401,
    "message": "Login Required"
   }
  }
  </code></pre>
  
  <p>please help me to insert a post to blogger blog through api v3 using php.</p>