Mehdisouid / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

404 when running Google API Blogger post insert example #678

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client (e.g. 1.5.0-beta)?

1.12.0-beta

Java environment (e.g. Java 6, Android 2.3, App Engine)?

Java 6 SE (Desktop application)

Describe the problem.

I am trying to run the post insert example (my blog id is 5003102683969937524):

        GoogleCredential gcred = new GoogleCredential()
                .setAccessToken(ACCESS_TOKEN);

        new GoogleCredential.Builder();

        Blogger blogger
            = new Blogger.Builder(HTTP_TRANSPORT, JSON_FACTORY,gcred)
                .build();

        // Construct a post to insert
        Post content = new Post();
        content.setTitle("A test post");
        content.setContent("With <code>HTML</code> content");

        // The request action.
        Insert postsInsertAction = blogger.posts()
                .insert(TEST_BLOG_ID, content);

        // Restrict the result content to just the data we need.
        postsInsertAction.setFields("author/displayName,content,published,title,url");

        // This step sends the request to the server.
        Post post = postsInsertAction.execute();

and I get:

404 Not Found
{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Not Found",
    "reason" : "notFound"
  } ],
  "message" : "Not Found"
}

How would you expect it to be fixed?

No more 404.

Original issue reported on code.google.com by tshikats...@gmail.com on 7 Dec 2012 at 9:41

GoogleCodeExporter commented 9 years ago
Apologies for the difficulties you're having.  The code example in question has 
been confirmed to be working as intended.  Odds are the issue is something 
involving your specific code, such as your authentication.  For more 
personalized support, I suggest asking a question on Stack Overflow using the 
[google-api-java-client] tag. More information on support can be found here: 
https://code.google.com/p/google-api-java-client/wiki/Support

Original comment by ngmic...@google.com on 28 Feb 2013 at 4:20