amit-learning / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

Coordinate API Error #509

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I was trying to use the coordinate api to fetch the location details. I have 
purchased recently Maps Pro accunt. Below is the code snippet am using.

using Google.Apis.Auth.OAuth2;
using Google.Apis.Coordinate.v1;
using Google.Apis.Services;

----------------

UserCredential credential;
            using (var stream = new FileStream(System.Web.HttpContext.Current.Server.MapPath(@"../CertStore/client_secret_422540146947.json"), FileMode.Open, FileAccess.Read))
            {
                credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(GoogleClientSecrets.Load(stream).Secrets,
                    new[] { CoordinateService.Scope.Coordinate },
                    "user", CancellationToken.None);
            }
            // Create the service.
            var service = new CoordinateService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName = "spero",
            });

            var locationReq = service.Location.List("teamId", "WorkerMail.com", (ulong)DateTime.Today.AddDays(-1).ToUniversalTime().Subtract(new DateTime(1970, 1, 1)).TotalSeconds);

            var locationResult = locationReq.Execute();
----------------------------
Am getting the below error

Google.Apis.Requests.RequestError Backend Error [500] Errors [ Message[Backend 
Error] Location[ - ] Reason[backendError] Domain[global] ] 

What is going wrong .

Original issue reported on code.google.com by theanish...@gmail.com on 20 Nov 2014 at 4:47