google-apigoogle-plusgoogle-domain-api

invalid credentials google plus api


I am trying to create post on Google Plus using API. I am using http protocol for create post as below.

URL : https://www.googleapis.com/plusDomains/v1/people/me/activities
Method : POST

header parameter :
Content-Type :application/json
Authorization : "browser key"

I am using below json as Request Body:

{
  "object": {
    "originalContent": "Happy Monday! #caseofthemondays",
  },
  "access": {
    "items": [{
        "type": "domain"
    }],
    "domainRestricted": true
  }
}

Now 1 got response:

Status : 401 Unauthorized

{ 
  "error": { 
     "errors": [ 
        { 
          "domain": "global", "reason": "authError", 
          "message": "Invalid Credentials", "locationType": "header",   
          "location": "Authorization" 
        } 
      ],
      "code": 401, "message": "Invalid Credentials" 
   }
}

I am using correct key and also enable Google Plus API and Google domain api enable. Can anyone help me how can I create post using Google Plus API. I am trying create new post on Google Plus using HTTP protocol.


Solution

  • I think you are conufusing Google+ Domains and Google+ the social media platform.

    Develop business apps that integrate with Google+

    Develop business apps that integrate with Google+ With the Google+ Domains API, Google Apps customers and ISVs can build custom Google+ functionality and services for people who use Google Apps at college, at work, or at home. Organizations can develop tools to interact with Google+ features such as posts, comments, and circles. These tools let your users share information, reinforce communications, and grow productivity within your organization.

    Getting Started with the Google+ Domains API

    The Google+ Domains API offers a number of additional features compared to the Google+ API v1: Write posts to the stream restricted to the domain.

    This is google apps domain This is Google plus

    They are two different systems, with two different APIs. The Google+ website has the Google+ API which allows read only access to view things. It does not allow you to post to a users stream.

    The Google APPs are used mostly by companies and has the Google+ Domain API which allows you to post messages to other members of the domain. This is not public no one besides the other members of the domain will see it.

    You will need to play for a Google domain account for you company if you want to use it. it is not free