I use the Blogger library for php,I can not edit an existing post. This works fine on a publicly accessible blog where the authenticated user is an "author". However, on a blog which was originally set to "invitation-only", with exactly the same user having administrator privileges, neither programmatic creation nor update works. I can read the post.
The error message was:
(403) We're sorry, but you don't have permission to access this resource.'
#0 ./GoogleClientApi/src/io/Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest))
#1 ./GoogleClientApi/src/service/Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest))
#2 ./GoogleClientApi/src/contrib/Google_BloggerService.php(372): Google_ServiceResource->__call('update', Array)
#3 main.php(137): Google_PostsServiceResource->update('854693594998780...', '218373723174711...', Object(Google_Post))
#4 main.php(166): publi in ./GoogleClientApi/src/io/Google_REST.php on line 67
in brief:
Array
(
[error] => Array
(
[errors] => Array
(
[0] => Array
(
[domain] => global
[reason] => forbidden
[message] => We're sorry, but you don't have permission to access this resource.
)
)
[code] => 403
[message] => We're sorry, but you don't have permission to access this resource.
)
)
the code is:
$client = new Google_Client();
Setting the client object
$blogger = new Google_BloggerService($client);
request code
$code = $_GET['code']; // i got it
$client->authenticate($code);
//end the setup
/* any function call this, */
$data = $blogger->posts->update($blogId, $postId, $post);
this make a PUT request with some data, i think this is not important, if so, i ll put the request later
my code is like this: http://gayanonline.blogspot.com.ar/2013/03/google-api-v3-with-php-using-blogger.html
For the initiation part.
thanks, and sorry for my english. Emanuel