FAQ

On Friday, August 26, 2011 12:32:20 AM UTC-5, bradfitz wrote:
Now with docs:
http://code.google.com/p/google-api-go-client/wiki/GettingStarted
Did anyone able to use golang to interact with Google API ?
I followed GettingStarted wiki and in the end endup with following issue.

http://code.google.com/p/google-api-go-client/issues/detail?id=18

All the examples have "RegisterDemo" functions are not defined in the
google-api-go-client library.


tj



On Thu, Aug 25, 2011 at 1:51 PM, Brad Fitzpatrick <brad...@golang.org<javascript:>
wrote:
Nuts,

I'm happy to announce the *alpha* availability of Go libraries for
various Google APIs:

http://code.google.com/p/google-api-go-client/

In particular, all "new-style" Google APIs are supported. For some
background, see
http://www.google.com/events/io/2011/sessions/life-of-a-google-api-developer.html .
In summary, all new and upcoming Google APIs are self-describing (see
http://code.google.com/apis/discovery/ ) and from the JSON description
of an API you can generate a client library for any language (now including
Go). Older Google APIs that haven't [yet?] converted to the new-style API
infrastructure aren't supported by this.

The google-api-go-client project linked above contains both the code
generator as well as the auto-generated and goinstall-able packages for
each Google API, like:

$ goinstall google-api-go-client.googlecode.com/hg/urlshortener/v1

... for the http://goo.gl/ URL Shortener API.

Note that it currently requires a tip version of Go, though, not the r59
release. Once I'm happy that the code is relatively bug-free and it
graduates from alpha to beta, then I'll make sure it works with the
"release" version of Go. Until then, though, it's much easier for me to
only work at tip.

If you have any interest, please help me bang on this and find bugs.
(Warning: I promise there are bugs) Please file bugs at
http://code.google.com/p/google-api-go-client/issues/list and I'll fix
them. There are some examples in the examples directory:
http://code.google.com/p/google-api-go-client/source/browse/#hg%2Fexamples


Enjoy!

Brad
--

Search Discussions

  • Brad Fitzpatrick at Nov 18, 2012 at 3:54 am
    I replied on the bug.
    On Sat, Nov 17, 2012 at 7:28 PM, T.J. Yang wrote:


    Did anyone able to use golang to interact with Google API ?
    I followed GettingStarted wiki and in the end endup with following issue.

    http://code.google.com/p/google-api-go-client/issues/detail?id=18

    All the examples have "RegisterDemo" functions are not defined in the
    google-api-go-client library.


    tj



    On Thu, Aug 25, 2011 at 1:51 PM, Brad Fitzpatrick wrote:

    Nuts,

    I'm happy to announce the *alpha* availability of Go libraries for
    various Google APIs:

    http://code.google.com/p/**google-api-go-client/<http://code.google.com/p/google-api-go-client/>

    In particular, all "new-style" Google APIs are supported. For some
    background, see http://www.**google.com/events/io/2011/**
    sessions/life-of-a-google-api-**developer.html<http://www.google.com/events/io/2011/sessions/life-of-a-google-api-developer.html> .
    In summary, all new and upcoming Google APIs are self-describing (see
    http://code.google.com/**apis/discovery/<http://code.google.com/apis/discovery/> )
    and from the JSON description of an API you can generate a client library
    for any language (now including Go). Older Google APIs that haven't [yet?]
    converted to the new-style API infrastructure aren't supported by this.

    The google-api-go-client project linked above contains both the code
    generator as well as the auto-generated and goinstall-able packages for
    each Google API, like:

    $ goinstall google-api-go-client.**googlecode.com/hg/**
    urlshortener/v1<http://google-api-go-client.googlecode.com/hg/urlshortener/v1>

    ... for the http://goo.gl/ URL Shortener API.

    Note that it currently requires a tip version of Go, though, not the r59
    release. Once I'm happy that the code is relatively bug-free and it
    graduates from alpha to beta, then I'll make sure it works with the
    "release" version of Go. Until then, though, it's much easier for me to
    only work at tip.

    If you have any interest, please help me bang on this and find bugs.
    (Warning: I promise there are bugs) Please file bugs at
    http://code.google.com/p/**google-api-go-client/issues/**list<http://code.google.com/p/google-api-go-client/issues/list> and
    I'll fix them. There are some examples in the examples directory:
    http://code.google.**com/p/google-api-go-client/**
    source/browse/#hg%2Fexamples<http://code.google.com/p/google-api-go-client/source/browse/#hg%2Fexamples>


    Enjoy!

    Brad
    --
    --
  • T.J. Yang at Nov 18, 2012 at 4:45 pm

    On Saturday, November 17, 2012 9:54:14 PM UTC-6, bradfitz wrote:
    I replied on the bug.
    Thanks for the pointer, after following extra steps, I see ./examples bin
    got created without error.

    sudo go get -x code.google.com/p/goauth2/oauth
    go build -x .
    create clientid.dat with google id in the file
    create clientsecret.dat with password in the file
    now run the urlshortener

    TJYANG-MBA:examples tjyang$ ./examples urlshortener http://www.cnn.com
    2012/11/18 05:34:11 Authorize this app at:
    https://accounts.google.com/o/oauth2/auth?response_type=code&state=st%7B63488835251+681668000+0x46fcf0%7D&client_id=tjyang2001%40gmail.com&redirect_uri=http%3A%2F%2F127.0.0.1%3A52193&access_type=&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Furlshortener&approval_prompt=

    A pop up new tab in Chrome browser shows following

    Error: invalid_client

    Request Details

        - response_type=code
        - scope=https://www.googleapis.com/auth/urlshortener
        - redirect_uri=http://127.0.0.1:52170
        - state=st{63488834570 948250000 0x46fcf0}
        - client_id=tjyang2001@gmail.com

      off to learn and try oauth2's example at
    http://code.google.com/p/goauth2/source/browse/oauth/example/oauthreq.go

    tj
    On Sat, Nov 17, 2012 at 7:28 PM, T.J. Yang <tjyan...@gmail.com<javascript:>
    wrote:
    Did anyone able to use golang to interact with Google API ?
    I followed GettingStarted wiki and in the end endup with following issue.

    http://code.google.com/p/google-api-go-client/issues/detail?id=18

    All the examples have "RegisterDemo" functions are not defined in the
    google-api-go-client library.


    tj



    On Thu, Aug 25, 2011 at 1:51 PM, Brad Fitzpatrick wrote:

    Nuts,

    I'm happy to announce the *alpha* availability of Go libraries for
    various Google APIs:

    http://code.google.com/p/**google-api-go-client/<http://code.google.com/p/google-api-go-client/>

    In particular, all "new-style" Google APIs are supported. For some
    background, see http://www.**google.com/events/io/2011/**
    sessions/life-of-a-google-api-**developer.html<http://www.google.com/events/io/2011/sessions/life-of-a-google-api-developer.html> .
    In summary, all new and upcoming Google APIs are self-describing (see
    http://code.google.com/**apis/discovery/<http://code.google.com/apis/discovery/> )
    and from the JSON description of an API you can generate a client library
    for any language (now including Go). Older Google APIs that haven't [yet?]
    converted to the new-style API infrastructure aren't supported by this.

    The google-api-go-client project linked above contains both the code
    generator as well as the auto-generated and goinstall-able packages for
    each Google API, like:

    $ goinstall google-api-go-client.**googlecode.com/hg/**
    urlshortener/v1<http://google-api-go-client.googlecode.com/hg/urlshortener/v1>

    ... for the http://goo.gl/ URL Shortener API.

    Note that it currently requires a tip version of Go, though, not the
    r59 release. Once I'm happy that the code is relatively bug-free and it
    graduates from alpha to beta, then I'll make sure it works with the
    "release" version of Go. Until then, though, it's much easier for me to
    only work at tip.

    If you have any interest, please help me bang on this and find bugs.
    (Warning: I promise there are bugs) Please file bugs at
    http://code.google.com/p/**google-api-go-client/issues/**list<http://code.google.com/p/google-api-go-client/issues/list> and
    I'll fix them. There are some examples in the examples directory:
    http://code.google.**com/p/google-api-go-client/**
    source/browse/#hg%2Fexamples<http://code.google.com/p/google-api-go-client/source/browse/#hg%2Fexamples>


    Enjoy!

    Brad
    --
    --
  • Brad Fitzpatrick at Nov 18, 2012 at 5:07 pm
    On Sun, Nov 18, 2012 at 3:40 AM, T.J. Yang wrote:
    On Saturday, November 17, 2012 9:54:14 PM UTC-6, bradfitz wrote:

    I replied on the bug.
    Thanks for the pointer, after following extra steps, I see ./examples bin
    got created without error.

    sudo go get -x code.google.com/p/goauth2/oauth
    Why sudo? You shouldn't run "go get" as root. Do you not have your GOPATH
    set? See
    https://www.youtube.com/watch?feature=player_embedded&v=XCsL89YtqCs

    --
  • Cody Goodman at Jan 9, 2013 at 5:57 am
    Brad, do you know when/if there will be youtube support in the near future?
    I've wrote my own api for dealing with youtube movies in Go, but I'm not
    sure if it would be of much help or not.
    On Sunday, November 18, 2012 11:07:27 AM UTC-6, bradfitz wrote:



    On Sun, Nov 18, 2012 at 3:40 AM, T.J. Yang <tjyan...@gmail.com<javascript:>
    wrote:
    On Saturday, November 17, 2012 9:54:14 PM UTC-6, bradfitz wrote:

    I replied on the bug.
    Thanks for the pointer, after following extra steps, I see ./examples bin
    got created without error.

    sudo go get -x code.google.com/p/goauth2/oauth
    Why sudo? You shouldn't run "go get" as root. Do you not have your
    GOPATH set? See
    https://www.youtube.com/watch?feature=player_embedded&v=XCsL89YtqCs
    --
  • Andrew Gerrand at Jan 9, 2013 at 6:04 am

    On 8 January 2013 21:57, Cody Goodman wrote:

    Brad, do you know when/if there will be youtube support in the near
    future? I've wrote my own api for dealing with youtube movies in Go, but
    I'm not sure if it would be of much help or not.
    I believe it's in the works; Ikai (cc'd, he works on YouTube) should be
    able to shed some more light.

    Andrew

    --
  • Ikai Lan at Jan 9, 2013 at 11:21 pm
    Hi Cody,

    The current client will work with the v3 APIs right now. I'm working on
    some Go samples as we speak (with lots of help from Andrew).


    --
    Ikai Lan

    On Wed, Jan 9, 2013 at 1:04 AM, Andrew Gerrand wrote:
    On 8 January 2013 21:57, Cody Goodman wrote:

    Brad, do you know when/if there will be youtube support in the near
    future? I've wrote my own api for dealing with youtube movies in Go, but
    I'm not sure if it would be of much help or not.
    I believe it's in the works; Ikai (cc'd, he works on YouTube) should be
    able to shed some more light.

    Andrew
    --
  • Andrew Gerrand at Jan 9, 2013 at 11:29 pm
    Install with:
       go get code.google.com/p/google-api-go-client/youtube/v3

    Here are the docs:
       http://godoc.org/code.google.com/p/google-api-go-client/youtube/v3

    Andrew

    --
  • Ikai Lan at Jan 11, 2013 at 3:33 pm
    Cody, we're not ready to submit this to the documentation site yet, but
    here's one of the samples Andrew and I wrote:

    https://gist.github.com/1f746b018664f604e4cc

    It'll take you through the entire OAuth 3 legged auth flow and make an
    authenticated API call.

    On Wed, Jan 9, 2013 at 6:04 PM, Andrew Gerrand wrote:

    Install with:
    go get code.google.com/p/google-api-go-client/youtube/v3

    Here are the docs:
    http://godoc.org/code.google.com/p/google-api-go-client/youtube/v3

    Andrew

    --

    --
  • Cody Goodman at Jan 13, 2013 at 6:30 am
    Thanks Ikai, I've actually been writing lots of API's in Go lately and had
    to write one for youtube (I used the gdata feeds api). Thanks for the
    example though, I ended up writing my own oauth1 wrapper for Amazon before
    finding others! I'm sure this one will come in handy.
    On Friday, January 11, 2013 9:33:26 AM UTC-6, Ikai Lan wrote:

    Cody, we're not ready to submit this to the documentation site yet, but
    here's one of the samples Andrew and I wrote:

    https://gist.github.com/1f746b018664f604e4cc

    It'll take you through the entire OAuth 3 legged auth flow and make an
    authenticated API call.


    On Wed, Jan 9, 2013 at 6:04 PM, Andrew Gerrand <a...@golang.org<javascript:>
    wrote:
    Install with:
    go get code.google.com/p/google-api-go-client/youtube/v3

    Here are the docs:
    http://godoc.org/code.google.com/p/google-api-go-client/youtube/v3

    Andrew

    --

    --
  • Mike Rosset at Jan 13, 2013 at 7:39 am
    https://gist.github.com/1f746b018664f604e4cc#file-gistfile1-go-L172

    nice, I guess this will produce a application accept page?
    On Fri, Jan 11, 2013 at 7:33 AM, Ikai Lan wrote:
    Cody, we're not ready to submit this to the documentation site yet, but
    here's one of the samples Andrew and I wrote:

    https://gist.github.com/1f746b018664f604e4cc

    It'll take you through the entire OAuth 3 legged auth flow and make an
    authenticated API call.

    On Wed, Jan 9, 2013 at 6:04 PM, Andrew Gerrand wrote:

    Install with:
    go get code.google.com/p/google-api-go-client/youtube/v3

    Here are the docs:
    http://godoc.org/code.google.com/p/google-api-go-client/youtube/v3

    Andrew

    --

    --
    --
  • Admin at Mar 23, 2015 at 1:27 pm
    Hi,

    I have taken the sample from your link.
    Wonder if the import library is changed, cause it got error (not valid path)

    "code.google.com/p/goauth2/oauth"
    On Sunday, January 13, 2013 at 2:39:12 PM UTC+7, Mike Rosset wrote:

    https://gist.github.com/1f746b018664f604e4cc#file-gistfile1-go-L172

    nice, I guess this will produce a application accept page?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Reed O'Brien at Mar 23, 2015 at 1:33 pm
    I think it moved. Try golang.org/x/oauth2
    On Monday, March 23, 2015 at 9:27:18 AM UTC-4, ad...@tophyips.info wrote:

    Hi,

    I have taken the sample from your link.
    Wonder if the import library is changed, cause it got error (not valid
    path)

    "code.google.com/p/goauth2/oauth"
    On Sunday, January 13, 2013 at 2:39:12 PM UTC+7, Mike Rosset wrote:

    https://gist.github.com/1f746b018664f604e4cc#file-gistfile1-go-L172

    nice, I guess this will produce a application accept page?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Hyip Gigafeed at Mar 28, 2015 at 1:56 am
    I tried golang.org/x/oauth2

    Got error message as below:

    cannot find package "golang.org/x/oauth2" in any of:
      /usr/src/go/src/golang.org/x/oauth2 (from $GOROOT)
      /go/src/golang.org/x/oauth2 (from $GOPATH)


    See here: http://play.golang.org/p/caPzto97Ix
    On Monday, March 23, 2015 at 8:33:18 PM UTC+7, Reed O'Brien wrote:

    I think it moved. Try golang.org/x/oauth2
    On Monday, March 23, 2015 at 9:27:18 AM UTC-4, ad...@tophyips.info wrote:

    Hi,

    I have taken the sample from your link.
    Wonder if the import library is changed, cause it got error (not valid
    path)

    "code.google.com/p/goauth2/oauth"
    On Sunday, January 13, 2013 at 2:39:12 PM UTC+7, Mike Rosset wrote:

    https://gist.github.com/1f746b018664f604e4cc#file-gistfile1-go-L172

    nice, I guess this will produce a application accept page?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Diego Medina at Mar 28, 2015 at 4:31 am
    After updating the path in your go file, remember to run go get, I just
    tried it and it worked fine
    On Thursday, August 25, 2011 at 5:51:51 AM UTC-4, bradfitz wrote:

    Nuts,

    I'm happy to announce the *alpha* availability of Go libraries for various
    Google APIs:

    http://code.google.com/p/google-api-go-client/

    In particular, all "new-style" Google APIs are supported. For some
    background, see
    http://www.google.com/events/io/2011/sessions/life-of-a-google-api-developer.html .
    In summary, all new and upcoming Google APIs are self-describing (see
    http://code.google.com/apis/discovery/ ) and from the JSON description of
    an API you can generate a client library for any language (now including
    Go). Older Google APIs that haven't [yet?] converted to the new-style API
    infrastructure aren't supported by this.

    The google-api-go-client project linked above contains both the code
    generator as well as the auto-generated and goinstall-able packages for
    each Google API, like:

    $ goinstall google-api-go-client.googlecode.com/hg/urlshortener/v1

    ... for the http://goo.gl/ URL Shortener API.

    Note that it currently requires a tip version of Go, though, not the r59
    release. Once I'm happy that the code is relatively bug-free and it
    graduates from alpha to beta, then I'll make sure it works with the
    "release" version of Go. Until then, though, it's much easier for me to
    only work at tip.

    If you have any interest, please help me bang on this and find bugs.
    (Warning: I promise there are bugs) Please file bugs at
    http://code.google.com/p/google-api-go-client/issues/list and I'll fix
    them. There are some examples in the examples directory:
    http://code.google.com/p/google-api-go-client/source/browse/#hg%2Fexamples


    Enjoy!

    Brad
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 18, '12 at 3:28a
activeMar 28, '15 at 4:31a
posts15
users10
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase