google drive used space report in google apps domain - api

Anyone knows if it's possible to get a report with free/used google drive space for each user? Something similar to "account report" https://developers.google.com/google-apps/reporting/#accounts_report but for Google drive?
thanks

There's no report autogenerated but all the data is available.
You can grab a list of all users in your Google Apps instance with the Provisioning API:
https://developers.google.com/google-apps/provisioning/#retrieving_organization_users_experimental
You can authenticate to Drive API as each user using a service account that has been granted domain-wide authority:
https://developers.google.com/drive/delegation
Lastly, you can determine the user's current usage as well as their quota using the about() API call:
https://developers.google.com/drive/v2/reference/about/get
this will give you a real-time view of user usage and quota (as opposed to a report that can be up to 24 hours outdated)

Related

How do I get Approved to use the restricted LinkedIn Connections API?

I want to be able to get the first-degree connections of an authorized user and import them into my mobile app.
How do I get Linkedin to give me access to their restricted APIs??
I tried to use the Connections API, but I got an error saying:
"Not enough permissions to access: GET-viewer /connections"
I need to have these scopes added to my app:
r_1st_connections
r_compliance
From Linkedin Developer Support:
"Unfortunately we cannot grant access to the connections API, this endpoint is part of our compliance API, which is only granted to partners who are helping Regulated LinkedIn Members and Customers facilitate regulatory compliant usage of Social Media. (i.e.- it exists solely for monitoring and auditing activity where such monitoring/auditing is legally required by the SEC)." Hence, the permission error.".
Hope you have created a linkedin App, if not then create it from here https://developer.linkedin.com/
Then you need to apply for LinkedIn product "Marketing Developer Platform". It takes 4-5 working days to get approval from linkedin team.
Once you get access to this, it will allow you to use the auth scope
r_1st_connections_size
Use your 1st-degree connections' data

BigQuery API jobs oauth and Google account change

I have a problem with BigQuery and I wonder if any of you already had to struggle with something similar.
A gmail address was accidentally associated with the Google account based on a corporative email address becoming the one that appears as the admin of all of the Google tools we are using: Google Analytics, Adwords, etc.
We solved it adding the corporative address again as admin and removing permissions to the gmail address.
The last tool to "fix" is BigQuery. We have a lot of jobs that extract data via API. The oauth process and the historical jobs shows at this moment the gmail login, not the previous one.
If we remove the secondary (gmail) account, will the jobs work taking automatically the original address as the login user for the Oauth process? Or will we have to modify all the scripts? Will the job history be lost?
Regards.

Statistics on number of Google Spreadsheets using the new Google Drive User Metrics

Google Admin SDK used to have the "Google Docs" User Metrics for reporting. With it we were able to fetch the property "docs:num_spreadsheets" to get the number of spreadsheets owned by the each user. The Google docs metrics are now being deprecated, replaced by Google Drive metrics. However I don't any way to get the number of spreadsheets of a user. I can get the number of spreadsheets created by a user during a certain period (which period exactly, I couldn't figure out) but not the total number of Spreadsheets owned by them.
In this page it's written that drive:num_owned_google_spreadsheets_delta replaces the deprecated docs:num_spreadsheets but these are not the same metrics.
Any idea on how to address that?
Thanks a lot,
Rafael
As an alternative to the Admin SDK metrics, using the Drive API and generating the metrics user by user may be an option for you.
If so, in summary the pseudocode is: using a Service Account to impersonate each user and get an OAuth2 token , call the Drive REST API files.list method with a query (&q=...) of all files of mimetype of application/vnd.google-apps.spreadsheet and the user's email in owners. The length of the result set's files.files array is the count of the files (the metric) you want.

Instagram API app after june 1 2016

The Instagram new API policy have become super strict. They are not allowing fetching public content at all. We are literally following all Instagram policies and still cant get approval of public_content.
Is there any workaround or any possibility of fetching the data.
This is the response that I have recieved from instagram
General issues:
Policy Violation (Ad network, Influencer network, Other related): Your
app should not attempt to build an ad network on Instagram, nor
transfer any data that you receive from us (including anonymous,
aggregate, or derived data) to any ad network, data broker, influencer
network, or other advertising or monetization-related service. In
working to build a high quality platform, we ask that you comply with
our Platform Policy
(http://wwww.instagram.com/about/legal/terms/api/).
Yeah, they now grant permissions only to applications with some specific usage cases.
According to Instagram official website, these are:
To help individuals share their own content with 3rd party apps
To help brands and advertisers understand and manage their audience and digital media rights
To help broadcasters and publishers discover content, get digital rights to media, and share media with proper attribution
Note that in order to get public_content permission, you need to fall under the 2nd or the 3rd use case. Otherwise, consider changing your application / service in such way that is now uses basic permission and acquires only your users' media.
There is no valid and legal possibility to fetch public data except for successful passing the Instagram permission review.
This official developer documentation page may be useful to you.
You need to enable scopes invividually for your client https://api.instagram.com/oauth/authorize?client_id=CLIENT_ID&redirect_uri=APPC‌​ALLBACK&access_token=ACCESSTOKEN&response_type=code&scope=public_content in your browser, using your values for the uppercase words? This should enable your registered client to work with the public_content scope.
https://api.instagram.com/oauth/authorize?client_id=xxxxx&redirect_uri=xxxxx&access_token=xxxxx&response_type=code&scope=public_content
your comment
Read the error message, did you supply a valid client-id from your instagram developer account. Did you setup a redirect_uri for that client? Do you authenticate to instagram to get an access token?
This worked for me this weekend. Double check the values you set in the url and call it directly in your browser.

Another account access my Analytics API

I want to build a dashboard to my clients access your respective website analytics. But, after some research, I'm stuck.
Let's imagine the scenario:
My Analytics Account:
Client X - websitex.com
Client Y - websitey.com
In my dashboard, when the cliente Y log in, the data (pageviews) of websitey.com is shown on graphics.
But, there's a way to do that? By the moment, the only thing i got is retrieve information for my logged account (my analytics ID), not the information about another account.
There's a way to use the Google API, or, I'll have a "separate database" to save data each website?
Sorry, I'm really lost at the moment.
You can only view Google Analytics Accounts that you are authorized to view. For some reason this is a source of major confusion (seeing that your are not the first to ask), although it should be fairly self-evident.
If you want to see data from your clients account you have to ask your client to add your Google email to the GA account. If an email address is added to multiple accounts you can, via the API, choose between the accounts. Clientside authorization (OAuth2) will only work as long as somebody is logged in via a client application (usually a browser). The practial effect is that everybody who is authenticated via OAuth against Google will see only his own GA accounts, not other peoples data.
If you want a serverside application to pull data from various GA accounts you need a service account. But even the service account needs to be added to the GA accounts.
You can use the core reporting API, but the API will not give you access to accounts that you are not authorized to look at; your client needs to authorize you (or your applications service account).