invalid credentials google plus api - google-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.

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

Related

projectNotLinked error when using Google Play API Explorer to issue refund

I am trying to use Google Play Developer API (API explorer). Specifically talking about "orders.refund" API- I want to refund and revoke a single purchased IAP but getting the error below.
Went into Google Play Developer console
API access -> Created a new Google Cloud Project. Under APIs, I see "Google Play Android Developer API" set to "ON".
I click View API details which forwards me to my Google Cloud project where I see my Google Play Android Developer API
I click "Try in API explorer"
On the left side, I click order -> refund, and fill in the PackageName, orderID and revoke boolean field.
Google OAuth 2.0 and API Key are both checked, and I click EXECUTE
"Sign up with Google" dialog appears, I choose the same account I have, and then get the below error
Tried what other posts suggested a few years back- adding a new IAP product in Google Play Console, deleted it, but still no-go.
Anyone knows how to unblock me?
{
"error": {
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.",
"errors": [
{
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.",
"domain": "androidpublisher",
"reason": "projectNotLinked"
}
]
}
}

"Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup." When Using Drive API to host videos

I'm getting an error using Google's Drive API. Since the videos I want to host on my website are larger than 200 MB, I've been using the Drive API to create a direct download link to use as my video source. I was able to do this by using the ID of the video and an API key from my Google Dev Console and creating a link that looks like this:
https://www.googleapis.com/drive/v3/files/videoID?alt=media&key=APIkey
However, as of late, I've been receiving this error when the video link is clicked:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}
Is there a way to increase the limit of unauthenticated use without needing to have the user sign up?
Use embedded item instead
As mentioned here, you can embed your videos into your web page rather than get the file through the Google Drive API.
Bear in mind:
Google Drive API is intended to develop applications that integrate with Google Drive.
Google Drive API has a usage limit for billing and non-billing accounts.
Having that said I strongly recommend you to use <iframe>, since you are using this file in a <video> tag.

Authenticate with Google Sheet API v4

I would like to connect and make request on a Google Sheet I've access with my personal Google account. I went on console.google.com and I created a new project for this purpose. I activated Google Sheet API too, and generated an API key.
I tried to use the Google Sheet v4 API with a curl request on a sheet:
https://sheets.googleapis.com/v4/spreadsheets/sheetId/values/Feuille%20!A1:D5?key=xxx
But the response I've got back is:
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}
Do you have any information on this issue? I tried to search on Google but no viable solution was answered for my purpose.
Thanks.
How about this answer?
Issue:
The reason of the error is as follows.
If you want to access to the Spreadsheet using the API key, it is required to publicly share the Spreadsheet.
API key can access to the publicly shared Spreadsheet with the GET method.
Solution:
As a test case, when you shared publicly your Spreadsheet, you can retrieve the values from the Spreadsheet using the endpoint.
If you don't want to share publicly the Spreadsheet, please use the access token retrieved from OAuth2 and service account.
References:
Using OAuth 2.0 to Access Google APIs
If this was not the direction you want, I apologize.

How to determine storage quota used by each google service?

My questions all revolve around trying to work out how much storage each google service is contributing toward a user's storage quota.
Version 2 of the Google Drive API itemizes the user's storage quota into it's service components. eg: drive, gmail, photos,...
{
"quotaBytesTotal": "16106127360",
"quotaBytesUsed": "8815339193",
"quotaBytesUsedAggregate": "11518850915",
"quotaBytesUsedInTrash": "3690146836",
"quotaType": "LIMITED",
"quotaBytesByService": [
{
"serviceName": "DRIVE",
"bytesUsed": "8815302329"
},
{
"serviceName": "GMAIL",
"bytesUsed": "2696242936"
},
{
"serviceName": "PHOTOS",
"bytesUsed": "7268786"
}
]
}
Version 3 of Google Drive API returns only Drive's contribution toward the user's total storage quota...
{
"storageQuota": {
"limit": "16106127360",
"usage": "11518850915",
"usageInDrive": "8815339193",
"usageInDriveTrash": "3690146836"
}
}
Have I missed someplace in the V3 API of Drive which provides the previous functionality detailing how much each service is contributing?
(If not) Is the intent of this change documented or blogged about anywhere? Is there a direction/methodology they're working toward which indicates what we might see appearing in other API's sometime?
How long until V2 is decommissioned and we're forced to migrate to V3?
To get the same data will I have to authenticate each and every service to get the quota contribution?
Which API reveals the GMAIL storage usage now?
Which API reveals the PHOTOS storage usage now?
How might I establish which services are using enough quota to warrant a request for access to-to get their Available vs Used numbers?
Thanks

Google places api request denied error

I am using google palces api for autocomplete textview in my android project. I have enabled the api key. I am using a server key but all the time I have this error when I call the service through a browser :
{
"error_message" : "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console",
"predictions" : [],
"status" : "REQUEST_DENIED"
}
And same error in android debugger.
As mentioned in the error, you have to go to the Google Developers Console, then open APIs & auth -> APIs and enable the Google Places API Web Service which include the autocomplete feature :
Find detailed information about places across a wide range of categories. Backed by the same database used by Google Maps and Google+, the Google Places API Web Service features about 100 million businesses and points of interest that are updated frequently through owner-verified listings and user-moderated contributions. Key features include autocomplete, search, place picker, photos and add place.
Hope that can help.

Resources