Can't insert a post with v3 API and ServiceAccountCredential with .net
Michele Lepri <[email protected]>
| Newsgroups | gmane.comp.web.blogger.api |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
as subject, I have problem inserting posts.
- My account permissions are fine (I have tested multiple account)
- I think to set the code for the authentication in the right way
(followed
https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth
example);
Here some of my code:
//Service creation
var certificate = new X509Certificate2(@"key.p12", "notasecret",
X509KeyStorageFlags.Exportable);
var credential = new ServiceAccountCredential(
new
ServiceAccountCredential.Initializer(BloggerConst.CLIENT_MAIL)
{
Scopes = new[] { BloggerService.Scope.Blogger, },
}.FromCertificate(certificate));
var serv = new BloggerService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
});
//post creation and insert
var newPost = new Post()
{
Title = "test",
Content = "test",
};
var postInsertRequest = new PostsResource.InsertRequest(serv,
newPost, task.BlogId);
post = postInsertRequest.Execute();
Anyone have similar issues?
Thanks
michele
--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/bloggerdev.
For more options, visit https://groups.google.com/d/optout.