Difference between revisions of "Rackspace Mailbox (Rest API)"
(→Index) |
(→Show) |
||
Line 78: | Line 78: | ||
''Remarks'': | ''Remarks'': | ||
− | The show operation only supports the GET HTTP verb. For .xml format refer to the following schema document: [http://api.emailsrvr.com | + | The show operation only supports the GET HTTP verb. For .xml format refer to the following schema document: [http://api.emailsrvr.com/Schemas/RSMailbox.xsd RSMailbox.xsd] |
Revision as of 07:20, 25 July 2013
Contents
Index
URL:
[GET] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /rs/mailboxes
Description:
Shows a list of mailboxes under the domain
Filter/Search:
Mailbox searches may be filtered by the 'enabled' flag using query methods ?enabled=true and ?enabled=false.
Remarks:
The show operation only supports the GET HTTP verb. For .xml format refer to the following schema document: RSMailboxList.xsd
Example:
get '/customers/12345678/domains/example.com/rs/mailboxes', 'text/xml'
XML Result Example:
<?xml version="1.0" encoding="utf-8"?> <rsMailboxList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:rsMailboxList"> <offset>0</offset> <size>50</size> <total>2</total> <rsMailboxes> <rsMailbox> <name>apirsmailbox37</name> </rsMailbox> <rsMailbox> <name>apirsmailbox91</name> </rsMailbox> </rsMailboxes> </rsMailboxList>
Json Result Example:
{"offset":0,"size":50,"total":2,"rsMailboxes":[{"name":"apirsmailbox37"},{"name":"apirsmailbox91"}]}
Custom Fields:
The result displays each mailbox's 'name' and 'displayName' as default. There is a query string 'fields' that allows the result to display more mailbox properties. The additional properties are: 'size', 'currentUsage', 'enabled', 'createdDate', and 'lastLogin'
Example:
get '/customers/12345678/domains/example.com/rs/mailboxes?fields=size,currentUsage', 'text/xml'
Show
URL:
[GET] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /rs/mailboxes/(mailbox name)
Description:
The show operation will return detailed information about the specified mailbox.
Remarks:
The show operation only supports the GET HTTP verb. For .xml format refer to the following schema document: RSMailbox.xsd
Example:
get '/customers/12345678/domains/example.com/rs/mailboxes/alex.smith', 'text/xml'
XML Result Example:
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <rsMailbox xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:rsMailbox"> <name>apirsmailbox37</name> <size>10240</size> <currentUsage>1024</currentUsage> <vacationMessage>My Test Vacation Message</vacationMessage> <enableVacationMessage>true</enableVacationMessage> <emailForwardingAddressList> <emailAddress>notreal0@apidomain.net</emailAddress> <emailAddress>notreal1@apidomain.net</emailAddress> </emailForwardingAddressList> <saveForwardedEmail>false</saveForwardedEmail> <lastLogin>2/12/2009 1:00:00 AM</lastLogin> <createdDate>4/10/2006 7:47:34 PM</createdDate> <visibleInRackspaceEmailCompanyDirectory>false</visibleInRackspaceEmailCompanyDirectory> <visibleInExchangeGAL>false</visibleInExchangeGAL> <contactInfo> <lastName>Testlast</lastName> <firstName>Jayfirst</firstName> <generationQualifier>Jr</generationQualifier> <initials>A</initials> <organizationUnit>IT</organizationUnit> <businessStreet>123 Biz St</businessStreet> <businessCity>Blacksburg</businessCity> <businessState>VA</businessState> <businessPostalCode>24060</businessPostalCode> <businessCountry>USA</businessCountry> <homeStreet>456 Home St</homeStreet> <homeCity>Charlotte</homeCity> <homeState>NC</homeState> <homePostalCode>28210</homePostalCode> <homeCountry>USA</homeCountry> <businessNumber>555.123.0001</businessNumber> <homeNumber>555.123.0003</homeNumber> <mobileNumber>555.123.0004</mobileNumber> <faxNumber>555.123.0005</faxNumber> <homeFaxNumber>555.123.0006</homeFaxNumber> <pagerNumber>555.123.0002</pagerNumber> <notes>This is my note about my mailbox.</notes> <title>My Title</title> <userID>J.Test</userID> <customID>0123456789</customID> <organizationalStatus>OrgStatus</organizationalStatus> <employeeType>Full-Time</employeeType> </contactInfo> <enabled>true</enabled> </rsMailbox>
Json Result Example:
{"emailForwardingAddressList":["test@resellerallservices.net"],"enableVacationMessage":true,"enabled":true,"contactInfo":{"businessNumber":"555.123.0001" ,"faxNumber":"555.123.0005" ,"firstName":"Jimmy" ,"homeNumber":"555.123.0003" ,"lastName":"TestLaste" ,"mobileNumber":"555.123.0004" ,"notes":"This is my note about my mailbox." ,"pagerNumber":"555.123.0002" ,"businessCity":"" ,"businessCountry":"" ,"businessPostalCode":"" ,"businessState":"" ,"businessStreet":"" ,"employeeType":"DoesNotExist" ,"generationQualifier":"Jr" ,"homeCity":"" ,"homeCountry":"" ,"homeFaxNumber":"555.123.0006" ,"homePostalCode":"" ,"homeState":"" ,"homeStreet":"" ,"initials":"A" ,"organizationUnit":"IT" ,"organizationalStatus":"gainfully employed" ,"title":"My Title" ,"userID":"J.Test", "customID":"0123456789"},"name":"unittestexist" ,"saveForwardedEmail":false,"size":10240,"vacationMessage":"Test Vacation Message", "createdDate":"4\/10\/2006 7:47:34 PM", "currentUsage":1024, "visibleInExchangeGAL":false, "visibleInRackspaceEmailCompanyDirectory":false}
Add/Edit
URL:
Add: [POST] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /rs/mailboxes/(mailbox name) Edit: [PUT] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /rs/mailboxes/(mailbox name)
Description:
Adds/Edits a Rackspace Email mailbox using the following form fields.
Field Name | Data Type | Description |
---|---|---|
password | string | Password (Required for Add) |
size | positive integer | Mailbox size in megabytes (Required for Add) |
enableVacationMessage | boolean | indicates whether vacation message has been enabled |
vacationMessage | string | A mailbox's vacation message |
emailForwardingAddresses | string | A comma delimited list, Maximum 15 addresses, 4 of which can be outside of this domain |
saveForwardedEmail | string | Indicates whether to save a copy of any forwarded email |
lastName | string | A last name |
firstName | string | A first name |
generationQualifier | string | A person's generation (ex. Jr., Sr., III) |
initials | string | A person's middle initial |
organizationUnit | string | A person's organization unit (ex. Marketing) |
businessNumber | string | Business phone number |
pagerNumber | string | Pager phone number |
homeNumber | string | Home phone number |
mobileNumber | string | Mobile phone number |
faxNumber | string | Fax phone number |
homeFaxNumber | string | Home Fax phone number |
businessStreet | string | The business street address for a contact |
businessCity | string | The business city for a contact |
businessState | string | The business state for a contact |
businessPostalCode | string | The business postal code/zip code for a contact |
businessCountry | string | The business country for a contact |
homeStreet | string | The home street address for a contact |
homeCity | string | The home city for a contact |
homeState | string | The home state for a contact |
homePostalCode | string | The home postal code/zip code for a contact |
homeCountry | string | The home country for a contact |
notes | string | Any notes for the mailbox |
title | string | A contact's title |
userID | string | A user ID for a contact |
organizationalStatus | string | A contact's organization status |
employeeType | string | A contact's employee type |
customID | string | A custom field that can be used to tie user mailboxes to external user systems |
enabled | boolean | Status of the mailbox: true = enabled, false = disabled. |
visibleInRackspaceEmailCompanyDirectory | boolean | Flag indicating whether the mailbox is visible in the company directory |
visibleInExchangeGAL | boolean | Flag indicating whether the mailbox is visible in the Exchange Global Address List |
currentUsage (read only) | positive integer | Current space used in mailbox (in MB) |
createdDate (read only) | string | Date of mailbox creation, EST Time (in string format) |
lastLogin (read only) | string | Date of last login, EST Time (in string format) |
Example:
post '/customers/12345678/domains/example.com/rs/mailboxes/alex.smith', 'text/xml', { 'password' => 'Secret13!@#', 'size' => '2048', 'enableVacationMessage' => 'true', 'vacationMessage' => 'My Vacation Message', 'emailForwardingAddresses' => 'sampletest@example.com,sampletest2@example.com', 'saveForwardedEmail' => 'false' 'lastName' => 'Testlastname', 'firstName' => 'Jay', 'generationQualifier' => 'III', 'initials' => 'A', 'organizationUnit' => 'IT', 'businessStreet' => '123 Biz St.', 'businessCity' => 'Blacksburg', 'businessState' => 'VA', 'businessPostalCode' => '24060', 'businessCountry' => 'USA', 'homeStreet' => '456 Home St.', 'homeCity' => 'Charlotte', 'homeState' => 'NC', 'homePostalCode' => '28210', 'homeCountry' => 'USA', 'notes' => 'This is my note about my mailbox.', 'title' => 'My Title', 'userID' => 'J.Test', 'customID' => '0123456789', 'organizationalStatus' => 'OrgStatus', 'employeeType' => 'Full-Time' 'visibleInExchangeGAL'=>'true', 'visibleInRackspaceEmailCompanyDirectory' => 'false' }
Delete
URL:
[DELETE] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /rs/mailboxes/(mailbox name)
Description:
Deletes the mailbox.
Remarks:
The mailbox and mailbox contents are deleted permanently.
Example:
delete '/customers/12345678/domains/example.com/rs/mailboxes/alex.smith', 'text/xml'
Create Login Tokens
URL:
[POST] https://api.emailsrvr.com/customers/(customer account number)/domains/(domain)/rs/mailboxes/(mailbox)/loginToken
Description:
Generate a login Token which can be used to log in to a user's mailbox. The POST will return a loginToken, created date, and expiration date.
Example:
post '/customers/460896/domains/testapidomain.net/rs/mailboxes/testmailbox/loginToken', {}, 'text/xml'
Create a login Token for testmailbox@testapidomain.net
<?xml version="1.0" encoding="utf-8"?> <rsMailboxLoginToken xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:rsMailboxLoginToken"> <token>5b5e27419a363fc5b65bbb63d1c2d3f8</token> <dateCreated>9/22/2010 9:33:15 AM</dateCreated> <expirationDate>9/22/2010 9:53:14 AM</expirationDate> </rsMailboxLoginToken>
The login token is valid until the current time (EST) passes the expiration date, and can be used until that point.
Using the above created login token a user can SSO into testmailbox@testapidomain.net using the following URL:
https://{webmail address}/mail/src/redirect.php?user_name={testmailbox@testapidomain.net}&emailaddress=testmailbox@testapidomain.net&sessionID=5b5e27419a363fc5b65bbb63d1c2d3f8
Alternatively, http can be used if SSL is not desired.