googleworkspace / go-samples

Go samples for Google Workspace APIs
Apache License 2.0
213 stars 100 forks source link

token expired and refresh token is not set #41

Open isomorphisms opened 4 years ago

isomorphisms commented 4 years ago

Expected Behavior

load labels with go run quickstart

Actual Behavior

unable to retrieve labels: Get https://www.googleapis.com/gmail/v1/users/isomorphismes%20gmail.com/labels?alt=json&prettyPrint=false: oauth2: token expired and refresh token is not set exit status 1

Steps to Reproduce the Problem

  1. copy the code
  2. click buttons to enable gmail api
  3. fix the misplaced if statement
  4. go run quickstart.go

Specifications

asrivas commented 4 years ago

Do you have a token.json in your working directory? Please try deleting it and running the quickstart again. Which if statement are you referring to in #3?