2

I have a question about Google APIs. My goal is to post status to our Google+ company page from server. So it has to be server-side, completely.

I saw hundreds of pages from Google documentation, but I don't understand it at all.

When I try to execute action "plusDomains.activities.insert" (over API Explorer), I'm getting error:

{
 "error": {
  "errors": [
   {
    "domain": "plusDomains",
    "reason": "forbiddenScope",
    "message": "Access to the Google+ Domains API is not allowed as the user has consented to incompatible scopes. See: https://developers.google.com/+/domains/authentication/."
   }
  ],
  "code": 403,
  "message": "Access to the Google+ Domains API is not allowed as the user has consented to incompatible scopes. See: https://developers.google.com/+/domains/authentication/."
 }
}

What is the reason of this error? And what user I have to use? In developers console I have 3 users and 1 full admin (my G-Apps account). What should I set as client-id and to google credentials object?

Many thanks for any advice.

Jakub Dibala
  • 95
  • 2
  • 8

1 Answers1

5

The API Explorer has a bug where it defaults to scopes that are incompatible with Google+ Domains accounts. Go to the Google account permissions list and revoke access from Google APIs Explorer. Go back to the APIs Explorer and authorize again but uncheck the https://www.googleapis.com/auth/plus.login scope leaving only plus.me and plus.stream.write scopes enabled.

abraham
  • 46,583
  • 10
  • 100
  • 152
  • Many thanks for answer. Now it gives me this error: { "error": { "errors": [ { "domain": "plusDomains", "reason": "notDomainRestricted", "message": "The operation is not allowed because the activity is not domain restricted." } ], "code": 403, "message": "The operation is not allowed because the activity is not domain restricted." } } – Jakub Dibala Oct 08 '14 at 05:23
  • 1
    That error is pretty self-explanatory. Look at the [activities.insert](https://developers.google.com/+/domains/api/activities/insert) documentation for `domainRestricted`. – abraham Oct 08 '14 at 14:21
  • Oh :-) Thanks, now I know. But now I have another error. When I set domainRestricted to true, I got this error: {\n _"error": {\n __"code": 500,\n __"message": null\n _}\n }\n I don't know what to do with it. Am I doing right, that I'm using address @developer.gserviceaccount.com as client e-mail address and another random ID as client ID (from Google Developers Console)? When I try to authorize with my user e-mail (on our google-apps domain), I got error "invalid_grant" and no longer gets access-token. Thanks for any help. – Jakub Dibala Oct 09 '14 at 09:12
  • I had this working and suddenly it stopped working. after removing the access as mentioned by @abraham , it started working.. i wonder what is the issue. – Gunnrryy Feb 15 '17 at 15:18