I am using google analytics api for C# v3 and I am trying to upload csv file for custom data set. But I am getting error that baseUri is missing. When I debug code under service object there is baseUri, and on internet I found some answers for this which points to wrong data set id I test that and it is not working. Also in all examples they use p12 file for service account and they have Management.DailyUploads property under service object, but I do not have that and even on web api explorer there is no DailyUploads. Other thing is that I am using json file for service account and I test some other api calls and they are working fine. So is there some bug with this google api call?
this is what I am doing
GoogleCredential credential;
using (var stream = new FileStream(HttpContext.Current.Server.MapPath("~/App_Data/AppKeyFile.json"), FileMode.Open, FileAccess.Read))
{
credential = GoogleCredential.FromStream(stream).CreateScoped(AnalyticsService.Scope.Analytics);
}
var service = new AnalyticsService(new BaseClientService.Initializer
{
HttpClientInitializer = credential,
ApplicationName = "[APP_NAME]"
});
var uploadStream = new FileStream(@"[FILE_PATH]", FileMode.Open, FileAccess.Read);
var request = service.Management.Uploads.UploadData("[AccountId]", "[WEB_PROPERTY_ID]", "[DATA_SET_ID]", uploadStream, "resumable");
var result = await request.UploadAsync();