How to retrieve Install Statistics from the Google Developer's Console? - json

I am trying to programmatically retrieve my company's app data from the Google Developer's Console, specifically the daily installs. I have found that Google recommends the gsutil tool to access the data programmatically through the Google Cloud Storage SDK. However, I beleive they charge for this service. I want a free way to programmatically retrieve the data, preferably as a JSON stream to avoid dealing with file downloads. I have found the "direct reporting" links, but I have problems authenticating when I try to use them, and I also have to do something with the actual files then.
Is there a way to get a JSON version of the data through OAuth2 or something without downloading an Excel file? Has anyone had to do this? Thanks in advance.

Related

requests: Get last modified time of Google Doc or Sheet?

I want to download a Google Sheet (and/or Doc, or Colab Notebook) from an "Anyone can View" sharing URL, if the file is newer than my local copy. To do that, I need to find out when the remote file was last modified. Which I thought shouldn't be hard.
There are threads explaining how to do this for regular files on websites that make use of the HTML Last-Modified property, but Google doesn't provide this field in its headers. It provides a Date: but that's just the download date/time that updates every moment.
I see threads about doing this from within the Doc or Sheet itself. My question is not about that. I'm talking about getting the info remotely by running a python script on my local machine.
I see a thread about using the Google Drive API v3, but....is it really necessary to go through all that (e.g. install oauth, register an API key, etc. effectively create an entire Google app *) just to find out when a publicly-available file was last modified? Is there an easier way?
Thanks!
EDIT: * I started down the road of Google Drive API but I find it confusing and overwhelming. It's like they think I'm trying to create an app for general users for the Android Store, instead of just myself. (??)

Is there any way to get Document Management activity logs using the Forge API

We are currently looking into the monitoring of documents and activities in BIM360. Webhooks for version added or changed work to a certain extent but only capture so much.
There is a way to manually export the logs into a csv file and idealy we would want to automate this process so our BI department has data to work with.
Furthermore if not possible, is this something you guys are planning to add to the API in the near future or is it a low prio kinda thing.
Cheers and thanks in advance
Sorry we don't have a direct API to extract that information. There is a built-in UI feature.
Via API you can get each file's version history, but that would require a recursive function to craw all folders & subfolders.

How to retrieve my Install Statistics from the Google Developer's Console

I am trying to programmatically retrieve my company's app data from the Google Developer's Console, specifically the daily installs. I have found that Google recommends the gsutil tool to access the data programmatically through the Google Cloud Storage SDK. However, I beleive they charge for this service. I want a free way to programmatically retrieve the data, preferably as a JSON stream to avoid dealing with file downloads. I have found the "direct reporting" links, but I have problems authenticating when I try to use them, and I also have to do something with the actual files then.
Is there a way to get a JSON version of the data through OAuth2 or something without downloading an Excel file? Has anyone had to do this?
You should look into use the Core Reporting API.
There are client libraries available in a number of languages.
You should work through the Hello Analytics APIs to get started.
Java Script
PHP
Python
Java
A quick solution for building a dashboard would also be the Embed API.
Using the gsutil tool to access the company's storage bucket that are provided by google is a free service. I wrote a code that will run the gsutil code as a process through the command line and parsed the downloaded .csv files into a database for storage. OAuth2 was not necessary.

Confuse after quickstart

I am pretty new to Google Drive SDk. After spend hours on the google drive sdk document and quick start app, I think I have known some basic concepts about it.
However, I have a easy but crucial question: how to integrate my code with Drive UI.
I mean I know I should enable Google Drive API and Google Drive SDK and do some configure staff. And I did.
I set up the MIME type that my app should be able to open and create, but it doesn't work. (I used the most easy one: plain/text: txt).
In fact, I think this is not the most serious problem. I am confused about how to integrate my code with Drive UI.
I mean the quick start app works fine, but it just simply upload a file. What if I want to perform some complicate action after user open a certain file with my app?
Ideally, I think it should redirect the user to my open URL and all the actions should go with that site, right?
(I am using Python, in case that could make any differences)
I am really confused. Excuse my chaos description, please.
Thanks in advance!
EDIT:
Thanks for the answering below! I think I need to detailed explain my needs from google drive sdk.
Basically, I want the user who have installed my app be able to open a certain file (which should be spreadsheet or txt) on google drive. Then it will redirect the user to my given Open URL (which I create a site by using google site). On that site, user should be able to view and import the content of file into a certain database. None of the operations above require any technique knowledges. I certainly can do this by writing python script and run it locally to import the content of files on google drive. However, there are two issues: first, I need to run it locally. I mean I did use the google drive api, but I didn't explore the real benefit of api; second, it is still a command line script, and has to be ran on linux.
I hope I have illustrated my request. And I appreciate any help in advance!
Install the client library:
pip install --upgrade google-api-python-client
Acquire an access token as explained on the Python Quickstart example. Init a Drive service to be able to talk to the API and authorize http transporter with your credentials. You need to make requests to get file metadata and file contents.
Retrieve file metadata:
http = httplib2.Http()
http = credentials.authorize(http)
drive_service = build('drive', 'v2', http=http)
f = drive_service.files().get(fileId=file_id).execute()
Retrieve file contents:
downloadUrl = f.get('downloadUrl')
f['content'] = drive_service._http.request(downloadUrl)
(Don't forget content retrieving request should be authorized and authenticated, that's why we use drive_service._http to make that request.

API to modify document content, ala App Script Document.*?

Are there any plans to open this extremely useful API to tools outside of App Script?
We love App Script, but need this access from other systems.
Not yet but this is something we are actively looking into. In the mean time unfortunately you are stuck with Apps Script or you can upload a file format that we can convert to a Google Document for instance an ODTor an RTF file and upload them to Drive via the API with the convert URL parameter to true. See: https://developers.google.com/drive/v2/reference/files/insert#convert