google-spreadsheet-api

How do I set OAuth2 Google Credentials for Spreadsheet Service?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 19:40:52
I took example from here . But my code below gives me " The method setOAuth2Credentials(GoogleCredential) is undefined for the type SpreadsheetService ". import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.http.HttpTransport; import com.google.api.client.http.javanet.NetHttpTransport; import com.google.api.client.json.jackson.JacksonFactory; import com.google.gdata.client.spreadsheet.SpreadsheetService; import com.google.gdata.data.spreadsheet.SpreadsheetEntry; import com.google.gdata.data.spreadsheet.SpreadsheetFeed; import com.google.gdata.util

Access Google spreadsheet API without Oauth token

拜拜、爱过 提交于 2019-12-05 13:18:20
I've read google spreadsheet documentation https://developers.google.com/sheets/api/guides/authorizing And it says, that if document is public, you don't need Oauth 2.0 and API key is sufficient. I'm trying to do a test request with hurl and api key as parameter.it, but it still gives me error, that I need to use Oauth, any thoughts? POST https://sheets.googleapis.com/v4/spreadsheets/16woR-nfy6KYBbkQpC2YOT1GzIean8rTzjueUnlzLMiE/values/Sheet1!A1:E1:append?valueInputOption=USER_ENTERED Response: "error": {"code": 401,"message": "Request is missing required authentication credential. Expected

Google Apps Script/Sheet Returns Bad Request 400

[亡魂溺海] 提交于 2019-12-05 11:16:09
I have a fairly simple script running on a Google Sheet. The script accepts a webhook POST and writes the content of the webhook as a new row in the spreadsheet. The script does function as expected and it writes a new row when it receives data. However, the app from where I'm sending the webhook receives back "Bad Request 400" error for some reason. Even though the script worked and it did what it was supposed to do. This is a fiddle of the script I'm using. If I call this manually, I do get a 200 response: var response = UrlFetchApp.fetch("https://script.google.com/macros/s

(Gmail) Sending emails from spreadsheet. How to add signature with image?

蓝咒 提交于 2019-12-05 05:08:50
问题 Due to the large amount of emails i'm sending with GMAIL i decided to automatize this process using a script and following this tutorial.Tutorial: Sending emails from a Spreadsheet The "Message" is being generated by another function i created, called prepareEmails . The problems are the following: 1) How can i tell prepareEmails to add my personal signature? I can't simply copy its text into that function, because my signature contains an image (for which i have the URL), and i want that

Adding a row to a google spreadsheet

早过忘川 提交于 2019-12-05 00:13:09
问题 I'm trying to add a row to google spreadsheet. They give a source https://developers.google.com/google-apps/spreadsheets/#adding_a_list_row bu this source is not working for me can anyone tell me please whats is wrong with lines witch include name "row". "Error 11 The name 'row' does not exist in the current context" using System; using System.Collections.Generic; using System.Linq; using System.Text; using Google.GData.Client; using Google.GData.Spreadsheets; namespace Google_test3 { class

Google Spreadsheet API with PHP

萝らか妹 提交于 2019-12-04 21:19:50
I want to read from and write to Google spreadsheet using google spreadsheet API, After long battle I was able to get access token and stored it in a session variable, but i don't understand how to exchange this token to get contents from spreadsheet and to update spreadsheet. I was trying with below code to get a cell content. But nothing is being returned. <?php session_start(); $url = 'https://spreadsheets.google.com/feeds/cells/0AgxnPrGJ8****************RkMwSkZoQ2pXaFE/4/private/full/R2C2'; $headers = array( 'Authorization' => 'Bearer '.$_SESSION['access_token'], 'Gdata-version' => '3.0' )

Google Spreadsheets function to get a cell from a range by row and col name

a 夏天 提交于 2019-12-04 21:05:03
I have a range idz01 idz04 ida02 foo a 1 b bar c 3 8 baz 8 2 g And I want to get values from this range, like this: SOME_FUNCTION(rangeID, 'foo', 'idz04') to get 1 , etc. Or ideally, to get the cell: INDIRECT(SOME_FUNCTION(rangeID, 'foo', 'idz04')) or such. Is there something such? Can the GETPIVOTDATA() be used for that? Edit: I could somehow employ the LOOKUP if I was able to get the result_range : LOOKUP("foo", DataRange, FIRST_COL( OFFSET(DataRange, MATCH("idz04", FIRST_ROW(DataRange), 0) ) ) ) Only, I don't have FIRST_ROW() and FIRST_COL() ... Maybe FILTER() could help? Try this, you just

Authenticating and using a Google Spreadsheet as a database for a web app

别等时光非礼了梦想. 提交于 2019-12-04 20:23:20
There seem to be many questions in around this topic but none seem to answer my question. I have a simple website with a signup form, and when users enter their email I want to push this as a new row in a Google Spreadsheet I have already setup. I don't want the user to authenticate or even know about this spreadsheet. How do I authenticate so I can start using the Google API? Code/pseudocode would be greatly appreciated! Here are some examples that do not answer my question: Using Google Spreadsheet as DB for apps Google spreadsheet as db for web applications Here's a link to a library for

Access Google spreadsheet from Google Appengine with service account : working once per hour

自作多情 提交于 2019-12-04 18:50:47
I have implemented the python code here below based on the documentation in order to access a spreadsheet accessible through a public link. It works once every hour. If I execute a few seconds after a success, I receive an error : Error opening spreadsheet no element found: line 1, column 0 Assumption: The access token has an expiry date of 1 hour. So the appengine would proceed to a token refresh after an hour, resetting the whole. Question: This code requests a new token for each request. So what should I do ? Save the token ? When I try the token_to_blob in order to save the token, I get an

Using Spreadsheet API OAuth2 with Certificate Authentication

邮差的信 提交于 2019-12-04 18:21:45
I am trying to use Gdata Spreadsheet API with OAuth2. Using OAuth2.0 ClientID works with OAuth2WebServerFlow on a domain, But using Service Accounts / Certificate causes a 400 BAD Request The scopes used are https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/admin.directory.group.readonly https://www.googleapis.com/auth/admin.directory.user.readonly https://docs.google.com/feeds/ https://spreadsheets.google.com/feeds Here is the code that I am using SUCCEEDS : OAuth2.0 flow = OAuth2WebServerFlow(client_id=CLIENT_ID,