다음 Google oAuth -1. Client_ID & Secret_ID -2를 통해 코드를 잡았습니다. Access Token 코드를 교환하여 -3. 이제 삭제를 삽입하고 싶습니다. & 데이터/이벤트 검색 사용자 크레딧 정보 대신 나에게 사용 가능한 액세스 토큰을 사용하는 Google 캘린더에서 데이터/이벤트 검색. 내가 뭘 잘못하고 있는지 알려줘.액세스 토큰을 사용하여 Google 캘린더에 데이터 삽입
Getting Error: Execution of request failed: http://www.google.com/calendar/feeds/[email protected]/private/full
아무에게도 도움이 될 수 있습니까?
Uri oCalendarUri;
ExtendedProperty oExtendedProperty;
void Insert()
{
Google.GData.Calendar.EventEntry oEventEntry = new Google.GData.Calendar.EventEntry();
oEventEntry.Title.Text = "Test Calendar Entry From .Net";
oEventEntry.Content.Content =
"Hurrah!!! I posted my first Google calendar event through .Net";
Where oEventLocation = new Where();
oEventLocation.ValueString = "New Zealand";
oEventEntry.Locations.Add(oEventLocation);
When oEventTime = new When(new DateTime(2014, 9, 26, 09, 0, 0),
new DateTime(2014, 9, 26, 12 , 0, 0).AddHours(2));
oEventEntry.Times.Add(oEventTime);
oExtendedProperty = new ExtendedProperty();
oExtendedProperty.Name = "SynchronizationID";
oExtendedProperty.Value = Guid.NewGuid().ToString();
myValue = oExtendedProperty.Value;
oEventEntry.ExtensionElements.Add(oExtendedProperty);
CalendarService oCalendarService = GAuthenticate();
System.Net.ServicePointManager.Expect100Continue = false;
//Save Event
oCalendarService.Insert(oCalendarUri, oEventEntry);
}
private CalendarService GAuthenticate()
{
oCalendarUri = new Uri("http://www.google.com/calendar/feeds/" +
sGoogleUserName + "/private/full");
CalendarService oCalendarService = new CalendarService("CalendarSampleApp");
string token = Session["token"].ToString();
oCalendarService.SetAuthenticationToken(token);
return oCalendarService;
}
이미 작성한 코드를 실행하면 어떻게 될까요? 아마도 무언가 잘못되었지만 당신은 무엇을 말하지 않았습니까? –
또한 이것이 v2 API입니까? v3을 사용하는 것이 좋습니다. https://developers.google.com/api-client-library/dotnet/apis/calendar/v3 –
이 오류는 gettting입니다. 요청 실행에 실패했습니다. http : // www .google.com/calendar/feeds/imenmyself4u @ gmail.com/private/full –