var certificate = new X509Certificate2(filePath, password, X509KeyStorageFlags.Exportable); var serviceAccountCredentialInitializer =new ServiceAccountCredential.Initializer("abc@developer.gserviceaccount.com") {Scopes = new[] {"https://sites.google.com/feeds/"}}.FromCertificate(certificate); var credential = new ServiceAccountCredential(serviceAccountCredentialInitializer); if(!credential.RequestAccessTokenAsync(System.Threading.CancellationToken.None).Result) throw new InvalidOperationException("Access token request failed."); var requestFactory = new GDataRequestFactory(null); requestFactory.CustomHeaders.Add("Authorization: Bearer " + credential.Token.AccessToken); //SitesService class inherits MediaService SitesService service = new SitesService(null) { RequestFactory = requestFactory }; Stream feed = service.Query(new Uri("https://sites.google.com/feeds/content/domain-name/site-name?path=page-path"));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)