Hi,

I am getting the following error when trying to post a simple calendar
event to one of my calendars.

gdata.service.RequestError: {'status': 400, 'body': '[Line 2, Column
164, element ns0:entry] Invalid text content type: 'Release
3.0.10'', 'reason': 'Bad Request'}

My simple test case script:

import atom
import gdata.auth
import gdata.calendar.service

print 'Logging in...'
gd_client = gdata.calendar.service.CalendarService()
gd_client.email = '[email protected]'
gd_client.password = 'mypasswordhere'
gd_client.source = 'TestApp-1.0'
gd_client.ProgrammaticLogin()
print 'logged in\n'

event = gdata.calendar.CalendarEventEntry()
event.title = atom.Title('Release 3.0.10')
event.content = atom.Content(text='New release of HealthMonthly from
subversion trunk')
start_time = "2008-08-27T06:00:00.000Z";
end_time = "2008-08-27T07:00:00.000Z";
event.when.append(gdata.calendar.When(start_time=start_time,
end_time=end_time))
new_event = gd_client.InsertEvent(event, '/calendar/feeds/default/
private/full')

print 'New single event inserted: %s' % (new_event.id.text,)
print '\tEvent edit URL: %s' % (new_event.GetEditLink().href,)
print '\tEvent HTML URL: %s' % (new_event.GetHtmlLink().href,)

Output when run:

ro...@rossg-workstation:~/Desktop$ python
google_calendar_add_release.py
Logging in...
logged in

Traceback (most recent call last):
  File "google_calendar_add_release.py", line 19, in <module>
    new_event = gd_client.InsertEvent(event, '/calendar/feeds/default/
private/full')
  File "/usr/lib/python2.5/site-packages/gdata/calendar/service.py",
line 149, in InsertEvent
    converter=gdata.calendar.CalendarEventEntryFromString)
  File "/usr/lib/python2.5/site-packages/gdata/service.py", line 1136,
in Post
    media_source=media_source, converter=converter)
  File "/usr/lib/python2.5/site-packages/gdata/service.py", line 1245,
in PostOrPut
    redirects_remaining - 1, media_source, converter=converter)
  File "/usr/lib/python2.5/site-packages/gdata/service.py", line 1256,
in PostOrPut
    'reason': server_response.reason, 'body': result_body}
gdata.service.RequestError: {'status': 400, 'body': '[Line 2, Column
164, element ns0:entry] Invalid text content type: &#39;Release
3.0.10&#39;', 'reason': 'Bad Request'}



I was able to add the first 9 release dates to a new calender manually
using the main Google Calendar UI, but then (after stopping to share
the new calendar with two colleagues), it stopped letting me add new
releases - it would appear to have added them, but I could not update
the new entries with the UI and on reloading the UI any newly added
events had disappeared. So I resorted to writing this GData test
script to see what the problem is.

However, there doesn't seem to be much info out there on the possible
causes of the error 'Invalid text content type' :( I'd appreciate any
advice as to what I might be doing wrong.

Thanks,

--
Ross

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to