Re: Must Blogger.com API be "ON" to work?

Andreas S <[email protected]>
Newsgroups gmane.comp.web.blogger.api
Message-ID <[email protected]>
Thank you Luke for answer,

I got my API Enabled and can see that it is "ON" but still I get this 
error, see screenshot which shows exactly:
Error:(authError,Invalid Credentials,header,Authorization)

http://www.bilddump.se/bilder/20150313004049-195.252.32.111.bmp

The thing is that it seems that I do everything exactly after the book, 
correctly!

I have created a "refresh_token" successfully, which I use to create a 
temporary token which I will use. This is the URL I use to make a POST 
request:

*"https://www.googleapis.com/oauth2/v3/token?" +*

*            
"client_id=123456789-thisismyclientid.apps.googleusercontent.com&" +*
*            "client_secret=thisismyclientsecret&" +*
*            "refresh_token=thisismyrefreshtoken&" +*
*            "grant_type=refresh_token";*

I successfully create a token, see this screenshot of the message which I 
receive:
Returns: (access_token: thetoken, token_type: bearer, expires_in: 3600)

http://www.bilddump.se/bilder/20150313004608-195.252.32.111.bmp

Now I use this "access_token" and create this POST like below. As seen I 
have put the access_token like below with bearer: 
"*bearer THISISTHERETURNEDacces_token*" 

            String requestUrl = 
"https://www.googleapis.com/blogger/v3/blogs/123456789/posts/";

            RestSharp.RestClient rc = new RestSharp.RestClient();
            RestSharp.RestRequest request = new 
RestSharp.RestRequest(requestUrl, RestSharp.Method.POST);
            request.AddHeader("Content-Type", "application/json");
            request.AddHeader("Authorization", "bearer 
THISISTHERETURNEDacces_token");

            request.AddParameter("kind", "blogger#post");
            request.AddParameter("blogid", "123456789"); //My blog ID
            request.AddParameter("title", "Hello world how are you");
            request.AddParameter("content", "A posting message here. How 
are you");

             
            request.RequestFormat = RestSharp.DataFormat.Json;

            RestSharp.RestResponse restResponse = 
(RestSharp.RestResponse)rc.Execute(request);
            RestSharp.ResponseStatus responseStatus = 
restResponse.ResponseStatus;

     //This gives the error message, shown in the first link in this post
            MessageBox.Show(restResponse.Content.ToString() + "," + 
responseStatus.ToString());

I really can't figure out what I am doing wrong. I am completely stuck.

Thank you for your time in advance!







Den onsdag 11 mars 2015 kl. 22:24:02 UTC+1 skrev Luke:
>
> Hi Andreas,
>
> Yes, you need to have the API enabled. This requires your request for an 
> API key to be processed. Until it has been approved, you will get auth 
> errors.
>
> Luke
>

-- 
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.
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.