1

How do I obtain a Google OAUTH2 key using curl? In particular I'm interested in getting a key for blogger.com.

I can successfully retrieve data when logged into the Google API Explorer.

GET https://www.googleapis.com/blogger/v3/blogs/byurl?url=http%3A%2F%2Feastbay-rc.blogspot.com&key={YOUR_API_KEY}
konqi
  • 5,137
  • 3
  • 34
  • 52
Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
  • 1
    Are you aware that you can copy complete curl request out of Chrome? Hit F12 to open developer tools, go to the network tab. Then do the requests you're interested in. When done, you can right click the requests in the network tab and say "copy as cURL". https://developers.google.com/identity/protocols/OAuth2 is a good resource for OAuth2 as well. – konqi Feb 01 '16 at 11:54
  • I did not know that! Thanks for that great tip. – Mark Harrison Feb 01 '16 at 16:57
  • You are most welcome. Doing the OAuth2.0 dance can be a bit of pain with curl alone though. At some point you will have to open a browser to log into your google account and allow the scopes for a given application. I don't know what you're trying to do... but if you just want to run a service i recommend you create a project in console.google.com and authenticate the application service account. Give access to your api/blog? to that service account and you can save yourself lots of trouble. I find service account authentication much easier. – konqi Feb 01 '16 at 21:04
  • possible duplicate of http://stackoverflow.com/q/18244110/1503886 – Jay Lee Feb 07 '16 at 14:36

0 Answers0