GoogleCloudPlatform / go-endpoints

Cloud Endpoints for Go
https://go-endpoints.appspot.com
Apache License 2.0
255 stars 56 forks source link

Inquiring the android publisher API #77

Closed miko-code closed 9 years ago

miko-code commented 9 years ago

I'm having an issue with inquiring the android publisher API i tried several ways but i'm stuck completely...
i tried this way but i got a 401 HTTP

c := endpoints.NewContext(r)
    st := []string{subUrl, userReq.SubscriptionToken}

    cli := &http.Client{
        Transport: &oauth2.Transport{
            Source: google.AppEngineTokenSource(c, "https://www.googleapis.com/auth/androidpublisher"),
            Base: &urlfetch.Transport{Context: c, Deadline: 0,
                AllowInvalidServerCertificate: true},
        },
    }

    res, err := cli.Get(strings.Join(st, "")) 

When i tried a similar code with a different scop against the cloud storage things worked fine ...

Im thinking of another way as suggested here https://developers.google.com/android-publisher/authorization And passing the access token as query param. How can i get the value of the access token ?

thanks, miki

miko-code commented 9 years ago

this issue can be closed , i figured out that you need another client in order to inquire the API