Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I request a single Spreadsheet with the C# GData API by Key?
    primarykey
    data
    text
    <p>I have a program that authenticates and can fetch a list of all spreadsheets that uses version 3 of the C# implementation of the the GData API (it follows the <a href="https://developers.google.com/google-apps/spreadsheets/#retrieving_a_list_of_spreadsheets" rel="nofollow noreferrer">the example</a> found in the documentation). What I am having a hard time figuring out is how to fetch a single resource by it's document key. I can see plenty of examples of retrieving lists of documents in the <a href="https://developers.google.com/google-apps/documents-list/#searching_for_documents_and_files" rel="nofollow noreferrer">Google Documents List API</a> and I can see how to zero into a specific document by an <a href="https://stackoverflow.com/questions/4726209/spreadsheet-authentication-in-gdata-api">exact name search</a>, but I'm trying to produce some code that survives a Spreadsheet being renamed. Here is the code I've written so far:</p> <pre><code>using System; using Google.GData.Client; using Google.GData.Spreadsheets; using Microsoft.VisualBasic; namespace q14201622 { class Program { static void Main(string[] args) { //OAuth 2 Stuff var parameters = new OAuth2Parameters() { ClientId = CLIENT_ID, ClientSecret = CLIENT_SECRET, RedirectUri = REDIRECT_URI, Scope = SCOPE }; Process.Start(OAuthUtil.CreateOAuth2AuthorizationUrl(parameters)); var response = Interaction.InputBox("Enter oAuth Code:", "q14201622", "", 0, 0); parameters.AccessCode = response; OAuthUtil.GetAccessToken(parameters); var accessToken = parameters.AccessToken; //Fetch Documents var requestFactory = new GOAuth2RequestFactory(null, "q14201622-v1", parameters); var service = new SpreadsheetsService("q14201622-v1"); var query = new SpreadsheetQuery(); query.Title = "Exact Title"; query.Exact = true; //Iterate over the results var feed = service.Query(query); foreach (var entry in feed.Entries) { Console.WriteLine(entry.Id + ":"+ entry.Title.Text); } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload