Re: 500 Internal Server Error after insert.execute

Jimmy Stock <[email protected]>
Newsgroups gmane.comp.web.blogger.api
Message-ID <[email protected]>
the code is working after i manually set token to insert object. But i have 
other question. Following code always prompt permission page. Can i store 
the token and use it later ? What is the code to just insert the token and 
post blog?

Credential credential = authorize(HTTP_TRANSPORT, JSON_FACTORY, new 
LocalServerReceiver(), BloggerScopes.all());
// set up global Plus instance
System.out.println(credential.getRefreshToken());
Builder blog = new Blogger.Builder(HTTP_TRANSPORT, JSON_FACTORY, 
credential);
blog.setApplicationName("project-name-in-google-console");

Post content = new Post();
content.setTitle("A test post");
content.setContent("With <code>HTML</code> content");
 Blogger blogger = blog.build();
Insert insert = blogger.posts().insert("6828107655361625046", content);
insert.setIsDraft(false);
insert.setFields("author/displayName,content,published,title,url");
        insert.setOauthToken(credential.getRefreshToken());

Post post = insert.execute();

-- 
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/groups/opt_out.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.