Skip to content

Trouble on the quickstart using app script #159

Open
@Bluefitdev

Description

@Bluefitdev

Expected Behavior

Hey guys,

I followed tutorial on google app script quick start for gmail API here

What i'm getting in the app script is this

GoogleJsonResponseException: API call to gmail.users.labels.list failed with error: Request had insufficient authentication scopes. (line 5, file "Code")

The code followed is exactly the same as the tutorial, I also enabled gmail in Resources > Advance Google Service

/**
 * Lists the labels in the user's account.
 */
function listLabels() {
  var response = Gmail.Users.Labels.list('me');
  if (response.labels.length == 0) {
    Logger.log('No labels found.');
  } else {
    Logger.log('Labels:');
    for (var i = 0; i < response.labels.length; i++) {
      var label = response.labels[i];
      Logger.log('- %s', label.name);
    }
  }
}

I thought its going to be easier for me to integrate stuff in google ecosystem. Right now my other way is to create my own server and use node js to use gmail api. can anyone help me please?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions