I am using google calendar api to export an event to google calendar, when the users logins to my web app he creates an event and exports the same event to google calendar, this a basic requirement. I have used this code for the authentication
<body>
<div id="panel"></div>
<script type="text/javascript">
var myService;
google.load("gdata", "1");
google.setOnLoadCallback(getMyFeed);
function logMeIn() {
scope = "http://www.google.com/calendar/feeds";
var token = google.accounts.user.login(scope);
}
function setupMyService() {
myService = new google.gdata.calendar.CalendarService('GoCalender');
logMeIn();
}
function handleMyFeed(myResultsFeedRoot) {
alert("This feed's title is: " + myResultsFeedRoot.feed.getTitle().getText());
}
function handleError(e) {
alert("There was an error!"+ e.cause ? e.cause.statusText : e.message);
}
function getMyFeed() {
setupMyService();
var feedUrl = "https://www.google.com/calendar/feeds/[email protected]/private/full";
myService.getEventsFeed(feedUrl, handleMyFeed, handleError);
}
</script>
<img src="google-app-engine1.png" style="postion:absoulute; width:50px"></img>
though I have not specified the create single event code here, I am not to auth user to there google accounts. The google server is giving a error which says --
"The page you have requested cannot be displayed. Another site was requesting access to your Google Account, but sent a malformed request. Please contact the site that you were trying to use when you received this message to inform them of the error. A detailed error message follows:
The "next" parameter was bad or missing."
What is the problem kindly help me to get the solution for this. I am a novice to google apis.
Are you running this from a url beginning with file:// ? If so it will not work, you need a local web server so the urls begin something like http://localhost/, read up on installing one. If you already have a web server, make sure the path/url to your file does not contain spaces or other characters that need encoding - I've found this can also cause problems.