PROBLEM
How do I use the WebMail Client calendar API?
ENVIRONMENT
- On-Premise Server + WebMail Installations: Version 6.0 > Current Version
- Webmail Only Installations: Version 6.0 > Current Version
CAUSE
WebMail Client API requirement.
RESOLUTION
List Calendars
This API can be used to fetch all the calendars in a user account.
Resource URI
http://domain.com/index.php/mail/calendar/caldavglue
Input Parameters
Property | Description |
---|---|
func | Should be set to 'calname' |
ajax | Should be set to '1' |
json | Should be set to '1' |
appmode | Should be set to 'Private' |
HTTP GET
Returns a JSON encoded string containing the details of the events in the calendar at the top of the list that will occur in the future.
Example
http://domain.com/index.php/api/mail/calendar/caldavglue { ajax : 1, appmode : 'Private', func : 'calname', json : 1 }
Returned JSON
[ { "relative_href":"\/calendars\/james%40atmail.com\/calendar\/", "href":"\/calendars\/james%40atmail.com\/calendar\/", "ctag":"1", "displayname":"Private", "description":"", "principal_url":"\/principals\/users\/james@atmail.com", "mode":"write", "shared":false, "home":true, "etag":null, "server":"\/calendars\/james%40atmail.com\/calendar\/", "calendar_owner":"james@atmail.com", "color":"#0002BF", "order":"0" }, ... ]
List Events
This API can be used as fetching all the events of one calendar in a user account.
Resource URI
http://domain.com/index.php/mail/calendar/caldavglue
Input Parameters
Property | Description |
---|---|
func | Should be set to 'ajaxcal' |
appmode | Should be set to 'Private' |
ajax | Should be set to '1' |
json | Should be set to '1' |
extended | Should be set to 'true' |
calendarhref | The calendar href, which should be the returned value from API List Calendars |
start | Unix GMT time from which the event be fetched |
HTTP GET
Returns a JSON encoded string containing the details of the events in the calendar.
Example
http://domain.com/index.php/mail/calendar/caldavglue { ajax : 1, appmode : 'Private', func : 'ajaxcal', json : 1, extended : true, calendarhref : '/calendars/james%40atmail.com/calendar/', start : 1349307801 }
Returned JSON
[ { "id" :"fbd26141-1099-441d-a74b-11441e032e60", "title" :"Game night", "Location" :"Peregian Office", "CalMessage":"Welcome all staff", "start" :"2012-10-05T18:00:00", "end" :"2012-10-05T21:30:00", "user" :"james@atmail.com", "color" :"#0002BF", "relative_href":"\/calendars\/james%40atmail.com\/calendar\/", "allDay" :false }, ... ]
Add New Event
This API can be used for adding new events in the selected calendar.
Resource URI
http://domain.com/index.php/mail/calendar/caldavglue
Input Parameters
Property | Description |
---|---|
func | Should be set to 'add' |
appmode | Should be 'Private' |
ajax | Should be set to '1' |
json | Should be set to '1' |
calendarhref | The calendar href, which should be the returned value from API List Calendars |
Msg_Title | The title of the event |
Msg_Text | The note of the event |
Msg_Type | Should be set to 'General' |
startDate | Start Date and Time of the event, must be convert to Unix GMT time format |
endDate | End Date and Time of the event, must be convert to Unix GMT time format |
Location | Location of the event |
HTTP GET
Returns a JSON encoded string containing the details of the events in the calendar.
Example
http://domain.com/index.php/mail/calendar/caldavglue { Location : 'Peregian Office', Msg_Text : 'Welcome all staff', Msg_Title : 'Game night', Msg_Type : 'General', ajax : 1, appmode : 'Private', endDate : 1349472600, func : 'add', json : 1, relative_href : '/calendars/james%40atmail.com/calendar/', startDate : 1349460000 }
Returned JSON
{"id":"fbd26141-1099-441d-a74b-11441e032e60","status":201}
Update Event
This API can be used for update/modify event in the selected calendar.
Resource URI
http://domain.com/index.php/mail/calendar/caldavglue
Input Parameters
Property | Description |
---|---|
func | Should be set to 'updatecal' |
appmode | Should be 'Private' |
ajax | Should be set to '1' |
json | Should be set to '1' |
relative_href | The calendar href, which should be the returned value from API List Calendars |
Category | Should be set to 'General' |
Title | The title of the event |
CalMessage | The note of the event |
DateStart | Start Date and Time of the event, must be convert to Unix GMT time format |
DateEnd | End Date and Time of the event, must be convert to Unix GMT time format |
Location | Location of the event |
id | The event id |
HTTP GET
Returns a JSON encoded string containing the details of the events in the calendar.
Example
http://domain.com/index.php/mail/calendar/caldavglue { CalMessage : 'Welcome all staff', Category : 'General', DateEnd : 1349472600, DateStart : 1349460000, Location : 'Peregian Office', Title : 'Game night', ajax : 1, appmode : 'Private', func : 'updatecal', id : 'fbd26141-1099-441d-a74b-11441e032e60', json : 1, relative_href : '/calendars/james%40atmail.com/calendar/' }
Returned JSON
{"id":"fbd26141-1099-441d-a74b-11441e032e60","status":200}
Delete Event
This API can be used for deleting an event in a user account.
Resource URI
http://domain.com/index.php/mail/calendar/caldavglue
Input Parameters
Property | Description |
---|---|
func | Should be set to 'delete' |
ajax | Should be set to '1' |
json | Should be set to '1' |
appmode | Should be set to 'Private' |
id | The event id |
relative_hre | The calendar href, which should be the returned value from API List Calendars |
HTTP GET
Returns a JSON encoded string showing if the event has been deleted.
Example
http://domain.com/index.php/mail/calendar/caldavglue { ajax : 1, appmode : 'Private', func : 'delete', json : 1, relative_href : '/calendars/james%40atmail.com/calendar/', id : 'fbd26141-1099-441d-a74b-11441e032e60' }
Returned JSON
{"id":"fbd26141-1099-441d-a74b-11441e032e60","status":null}
Comments