How to determine storage quota used by each google service? - google-api

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

Related

"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.

How to get the used storage of Gmail mailbox by using Gmail API?

I've looked in the Gmail API document to find API that allows retrieving the used storage of the Gmail mailbox.
As I searched, the used storage of mailbox (total size of all emails in a mailbox) can retrieve by calculating the sum of each email message's size.
However, this way is too slow when applying for a big mailbox.
So, I wonder that do we have another API from Google that allows retrieving the used storage of a Gmail mailbox?
Thank you.
You can get this formation with the Drive API v2
More specifically, with the method
About.
It will return you
{
"serviceName": "GMAIL",
"bytesUsed": "805949924"
}
However, keep in mind that Drive API v2 is outdated and might get
deprecated in the future.

Is there a way to check Google drive storage using Drive API for Android?

I am currently using below component for a Xamarin app.
https://components.xamarin.com/gettingstarted/googleplayservices-drive
I tried uploading a file to a Google drive that has a full storage using above component and it seems to successfully upload and returns a successful response. When I retrieve all files in the drive's folder it seems to be there for a few seconds then disappears.
In some cases, applications may need to use the Google Drive web service to access additional features or access broader scopes than what is available in the Google Drive Android API.
Google does not expose the user's Drive storage quota within the Android.Gms.Drive api.
You will need to use the Rest APIs using an Auth2 token that has been authorization a Drive scope and call:
https://www.googleapis.com/drive/v3/about
With the Json response, you can access storageQuota:
{
"storageQuota": {
"limit": "16106127360",
"usage": "3115832693",
"usageInDrive": "373280402",
"usageInDriveTrash": "46755721"
}
}
Google Ref: About: get

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.
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

Can insert our custom data of places in google places api?

Many of you has worked on LBS application in android and also used the Google Places API web service for the information of various places. And you may also noticed that the data for India specifically is not accurate means many of places that you know are not their on the map.
So my question is that is there any way that you can add your database to Google's Places API Web service in the form of XML/JSON? If yes then please let me know how it is possible.
Have a great day ahead!!
Places add requests :
Place Report requests are used to add new Places, or delete existing ones. New Places will be available immediately in Place Searches initiated by your application, and will enter the moderation queue to be considered for Google Maps. A newly-added Place will not be available to other applications until it has been approved by the moderation process.
Places that have been added by your application can also be deleted, until they have been moderated. Once moderated and added into the full Place Search results, a Place can no longer be deleted. Places that are not accepted by the moderation process will continue to be visible to the application that submitted them.
POST https://maps.googleapis.com/maps/api/place/add/json?sensor=true_or_false&key=api_key HTTP/1.1
Host: maps.googleapis.com
{
"location": {
"lat": -33.8669710,
"lng": 151.1958750
},
"accuracy": 50,
"name": "Google Shoes!",
"types": ["shoe_store"],
"language": "en-AU"
}
(from: Google Places API : Add Place Privacy)
The Place Add has been deprecated on June 30, 2017 and will stop working on June 30, 2018. So you cannot use this method anymore. For further details please refer to the corresponding post.

Resources