0

I got this error message when I try to create a post to user's wall by calling this rest service. Can somebody help me?

Error image

H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
  • Are you making the request as a user who's email ends in `@gmail.com`? Those types of Google accounts can't use the Domains API. – abraham Jul 21 '16 at 17:00
  • Are there any google accounts which email doesn't ends in @gmail.com? – Ramindu Rusara Senarath Jul 22 '16 at 05:02
  • Paid [Google Apps](https://apps.google.com/) accounts do not end in `@gmail.com` they end in the domain the customer has for their website. The Google+ Domains API only works for Google+ accounts that are apart of a paid Google for Work account. – abraham Jul 22 '16 at 22:12

3 Answers3

0

You have to enable the Google+Domain API in the google api console.Then try again with your code.

Prakash P
  • 342
  • 1
  • 9
  • Google+Domain API is enabled. I just can't understand the where is the problem. – Ramindu Rusara Senarath Jul 22 '16 at 04:56
  • I think you are not given the scopes for posting.Can you please put your code so i can check that.Also please go through the [link](https://developers.google.com/+/domains/api/activities/insert#parameters).May be it will help you. – Prakash P Jul 22 '16 at 05:23
  • This is the oauth request https://accounts.google.com/o/oauth2/auth?scope=email%20https://www.googleapis.com/auth/plus.stream.write%20https://www.googleapis.com/auth/plus.me%20https://www.googleapis.com/auth/plus.login&response_type=code&redirect_uri=http%3A%2F%2Fprojectx.abc.lk%2Fstaging&from_login=1&client_id={client_id} – Ramindu Rusara Senarath Jul 22 '16 at 07:33
  • You can use the below code as example for oauth request "https://accounts.google.com/o/oauth2/auth?response_type=code&access_type=offline&client_id={YOUR_CLIENT_ID}&redirect_uri=http%3A%2F%2Flocalhost%2Fprojects%2Fglus%2Findex.php&state&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.me%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.stream.write&approval_prompt=auto" – Prakash P Jul 22 '16 at 08:25
0

To work with google plus domain api you need create account http://apps.google.com/ and then use this user to create post. But!!! They create posts domain restricted. I've not finde way how to create public post for now.

webmak10
  • 479
  • 1
  • 7
  • 18
0

Share API available only for GSuite accounts. It is not available for simple accounts @gmail.com. You should create GSuite account and use it for Create Post API method. This post will be available only for domain users. You can look at this page and you will found the solution for your issue. https://developers.google.com/+/domains/getting-started#features_comparison