Request an access token using a valid grant.
Go
package main import( "context" polargo "github.com/polarsource/polar-go" "github.com/polarsource/polar-go/models/components" "github.com/polarsource/polar-go/models/operations" "log" ) func main() { ctx := context.Background() s := polargo.New() res, err := s.Oauth2.Token(ctx, operations.CreateOauth2RequestTokenRequestBodyAuthorizationCodeTokenRequest( components.AuthorizationCodeTokenRequest{ ClientID: "<id>", ClientSecret: "<value>", Code: "<value>", RedirectURI: "https://memorable-season.name", }, )) if err != nil { log.Fatal(err) } if res.TokenResponse != nil { // handle response } }
{ "access_token": "<string>", "token_type": "<string>", "expires_in": 123, "refresh_token": "<string>", "scope": "<string>", "id_token": "<string>" }
"authorization_code"
1 - 2083
Successful Response
"Bearer"
Was this page helpful?