Could I have a user to write/read data to/from a google spreadsheet of *his* from a static website? - google-sheets-api

I could not store any secret keys since the data would be accessed though a static website. (I dont want to use google forms)
I understand I need a secret api key if I want anyone to write/read data to/from a google spreadsheet that is mine, but this is not my case.
This for example about a simple "TODO app", where each user would just access their own data, do I still need a key if each user is accessing only their own private spreadsheed?

This is kind of a broad question so my answer would be a series of recommendations, in that way you will have a better idea of what you have to do to fulfill your goal:
1) First of all. If you haven't heard about Apps Script, I would recommend you to check it, because it integrates easily programming tools for all Google apps.
2) Now knowing what's Apps Script, you could check how to integrate Apps Script code into your Spreadsheet by Extending Google Sheets.
3) Spreadsheet Service allows performing several tasks related to your Sheet files.
4) Knowing about Apps Script and how to handle the Sheets files by coding, the next step will be to check Web Apps, which will help you to create an integrated web app on your Spreadsheet.
5) The last thing I recommend you is to see the Class google.script.run (Client-side API), this class will pass values from your Front-end to your Back-end built on Apps Script.

Related

How to call Google NLP Api from a Google Chrome extension

My aim is to select some text from a web page, start a google chrome extension and give the text to a google cloud api (Natural Language API) in my case.
I want to do some sentimental analysis and then get back the result to mark/ highlight positive sentences in green and negative ones in red.
I am new to this and do not know how to start.
The extension consists of manifest, popup etc. How should I call an API from there that does Natural Language Processing?
Should I create a Google Cloud Application with an API_KEY to call? In that case I would have to upload my credentials right?
Sorry sounds a bit confusing I know but I just don't know how I can bring this 2 things together an would be more than happy about any help
The best way to authenticate your app will depend on the specific needs and use cases of your application. You can see an overview of all the different methods here.
If you are not planning on identifying users nor on using a back end server that handles authenticating (as I assume to be your case), the best option would indeed be to use API keys. They do not identify the user, but are enough for the Natural Language APIs.
To do this you will need to create an API key for the services you want and add the necessary restrictions to make the key as secure as possible. Detailed instructions on how to do this and how to use the key in a url can be found here.
The API call could be made from within the Chrome extension with any JavaScript method capable of performing POST requests. For example using XMLHttpRequest or the Fetch API. You can find an example of the parameters that need to be included in the request here.
You may run into CORS issues when making the request directly from the extension. I recommend reading this answer, where a couple of workarounds for these issues are suggested.

Using Google Cloud or Drive to Programatically Convert Word to PDF

Candidates use my PHP application to upload their CV in either Word or PDF format. I want to convert the Word documents (doc or docx) to PDF. I have tried using on-server solutions (PHP libraries), but can not find one that is reliable enough so I am now exploring Google solutions.
It seems that the Drive API has just what I need. I can:
upload a Word document and request conversion to Google Doc.
export the doc as a PDF
delete the doc
The problem is that (as far as I can see), the only way I can access the Drive API is via OAuth 2, which is quite an overhead in the case of simple server-to-server access. I would prefer to use a simple API key.
As far as I can see, if I want to use an API key, then I need to sign up for a Google Service Account, which again seems like quite an overhead. (I only want to convert some files, right?).
Is there a straightforward way to achieve my goal (using Google resources)? Or are the two options above my only choices?
Your use case is a perfect fit for a Service Account. It's not really much of an overhead, say 10 minutes to set up the account and a couple of hours to write the auth code. If you would rather use a regular account, check out How do I authorise an app (web or installed) without user intervention? which has step by step instructions and sample code.

Web app idea directions

I have an idea for a web app project, however, due to not having any programming knowledge, I'm first asking here for directions. Essentially, I wonder if the idea is realistic and what the most effective way could be for me to tackle it.
I want to combine several open-data sources, some in the form of API's (e.g. Google maps), others in the form of statistics in Excel sheets. Like a Mashup of different sources? The idea is to use the data to perform some data crunching and in effect provide some insights from this data in an aggregated way. I have previously played around with dashboards during an internship and I am attracted by the idea to maybe produce a Single page application for my idea with some visualisation. Any thoughts on this?
I have looked at the following services online, but I have no idea if they can help me produce a web app which aggregates different data sources and that allows for nice presentation:
Zoho Creator,
QlikSense,
Sproutcore,
Caspio
Any thoughts on this are highly appreciated!
Best regards
If you’re not a developer and would like to get started immediately, then you could get started by signing up with Zoho Creator. Its intuitive yet easy to use builder lets you setup web app in minutes.
Regarding your query for aggregation from different data sources, Zoho Creator provides REST API that allows you to access external data sources to interface with your web applications.
Zoho Creator allows you to setup the perfect web-app on a secure cloud with admin level access to handle the necessary permissions and manage data.
You can customize the Reports in your Zoho Creator application using Report Settings to suit your needs. Web-App can be created by converting a CSV/Excel into a full-featured Web DB / app in seconds.
You can check out our help videos or register for our upcoming webinar to know more about Zoho Creator.
Happy Building!!
Disclaimer: I work for Zoho Creator

