PROBLEM
How do I use the WebMail Client contact API?
ENVIRONMENT
- On-Premise Server + WebMail Installations: Version 6.0 > Current Version
- Webmail Only Installations: Version 6.0 > Current Version
CAUSE
WebMail Client contact API requirement.
RESOLUTION
Resource URI
http://domain.com/index.php/api/group/list
Input Parameters
None
HTTP GET
Returns a JSON encoded string containing the details of contact group array.
Example
http://domain.com/index.php/api/group/list
Returned JSON
[ {"GroupName":"All","id":0}, {"GroupName":"Global","id":"-1"}, {"GroupName":"Shared","id":"-2"}, {"GroupName":"Remembered","id":"-3"}, {"GroupName":"Favourites","id":"-4"} ]
List Contacts
This API can be used as fetching all the contacts of a specific group in a user account.
Resource URI
http://domain.com/index.php/api/contact/list
Input Parameters
Property | Description |
---|---|
GroupID | The group id |
format | Should be set to 'json' here |
HTTP GET
Returns a JSON encoded string containing the contact array.
Example
http://domain.com/index.php/api/contact/list
Returned JSON
[ { "contactId" : "3", "UserEmail" : "james@iinet.net.au", "UserEmail2" : null, "UserEmail3" : null, "UserEmail4" : null, "UserEmail5" : null, "UserFirstName" : "", "UserMiddleName" : "", "UserLastName" : "", "UserTitle" : "", "UserGender" : null, "UserDOB" : null, "UserHomeAddress": "", "UserHomeCity" : "", "UserHomeState" : "", "UserHomeZip" : "", "UserHomeCountry": "", "UserHomePhone" : "", "UserHomeMobile" : "", "UserHomeFax" : "", "UserURL" : "", "UserWorkCompany": "", "UserWorkTitle" : "", "UserWorkDept" : "", "UserWorkOffice" : null, "UserWorkAddress": "", "UserWorkCity" : "", "UserWorkState" : "", "UserWorkZip" : "", "UserWorkCountry": "", "UserWorkPhone" : "", "UserWorkMobile" : "", "UserWorkFax" : "", "UserType" : null, "UserInfo" : "", "Account" : "james@iinet.net.au", "id" : "3", "DateAdded" : "2012-09-21 04:03:51", "DateModified" : "41172.752674", "EntryID" : null, "UserPhoto" : null, "UserFileAs" : null, "Global" : "1", "Shared" : "0", "Favourite" : null, "UsageCount" : "0", "VCardData" : null, "CardDAVUrl" : null, "gid" : null, "isMyProfile" : "1" }, ... ]
Add New Contact
This API can be used for adding new contact.
Resource URI
http://domain.com/index.php/api/contact/update
Input Parameters
Properties | Description |
---|---|
Favourite | Favourite Flag, 0-no, 1-yes |
UserDOB | Date of Birth, yyyy-mm-dd format |
UserEmail | Main Email |
UserEmail2 | Email 2 |
UserEmail3 | Email 3 |
UserEmail4 | Email 4 |
UserEmail5 | Email 5 |
UserFirstName | First name |
UserLastName | Last name |
UserHomeAddress | Home Address |
UserHomeCity | City of Home Address |
UserHomeState | State of Home Address |
UserHomeCountry | Country of Home Address |
UserHomeZip | Postcode of Home Address |
UserHomeFax | Home fax |
UserHomeMobile | Home mobile |
UserHomePhone | Home phone |
UserMiddleName | Middle name |
UserURL | Url, i.e. personal website |
UserWorkCompany | Company |
UserWorkDept | Department |
UserWorkFax | Work fax |
UserWorkMobile | Work mobile |
UserWorkPhone | Work phone |
UserWorkTitle | Work title |
groupId | Group id |
HTTP POST
Returns a JSON encoded string containing the details of contact with contact id.
Example
http://domain.com/index.php/api/contact/update { "UserEmail" : "john@atmail.com", "UserEmail2" : "john@domain.com", "UserEmail3" : "", "UserEmail4" : "", "UserEmail5" : "", "UserFirstName" : "John", "UserMiddleName" : "", "UserLastName" : "Rucell", "UserTitle" : null, "UserGender" : null, "UserDOB" : "1980-12-25", "UserHomeAddress": "224 David Low Way", "UserHomeCity" : " Peregian Beach", "UserHomeState" : "QLD", "UserHomeZip" : "4573", "UserHomeCountry": "Australia", "UserHomePhone" : "0405336999", "UserHomeMobile" : "0405336999", "UserHomeFax" : "0405336999", "UserURL" : "www.atmail.com", "UserWorkCompany": "Atmail Pty Ltd", "UserWorkTitle" : "Team Leader", "UserWorkDept" : "Sales", "UserWorkOffice" : null, "UserWorkAddress": null, "UserWorkCity" : null, "UserWorkState" : null, "UserWorkZip" : null, "UserWorkCountry": null, "UserWorkPhone" : "0405336999", "UserWorkMobile" : "0405336999", "UserWorkFax" : "0405336999", "Favourite" : "0" }
Returned JSON
{ "contactId" : "7", "UserEmail" : "john@atmail.com", "UserEmail2" : "john@domain.com", "UserEmail3" : "", "UserEmail4" : "", "UserEmail5" : "", "UserFirstName" : "John", "UserMiddleName" : "", "UserLastName" : "Rucell", "UserTitle" : null, "UserGender" : null, "UserDOB" : "1980-12-25 00:00:00", "UserHomeAddress": "224 David Low Way", "UserHomeCity" : " Peregian Beach", "UserHomeState" : "QLD", "UserHomeZip" : "4573", "UserHomeCountry": "Australia", "UserHomePhone" : "0405336999", "UserHomeMobile" : "0405336999", "UserHomeFax" : "0405336999", "UserURL" : "www.atmail.com", "UserWorkCompany": "Atmail Pty Ltd", "UserWorkTitle" : "Team Leader", "UserWorkDept" : "Sales", "UserWorkOffice" : null, "UserWorkAddress": null, "UserWorkCity" : null, "UserWorkState" : null, "UserWorkZip" : null, "UserWorkCountry": null, "UserWorkPhone" : "0405336999", "UserWorkMobile" : "0405336999", "UserWorkFax" : "0405336999", "UserType" : null, "UserInfo" : null, "Account" : "james@iinet.net.au", "id" : "7", "DateAdded" : "2012-09-23 05:38:29", "DateModified" : "41174.818391", "EntryID" : null, "UserPhoto" : null, "UserFileAs" : null, "Global" : "0", "Shared" : "0", "Favourite" : "0", "UsageCount" : "0", "VCardData" : null, "CardDAVUrl" : null }
Update Contact
This API can be used for modify/update contact
Resource URI
http://domain.com/index.php/api/contact/update
Input Parameters
Properties | Description |
---|---|
contactId | The contact id |
Favourite | Favourite Flag, 0-no, 1-yes |
UserDOB | Date of Birth, yyyy-mm-dd fromat |
UserEmail | Main Email |
UserEmail2 | Email 2 |
UserEmail3 | Email 3 |
UserEmail4 | Email 4 |
UserEmail5 | Email 5 |
UserFirstName | First name |
UserLastName | Last name |
UserHomeAddress | Home Address |
UserHomeCity | City of Home Address |
UserHomeState | State of Home Address |
UserHomeCountry | Country of Home Address |
UserHomeZip | Postcode of Home Address |
UserHomeFax | Home fax |
UserHomeMobile | Home mobile |
UserHomePhone | Home phone |
UserMiddleName | Middle name |
UserURL | Url, i.e. personal website |
UserWorkCompany | Company |
UserWorkDept | Department |
UserWorkFax | Work fax |
UserWorkMobile | Work mobile |
UserWorkPhone | Work phone |
UserWorkTitle | Work title |
groupId | Group id |
HTTP POST
Returns a JSON encoded string containing the details of contact with contact id.
Example
http://domain.com/index.php/api/contact/update { "contactId" : "7", "UserEmail" : "john@atmail.com", "UserEmail2" : "john@domain.com", "UserEmail3" : "", "UserEmail4" : "", "UserEmail5" : "", "UserFirstName" : "John", "UserMiddleName" : "", "UserLastName" : "Rucell", "UserTitle" : null, "UserGender" : null, "UserDOB" : "1980-12-25", "UserHomeAddress": "224 David Low Way", "UserHomeCity" : " Peregian Beach", "UserHomeState" : "QLD", "UserHomeZip" : "4573", "UserHomeCountry": "Australia", "UserHomePhone" : "0405336999", "UserHomeMobile" : "0405336999", "UserHomeFax" : "0405336999", "UserURL" : "www.atmail.com", "UserWorkCompany": "Atmail Pty Ltd", "UserWorkTitle" : "Team Leader", "UserWorkDept" : "Sales", "UserWorkOffice" : null, "UserWorkAddress": null, "UserWorkCity" : null, "UserWorkState" : null, "UserWorkZip" : null, "UserWorkCountry": null, "UserWorkPhone" : "0405336999", "UserWorkMobile" : "0405336999", "UserWorkFax" : "0405336999", "Favourite" : "0" }
Returned JSON
{ "contactId" : "7", "UserEmail" : "john@atmail.com", "UserEmail2" : "john@domain.com", "UserEmail3" : "", "UserEmail4" : "", "UserEmail5" : "", "UserFirstName" : "John", "UserMiddleName" : "", "UserLastName" : "Rucell", "UserTitle" : null, "UserGender" : null, "UserDOB" : "1980-12-25 00:00:00", "UserHomeAddress": "224 David Low Way", "UserHomeCity" : " Peregian Beach", "UserHomeState" : "QLD", "UserHomeZip" : "4573", "UserHomeCountry": "Australia", "UserHomePhone" : "0405336999", "UserHomeMobile" : "0405336999", "UserHomeFax" : "0405336999", "UserURL" : "www.atmail.com", "UserWorkCompany": "Atmail Pty Ltd", "UserWorkTitle" : "Team Leader", "UserWorkDept" : "Sales", "UserWorkOffice" : null, "UserWorkAddress": null, "UserWorkCity" : null, "UserWorkState" : null, "UserWorkZip" : null, "UserWorkCountry": null, "UserWorkPhone" : "0405336999", "UserWorkMobile" : "0405336999", "UserWorkFax" : "0405336999", "UserType" : null, "UserInfo" : null, "Account" : "james@iinet.net.au", "id" : "7", "DateAdded" : "2012-09-23 05:38:29", "DateModified" : "41174.818391", "EntryID" : null, "UserPhoto" : null, "UserFileAs" : null, "Global" : "0", "Shared" : "0", "Favourite" : "0", "UsageCount" : "0", "VCardData" : null, "CardDAVUrl" : null }
Delete Contact
This API can be used deleting a contact.
Resource URI
http://domain.com/index.php/api/contact/delete
Input Parameters
Property | Description |
---|---|
GroupID | The group id |
id | The contact id or array of id |
HTTP GET
Returns a JSON encoded string containing the execution result.
Example
http://domain.com/index.php/api/contact/delete { GroupId : 0, id : 7 }
Returned JSON
{"result":"success"}
Comments