Pages

Monday, October 3, 2011

A solution for User does not have permission to create new post



Developing a piece of code for sending content to a blog in Blogger I wrote the whole thing and then I tested and published my work. Then after a while without modifying the codes it becomes corrupted and by investigating the error logs I found this error message: "User does not have permission to create new post". If you search for this error you will see a lot of people having the same problem and nowhere there is no solution for it, or even an explanation about it.

I had a code like this

response = service.Insert(new Uri("http://myblogname.blogspot.com/feeds/posts/default"), newPost);

I just changed it to

response = service.Insert(new Uri("http://www.blogger.com/feeds/874763488093493674364/posts/default"), newPost);

In the above code, that number after 'feeds/' is the blog id which you can find it easily when you are in your blog's control panel, almost every url is consisted of your blog id. (For security and privacy reasons I wrote a fake id, but yours should look similar.)

2 comments:

  1. タオ チューンJanuary 26, 2012 at 2:39 PM

    Thank you very much.
    This helps to solve my issue as well.

    ReplyDelete
  2. Thank you very much This is very good and useful idea.

    ReplyDelete