Pre Development Create project get project no:(to be set in Appscript Settings) create web client Get Client_ID(used in js, PHP and android app) and Client Secret(used in PHP ie backend app only) from Web client Add required scopes For JS ,get API key(used in javascript while intitializing gapi client (gapi.client.init). For Backend(PHP), Set Redirect URLs(…
Category: google
Get Google API Dependecy scripts PHP API Client gives an avenue to use Google Services. Download them with composer composer require google/apiclient:^2.15.0 Set up Front End Front end should have 2 components Login Screen Operations page Set up Backend Backend should handle following Show Login Button. Get tokens JSON with auth code. Refresh token on…
Understand the whole communication process Before using any API, you should understand the whole behind the scene activities done to effect the communication. This is explained in a brief way here Two parts for calling Google App Scripts with API Regardless of which language API you want to use, running Google App Scripts with API…
Some usefull links are in Google Official Documentation https://blog.heron.me/executing-functions-using-the-apps-script-api-47c822681e5d Good class to use as starting point https://ctrlq.org/google.apps.script/docs/guides/rest/quickstart/android.html Phase 1 : instatiate Credential static final int REQUEST_ACCOUNT_PICKER = 1000; static final int REQUEST_AUTHORIZATION = 1001; static final int REQUEST_GOOGLE_PLAY_SERVICES = 1002; private static final String PREF_ACCOUNT_NAME = "accountName"; private static final String[] SCOPES = { "https://www.googleapis.com/auth/drive"…
Integrating Google Sign-In into Your Android App Try Android Sample Project Configure a Google API Console project and set up your Android Studio project Integrating Google Sign-In into Your Android App Additional Scopes OAuth2 involves authentication and authorisation Authentication and Authorization frontend and backend workflow OAuth2 workflow Source of the above image is linked to…
Create Google Form with Google Script Steps Use Forms Service // Create a new form, then add a checkbox question, a multiple choice question, // a page break, then a date question and a grid of questions. var form = FormApp.create('New Form'); var item = form.addParagraphTextItem(); item.setTitle('Name') .setRequired(true); form.addTextItem() .setTitle('Phone Number') .setRequired(true); var item2 =…
OAuth2 workflow Google documentation on OAuth2 , see also Token Types Client Libraries Source of the above image is linked to the above image Workflow for serverside applications in Google Site PS: To view all accesses granted to all google apps, visit Google Security Checkup Web and App Activity Steps to integrate Google Login Create…
To add an HTML file to your Apps Script project, follow these steps: https://developers.google.com/apps-script/guides/html Open the Apps Script editor. At the left, click Add a file add > HTML. <!DOCTYPE html> <html> <head> <base target="_top"> <script> function readSSContents() { //simply call a funcion in script var ssContents = google.script.run.myFunction() } function onSuccess(numUnread) { var div…
function insert_value(request,sheet){ var id = request.parameter.id; var country = request.parameter.name; var flag=1; var lr= sheet.getLastRow(); for(var i=1;i<=lr;i++){ var id1 = sheet.getRange(i, 2).getValue(); if(id1==id){ flag=0; var result="Id already exist.."; } } //add new row with recieved parameter from client if(flag==1){ var d = new Date(); var currentTime = d.toLocaleString(); var rowData = sheet.appendRow([currentTime,id,country]); var result="Insertion successful";…
To open New >> More >> Google App Script Rename **A google script file will have this basic function *** function doGetTest(e){ } sligtly alter it like function doGetTest(e){ if (e === undefined)e ={parameters:{}}// for running tests } To get the url variable passed use e.parameter; eg: var op = e.parameter.action; Create google Spreadsheet Instance…