Can you create Google Forms from Google Docs in an application?

I am thinking about app that will use google form and I need to create forms from that app. Is there a way how can I create form in google docs without using website but through some api or some other way?
I can offer an idea for a solution using Google App Script.
Since the beginning of 2013 you can create new forms using the App Script Forms Service API quite easily.
var form = FormApp.create(title)
.setDescription(description)
.setConfirmationMessage('Thanks for responding!')
;
The problem now is how to get that App Script running from your non App Script code.
You can use App Script to create a Web App that reacts to HTTP GET requests.
So putting it together, you may be able to create an App Script Web App that reacts to a GET request and when it gets the right URL parameters, it creates the form.
(Nov 2020) Yes, it is possible to programmatically create Google Forms. You can do it with Google Apps Script using its Forms service. You can also extend the code to read in the contents from Google Docs (with Apps Script's Document service) and use it for the creation of Google Forms.
I created a Google Workspace (formerly G Suite) Add-on, which you can think of as a Google Docs extension, called GFormIt. Its original purpose was intended for teachers to write exams/quizzes, possibly with answers, in Google Docs, then automatically convert them to Google Forms to distribute to students who submit their answers into Google Sheets (the destination for Google Forms submissions).
Furthermore, if you (the teacher) provided answers to your test questions, GFormIt would also auto-submit your answers to the Sheet as if you were a student. If you do that, and use a tool like Flubaroo to grade the exam, you could designate your row in the Sheet as “the answer key.” You can learn more about how it works, including viewing a short video, at the GFormIt page linked above.
This Google Docs add-on, along with others for Google Docs, Sheets, Slides, Forms, etc., are all certified/validated by Google and available for free to anyone from the Google Workspace Marketplace. (However, your admins may have to grant permissions for you to try to install them to your corporate Workspace account.) If interested in building your own add-on, please see the developer documentation and perhaps some of my introductory videos to get started, the most relevant being the one linked to at the top of this answer.
Apps Script is a serverless Google technology, meaning you write your code (using JavaScript) in the browser, and it is hosted by & executed on Google servers. If you wanted to create your own web app (and hosted anywhere), you would have to wait for a Google Forms REST API which does not exist at the time of this writing. (If we ever launch one, you'll find its documentation at https://developers.google.com/forms along with the others like Sheets https://developers.google.com/sheets, Gmail https://developers.google.com/gmail, Drive https://developers.google.com/drive, etc.)
Earlier this year (Mar 2022) the new Google Forms Api graduated from Beta. It is more powerful that the previous versions and caters for two main use cases:
Automated form creation and editing: Enables automated form creation
and editing. Enables rapid form generation from large volume question
banks or other data backends.
Reaction to Form responses: The API also enables developers to build
automations for acting on incoming responses. Examples include
developing real-time dashboards or visualizations and triggering
business workflows based on response data.
We have used it to build an integration that Creates documents and slides each time a form is completed: www.portant.co/google-forms-to-docs and it works really well.
I think the other key use case looks like it would be a good fit for you and others looking for a solution like this.
Cheers, James
Sorry, the API doesn't support programmatically creating forms.

Is there any quick and easy way to upload a Google Doc from SAP?

We're creating a custom table in SAP comprising all of the information we need and the customer needs the report from this table uploaded to Google Docs. We do not use Business By Design. Is there any other quicka nd easy way to upload our report?
I don't know much about SAP but the Documents List API has methods to programmatically upload a document to Google Docs: https://developers.google.com/google-apps/documents-list/.
For instance, if you can export the SAP table as a csv file, that can be automatically converted into a Google Spreadsheet during the upload process.
You could also go with a no-programming required solution and install the Google Drive app on a machine with access to the files for automatic sync up to Google Drive:
http://support.google.com/drive/bin/answer.py?hl=en&answer=2374989
suggest you take a look at the SAP Developer Network (SDN) / SAP Community Network (SCN) where there is a project called ABAP2GAPPS that has done this.
Note the ABAP2GAPPS example is a bit difficult to figure out (but you can learn a lot from it), and it also uses the OAuth2 'authorization code flow" OAuth2.0 flow/pattern, which requires an end-user 'consent' in an browser pop-up...so if you want to push up a file from ABAP automatically from a background job without end-user interaction then ABAP2GAPPS is not the full answer (but again, ABAP2GAPPS is a great example, suggest you look at it.)
We recently were able to achieve an interface from SAP ABAP to the Google Fusion Table API using OAuth2, with only about a 100 lines of ABAP...and the techniques we employed could be used on any of the Google API's...here's a link to the video:
Link to YouTube video interface ABAP to Google API
hope you find this helpful