-2

I am trying to run this example code in Google App Maker:

/**
 * The following example demonstrates how to create a post that is available
 * to all users within your G Suite domain.
 */
function createPost() {
  var userId = 'me';
  var post = {
    object: {
      originalContent: 'Happy Monday! #caseofthemondays'
    },
    access: {
      items: [{
        type: 'domain'
      }],
      domainRestricted: true
    }
  };

  post = PlusDomains.Activities.insert(post, userId);
  Logger.log('Post created with URL: %s', post.url);
}

However, I keep getting this:

GoogleJsonResponseException: Access to the Google+ Domains API is not allowed as the user has consented to incompatible scopes. 

Has anybody else managed to get this working?

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Scott
  • 477
  • 4
  • 20
  • The snippet provided in the link you shared works fine for me. You can try to create all-new App Maker app and check if it will work there. If it won't... then maybe you can try to play with your domain configuration. And here you can find one more hint: https://stackoverflow.com/questions/22904417 – Pavel Shkleinik Oct 24 '17 at 16:23

1 Answers1

0

Pavel's link had the answer: I just had to remove all access at https://security.google.com/settings/security/permissions and then re-authorize.

Thanks, Pavel!

Scott
  • 477
  • 4
  • 20