I need an extension to post articles on blogger, I came to know about Blogger API provided by google. I think it is possible to create an extension.
You forgot to mention how much you will pay for it.
how much do you think I should pay?
$10? $100? $1000?
It’s your money, you should state your budget and if someone is interested they will develop it for you.
Why do you need an extension. Just use the REST api and a web component…
i am not able to do it, trying for two days straight, I am getting errors,
My friend, blogger api is very simple, there is no need to create an extension for this. Actually it would be worse, since any changes in api would force you to pay someone to update the extension instead of just change some blocks yourself.
If you still don’t understand enought of component web to make this, pay someone to create the blocks for you instead of create the extension. It will be better and cheaper too.
Don’t forget to mention all the functionalities that you will need.
Functions like retrieving posts, and URLs are easy but I am having issues with adding a new post, that’s the only thing I want to do. I found no solutions over the internet
Yes, you need to get an 0Auth token to create posts. This is not so straightforward…you may need to work through a webview in order to get the token.
https://www.daimto.com/how-to-get-a-google-access-token-with-curl/
Watch the video, it certainly helps. Seems the thing to do is to get the access token and refresh token using your computer, then you can just use the refresh token to get a new access token each time in the app with a POST request.
I have now been able to test this, and it works as I suggested above.
You need to set up your project correctly on Google Console, create a Desktop App, complete the consent screen, add your google account as a test user, get the credentials file for the client_id and client_secret, get/set the scope for Blogger, then carefully follow the instructions in the blog post I linked to or as described in the video.
This to get a new access Token (using the refreshToken):
This to create a new post on Blogger
Resources:
I am not able to find refresh token anywhere in google console , & is authToken = Client secret?
You won’t, and no.
In order to at the very least connect to Blogger using the API, you must have an API key, in which case you assigned this to a google cloud project ?
As I already said above:
- You need to set up your project correctly on Google Console
- create a Desktop App
- complete the consent screen
- add your google account as a test user
- get the credentials file for the client_id and client_secret
- get/set the scope for Blogger
- then carefully follow the instructions in the blog post I linked to or as described in the video.
As I also suggested, prepare the first two urls (Authorization Code and Get Token) and run these on your computer, the first in a browser (where you authenticate with your google account to use the (google cloud) Desktop app), the second using curl at the command line. which should then return the accessToken and the refreshToken.
When I can find the time, I might create a tutorial, with pictures and everything!
I think I got you, basically, to get accessToken I have to run URLs on the desktop, and to get refresh Token I should run CURL. after running these two I would get accessToken and refresh token which and then can be used in the app, right?
Now I have a question, do I need to do it every time before posting on blogger, or done once is enough for a particular time frame?
Once you have the refresh token, you can get a new access token anytime you like, using the blocks I showed above. The access token will last for 1 hour, but you can refresh the token inside that time and use the new one or the old one.
Got it, Thanks for the valuable information. I will let you know when I wrap everything up.
Hello @TimAi2 I did Everything as you said,
.Created a desktop App
.Completed the consent Screen
.Added my google account as test user
.got credintial file of desktop app
.Set scope as blogger
Here is a curl response after requesting for the access token.
and here is the code snippet for refreshing the access code.
but I am getting response content as
But with curl, I am able to refresh the access token. and when I try posting on blogger with live access token I got response as
I don’t know where the problem is. Please look through it.
My approach with dictionaries should work, but it seems it doesn’t. If you just add the json as text blocks it works, but it looks like BuildRequestData works too, well done for getting this far.
I have just finished working through and documenting the setup from the beginning, 45 images and counting…