<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://api-wiki.apps.rackspace.com/api-wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Subir.jolly&amp;*</id>
		<title>Rackspace Email &amp; Apps API - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://api-wiki.apps.rackspace.com/api-wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Subir.jolly&amp;*"/>
		<link rel="alternate" type="text/html" href="http://api-wiki.apps.rackspace.com/api-wiki/index.php?title=Special:Contributions/Subir.jolly"/>
		<updated>2026-04-21T09:34:29Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.29.1</generator>

	<entry>
		<id>http://api-wiki.apps.rackspace.com/api-wiki/index.php?title=Main_Page&amp;diff=451</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://api-wiki.apps.rackspace.com/api-wiki/index.php?title=Main_Page&amp;diff=451"/>
				<updated>2011-08-11T17:01:19Z</updated>
		
		<summary type="html">&lt;p&gt;Subir.jolly: /* Recent Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The The Rackspace Email Rest API provides most of the functions of the Control Panel through a REST-based [http://en.wikipedia.org/wiki/Web_service web API]. Whether it is adding a new customer account, adding mailboxes, or any other of the supported features the API allows your application to administer the changes regardless of your application's language or nature. For more information on RESTful web services refer to the following sites:&lt;br /&gt;
&lt;br /&gt;
[http://www.peej.co.uk/articles/restfully-delicious.html Paul James's Homepage: A RESTful Web service, an example]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Representational_State_Transfer#External_links Wikipedia: Representational State Transfer - External Links]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The API is accessible to all with access to Control Panel, including resellers, business customers, enterprise customers, and indirect customers. However, not all operations are available to non-resellers. See the [[Rest_API#Operations|Operations]] section for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Rackspace Email Soap API Homepage has been moved to [[Soap_API| here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recent Changes ==&lt;br /&gt;
'''08/11/11'''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Bulk operations for Alias resource. [http://api-wiki.apps.rackspace.com/api-wiki/index.php/Rackspace_Alias%28Rest_API%29#Bulk_Modify_Alias_List Click here] for more details.&lt;br /&gt;
* Returning fault in response body on errors instead of plain text description. [http://api-wiki.apps.rackspace.com/api-wiki/index.php/Main_Page#Errors Click here] for more details.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''10/31/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Rackspace Mailbox indexes now support custom fields.&lt;br /&gt;
* A Login Token may now be generated for Rackspace Mailboxes.&lt;br /&gt;
* Users can set Rackspace Mailbox storage notification settings. See [[Rackspace_Storage_Notification_(Rest_API)| here]] for more details.&lt;br /&gt;
* Users can now manage admins. See [[Admin_(Rest_API)| here]] for more details.&lt;br /&gt;
* Added Email Everyone to Domain operations. See [[Domain_(Rest_API)#Domain_Email_Everyone | here]] for more details.&lt;br /&gt;
* Added Show/Edit Catch-All Address to Domain operations. See [[Domain_(Rest_API)#Show_Domain_Catch-All_Address | here]] for more details.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''09/01/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Now Rackspace Email Mailbox can be marked as visible in Exchange Global Address List. &lt;br /&gt;
* Exchange Mailbox can be marked as visible in Rackspace Email Company Directory.&lt;br /&gt;
* Rackspace Email/Exchange Mailbox last login time.&lt;br /&gt;
* Filter Rackspace Email/Exchange Mailbox by &amp;quot;Enabled&amp;quot; flag.&lt;br /&gt;
* Resellers now can create Login Token that only can be used to log into sub-account Control Panel. See [[Customer_(Rest_API)#Create_Login_Tokens| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''08/01/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added Rackspace Email Mailbox Contact info. See [[Rackspace_Mailbox_(Rest_API)| here]].&lt;br /&gt;
* Added Create Login Token. See [[Customer_(Rest_API)#Create_Login_Tokens| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''06/20/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added [[Rackspace_Alias(Rest_API)| Rackspace Email Alias]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''06/11/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added Rackspace Email Mailbox Spam Settings/Blacklist/Safelist. See [[Rackspace_Mailbox_Spam_(Rest_API)| here]].&lt;br /&gt;
* Now Rackspace Email Mailbox can Show/Edit vacation message and email forwarding address. See [[Rackspace_Mailbox_(Rest_API)| here]].&lt;br /&gt;
* Added SharePoint Service Settings. See [[SharePoint_(Rest_API)| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''05/16/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added shortened URLs. Any URLs that starts with '/customers/me/domains/~' is equivalent to '/domains/~'.&lt;br /&gt;
* Added Rackspace Email Mailbox Add/Edit/Delete/Index. See [[Rackspace_Mailbox_(Rest_API)| here]].&lt;br /&gt;
* Allows to customize Exchange mailbox list result. See [[Exchange_Mailbox_(Rest_API)#Index| Exchange Mailbox Index]] action 'Custom Fields' section.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Changes:&lt;br /&gt;
* Server throttling section has been updated. See [[Rest_API#Throttling| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Bug fix:&lt;br /&gt;
* Fixed a bug that request without User-Agent Header gets 500 error. Now it gets &amp;quot;Authentication failed&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''03/28/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Rest API can be accessed by Business Users. However, not all operations are available.&lt;br /&gt;
* Domain Public Folders can be enabled now.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Deprecated:&lt;br /&gt;
* Good Mobile Service is no longer supported.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''03/14/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Index/Add/Edit/Delete Mailbox Permissions.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Known Issues:&lt;br /&gt;
* Domain public folders can't be enabled using Rest API at this moment. The next release (on 03/21/2010) will fix this problem.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
The following pages detail the operations that the API supports. The operations are grouped into sections based on the entity/object types that each operation interacts with. Non-resellers do not have access to all functions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Resource&lt;br /&gt;
!Example URI&lt;br /&gt;
!Business User Access&lt;br /&gt;
|-&lt;br /&gt;
| [[Customer_(Rest_API)| Customer]]&lt;br /&gt;
| /customers/123456789&lt;br /&gt;
| [[Customer_(Rest_API)#Create_Login_Tokens | Create Login Tokens]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Admin_(Rest_API)| Admin]]&lt;br /&gt;
| /customers/123456789/admins/my_admin&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Domain_(Rest_API)| Domain]]&lt;br /&gt;
| /customers/123456789/domains/example.com&lt;br /&gt;
| [[Domain_(Rest_API)#Index| Index]], [[Domain_(Rest_API)#Show| Show]], [[Domain_(Rest_API)#Split Domain Routing| Split Domain Routing]], [[Domain_(Rest_API)#Archiving SSO Login URL| Archiving SSO Login URL]], [[Domain_(Rest_API)#Domain_Public_Folders_.28Reseller_Only.29|Domain Public Folders]], [[Domain_(Rest_API)#Domain Email Everyone| Email Everyone ]], [[Domain_(Rest_API)#Show_Domain_Catch-All_Address | Catch-All Address]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Domain_Spam_(Rest_API)| Domain Spam Settings]]&lt;br /&gt;
| /customers/123456789/domains/example.com/spam/settings&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Mailbox_(Rest_API)|  Rackspace Email Mailbox]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/mailboxes/john.smith&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Mailbox_Spam_(Rest_API)| Rackspace Email Mailbox Spam Settings]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/mailboxes/john.smith/spam&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Storage_Notification_(Rest_API)| Rackspace Storage Notification Settings]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/storageNotification&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Alias(Rest_API)|  Rackspace Email Alias]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/mailboxes/john.smith/alias&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Mailbox_(Rest_API)| Exchange Mailbox]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/mailboxes/john.smith&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Mailbox_Spam_(Rest_API)| Exchange Mailbox Spam Settings]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/mailboxes/john.smith/spam&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Contact_(Rest_API)| Exchange Contact]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/contacts/john.smith&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Distribution_List_(Rest_API)| Exchange Distribution List]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/distributionlists/group.name&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Resource_Mailbox_(Rest_API)| Exchange Resource Mailbox]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/resources/conference.room&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[SharePoint_(Rest_API)| SharePoint]]&lt;br /&gt;
| /customers/123456789/sharepoint/settings&lt;br /&gt;
| [[SharePoint_(Rest_API)#Show | Show]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The examples shown in the operation pages are written in Ruby and extensively use the helper functions shown in the Ruby Examples below.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
&lt;br /&gt;
'''What you need:'''&lt;br /&gt;
* A Rackspace Email and Apps Control Panel admin account&lt;br /&gt;
* A HTTP class library that supports TLS and the HTTP methods: GET, POST, PUT, DELETE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Making your first API call, an Show Customer request:'''&lt;br /&gt;
# Obtain your API keys&lt;br /&gt;
#:* Click on My Account at the top of the [https://apps.rackspace.com/?cp Control Panel web interface]. Under the Administrators heading there will be an link for the API keys page.&lt;br /&gt;
# Set up your client's HTTP request&lt;br /&gt;
#:* Set up your client to make calls to a URL beginning with &amp;lt;nowiki&amp;gt;https://api.emailsrvr.com/v0&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
#:* Populate the Accept, User-Agent and X-Api-Signature HTTP request headers correctly. This is explained in detail [[#HTTP Headers|here]].&lt;br /&gt;
# Make a GET request to /customers/me.&lt;br /&gt;
#:* The complete URI will be &amp;lt;nowiki&amp;gt;https://api.emailsrvr.com/v0/customers/me&amp;lt;/nowiki&amp;gt;. Use your HTTP library to retrieve the HTTP response code, 'x-error-message' HTTP response header and HTTP response body so that they may be displayed to help debug and determine success.&lt;br /&gt;
'''From here:'''&lt;br /&gt;
* Learn about the operations you'll be implementing at the subpages [[#Operations|here]].&lt;br /&gt;
&lt;br /&gt;
== Accessing the API ==&lt;br /&gt;
&lt;br /&gt;
Your application will need to make HTTP requests to remote servers. Most programming languages have this function provided in its class library. In addition to the common GET and POST HTTP methods, the library used will also need to support PUT and DELETE.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Calls without [http://en.wikipedia.org/wiki/Transport_Layer_Security TLS] (formerly SSL) will complete successfully but it is HIGHLY RECOMMENDED that TLS always be used. Interception of unencrypted communication will allow a third party to have complete access to all functions available via the API.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For some language libraries just using an URL with https:// will cause the library to use TLS. In some other libraries however some options specific to the library may have to be configured to utilize TLS. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All API calls should be directed to a URL in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://api.emailsrvr.com/(version)/(resource)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://api.emailsrvr.com/v0/customers/12345678/domains/customerbusiness.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Versions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Supported Versions''&lt;br /&gt;
!''URL''&lt;br /&gt;
!''Version Documentation''&lt;br /&gt;
|-&lt;br /&gt;
| v0 (current)&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;https://api.emailsrvr.com/v0/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| http://signup.apps.rackspace.com/api-wiki/index.php/Rest_API&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The API version number is a component of the URL that is used to access the API. For example, to access the root of the API, the URL is https://api.emailsrvr.com/v0/. Bug fixes and minor non-breaking changes will be made without changing the version number. When major features or breaking changes are introduced, the version number will be incremented. It is not yet determined how many versions are going to be supported at any one time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Non-breaking Changes''&lt;br /&gt;
!''Breaking Changes''&lt;br /&gt;
|-&lt;br /&gt;
| Adding new fields or attributes to form fields sent&lt;br /&gt;
| Changing or deleting any fields in form fields sent&lt;br /&gt;
|-&lt;br /&gt;
| Adding fields in returned data&lt;br /&gt;
| Changing or removing fields in returned data&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Changing the URI of any resource&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
To gain access to the API, your request must include a properly constructed X-Api-Signature HTTP header. Details on what to put in the header are below. To construct the header, you must have the following keys that that are generated from the [https://apps.rackspace.com/?cp Control Panel Web interface]. The key generation page can be found by clicking 'My Account' at the top, then 'Generate API Keys' in the Administrators section.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Key Name&lt;br /&gt;
!Description&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
| User Key&lt;br /&gt;
| A public key that corresponds to your admin id&lt;br /&gt;
| ''eGbq9/2hcZsRlr1JV1Pi''&lt;br /&gt;
|-&lt;br /&gt;
| Secret Key&lt;br /&gt;
| A shared secret key&lt;br /&gt;
| ''QHOvchm/40czXhJ1OxfxK7jDHr3t''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An unsuccessful authentication will result in a 403 HTTP code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== X-Api-Signature Header ====&lt;br /&gt;
&lt;br /&gt;
Format is as follows:&lt;br /&gt;
&amp;lt;'''User Key'''&amp;gt;:&amp;lt;'''Timestamp'''&amp;gt;:&amp;lt;'''SHA1 Hash'''&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Example: ''eGbq9/2hcZsRlr1JV1Pi:20010317143725:46VIwd66mOFGG8IkbgnLlXnfnkU=''&lt;br /&gt;
&lt;br /&gt;
Remember to include the colons between the data strings!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''User Key''':&amp;lt;br&amp;gt;&lt;br /&gt;
This is the public key issued by the Control Panel browser interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Timestamp''':&amp;lt;br&amp;gt;&lt;br /&gt;
The format is YYYYMMDDHHmmss. All values besides year are zero-padded to two spaces. For example, March 08th 2001 at 2:37.25pm would be ''20010308143725''.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|YYYY&lt;br /&gt;
|Four-digit year&lt;br /&gt;
|-&lt;br /&gt;
| MM&lt;br /&gt;
| Month&lt;br /&gt;
|-&lt;br /&gt;
| DD&lt;br /&gt;
| Day&lt;br /&gt;
|-&lt;br /&gt;
| HH&lt;br /&gt;
| Hour in 24h format&lt;br /&gt;
|-&lt;br /&gt;
| mm&lt;br /&gt;
| Minute&lt;br /&gt;
|-&lt;br /&gt;
| ss&lt;br /&gt;
| Second&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''SHA1 Hash''':&lt;br /&gt;
&lt;br /&gt;
A SHA1 (Secure Hash Algorithm) hash must be applied to a string with the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;'''User Key'''&amp;gt;&amp;lt;'''User Agent'''&amp;gt;&amp;lt;'''Timestamp'''&amp;gt;&amp;lt;'''Secret Key'''&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the 'User Agent' must be the exact same as what is specified in the User-Agent HTTP header. Using the above example data, the string before hashing is:&amp;lt;br&amp;gt;''eGbq9/2hcZsRlr1JV1PiRackspace Management Interface20010308143725QHOvchm/40czXhJ1OxfxK7jDHr3t''&lt;br /&gt;
&lt;br /&gt;
Resulting base-64 SHA1 Hash:&amp;lt;br&amp;gt;''46VIwd66mOFGG8IkbgnLlXnfnkU=''&lt;br /&gt;
&lt;br /&gt;
Be sure to encode the binary hash, not the hex hash, into base-64. The resulting string should be 28 characters long.&lt;br /&gt;
&lt;br /&gt;
== Using the API ==&lt;br /&gt;
&lt;br /&gt;
=== Requests ===&lt;br /&gt;
&lt;br /&gt;
HTTP requests should be sent to the server with the correct URL, HTTP method, HTTP headers and form data (if needed). The URL specifies the resource, the HTTP method specifies what operation is done on the resource, and form data is used to specify the details of the resource when the resource is added or edited.&lt;br /&gt;
&lt;br /&gt;
The URLs, corresponding HTTP methods, and necessary form data for the desired operations are detailed in the [[#Operations|operation pages]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you're getting the HTTP status code 417 see [[Handling HTTP code 417:  Expectation failed]]&lt;br /&gt;
&lt;br /&gt;
==== URL ====&lt;br /&gt;
&lt;br /&gt;
The URLs are specifies the resource or resource collection. Objects are organized in a tree collection, starting with customers at the top, then domains, then domain objects next (such as mailboxes, contacts, and distribution lists) and so on. The URLs of the resources and collections accessible are found on the operation pages.&lt;br /&gt;
&lt;br /&gt;
==== HTTP Method ====&lt;br /&gt;
&lt;br /&gt;
It is the HTTP method that specifies what operation will be done on the resource. For example, to get the details of a mailbox a HTTP GET will be done on /customers/12345678/domains/example.com/ex/mailboxes/john.smith. If the mailbox does not exist, a HTTP POST to the same URL with the necessary form data will add the mailbox. Then, a HTTP PUT to the same URL will edit mailbox. And to delete the mailbox, an HTTP DELETE would be used.&lt;br /&gt;
&lt;br /&gt;
The types of operations a certain method performs is outlined below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''HTTP Method''&lt;br /&gt;
!''Operations''&lt;br /&gt;
!''Response''&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2|GET&lt;br /&gt;
|Index - returns a list of the resources&lt;br /&gt;
|rowspan=2|XML or JSON formatted data&lt;br /&gt;
|-&lt;br /&gt;
|Show - returns the details of the resource&lt;br /&gt;
|-&lt;br /&gt;
|POST&lt;br /&gt;
|Add - adds a new resource&lt;br /&gt;
|rowspan=3|Response code and error message (if applicable) only&lt;br /&gt;
|-&lt;br /&gt;
|PUT&lt;br /&gt;
|Edit - changes the details of the resource&lt;br /&gt;
|-&lt;br /&gt;
|DELETE&lt;br /&gt;
|Delete - deletes the resource&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== HTTP Headers ====&lt;br /&gt;
&lt;br /&gt;
All requests to the API must then include HTTP headers with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Header Name''&lt;br /&gt;
!''Description''&lt;br /&gt;
!''Example Header Value''&lt;br /&gt;
|-&lt;br /&gt;
| Accept&lt;br /&gt;
| The requested content type (required for Index and Show actions). Fill this with either 'text/xml' or 'application/json'. See [[#Formats|Response Formats]]&lt;br /&gt;
| ''text/xml''&lt;br /&gt;
|-&lt;br /&gt;
| User-Agent&lt;br /&gt;
| An identifier you choose for your client software&lt;br /&gt;
| ''Rackspace Management Interface''&lt;br /&gt;
|-&lt;br /&gt;
| X-Api-Signature&lt;br /&gt;
| An authentication string explained in detail [[#X-Api-Signature_Header|here]]&lt;br /&gt;
| ''eGbq9/2hcZsRlr1JV1Pi:20010317143725:HKUn0aajpSDx7qqGK3vqzn3FglI=''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Form Data ====&lt;br /&gt;
&lt;br /&gt;
When using Add and Edit operations, the details of the resource are sent to the API server via HTTP form data. Your HTTP library should include methods for sending form data along with an HTTP request. The library should by default send the data in the HTTP request body using the 'application/x-www-form-urlencoded' data format.&lt;br /&gt;
&lt;br /&gt;
==== Index Filter/Search ====&lt;br /&gt;
&lt;br /&gt;
The results of Index actions can be filtered/searched. The index URLs can take either one of the query strings: &amp;quot;?startswith=xx&amp;quot; or &amp;quot;?contains=xx,&amp;quot; where &amp;quot;xx&amp;quot; is the key word. If the request specifies more than one of these two query strings, a 400 HTTP error will be returned. Different fields will be searched depending on the resource type, see below.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;quot;0-9&amp;quot; is a reserved key word for query string &amp;quot;startswith.&amp;quot; It represents any result starting with numbers.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Index Actions''&lt;br /&gt;
!''Where the key word will be searched''&lt;br /&gt;
|-&lt;br /&gt;
| Customer&lt;br /&gt;
| Customer name, account number, reference number&lt;br /&gt;
|-&lt;br /&gt;
| Domain&lt;br /&gt;
| Domain name&lt;br /&gt;
|-&lt;br /&gt;
| Mailbox&lt;br /&gt;
| Mailbox name, mailbox display name&lt;br /&gt;
|-&lt;br /&gt;
| Contact&lt;br /&gt;
| Contact display name, external email&lt;br /&gt;
|-&lt;br /&gt;
| Group&lt;br /&gt;
| Group name, group display name&lt;br /&gt;
|-&lt;br /&gt;
| Mobile Service&lt;br /&gt;
| Associated mailbox name, mailbox display name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Throttling ====&lt;br /&gt;
&lt;br /&gt;
The server limits the number of requests allowed per user in a certain period of time.  The number of requests made are logged per minute. Calls that were made correctly with a user's API key, but not completed for any reason, including those exceeding the throttle limit, are included in this count.&lt;br /&gt;
&lt;br /&gt;
If a user is over the throttling limit then a 403 HTTP code will be returned with an &amp;quot;Exceeded request limits&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Operation Category''&lt;br /&gt;
!''Request Limit''&lt;br /&gt;
|-&lt;br /&gt;
| GET&lt;br /&gt;
| 60 per minute&lt;br /&gt;
|-&lt;br /&gt;
| PUT, POST, DELETE&lt;br /&gt;
| 30 per minute&lt;br /&gt;
|-&lt;br /&gt;
| POST, PUT, DELETE on a domain&lt;br /&gt;
| 2 per minute&lt;br /&gt;
|-&lt;br /&gt;
| POST, DELETE on alternate domains&lt;br /&gt;
| 2 per minute&lt;br /&gt;
|-&lt;br /&gt;
| Enabling public folders for a domain&lt;br /&gt;
| 1 per 5 minutes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Examples ====&lt;br /&gt;
&lt;br /&gt;
Index of Exchange Mailboxes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Hypertext Transfer Protocol&lt;br /&gt;
    GET /v0/customers/12345678/domains/example.com/ex/mailboxes?size=100&amp;amp;offset=100 HTTP/1.1&lt;br /&gt;
    Host: api.emailsrvr.com&lt;br /&gt;
    User-Agent: Rackspace Management Interface&lt;br /&gt;
    X-Api-Signature: eGbq9/2hcZsRlr1JV1Pi:20010317143725:HKUn0aajpSDx7qqGK3vqzn3FglI=&lt;br /&gt;
    Accept: text/xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Adding New Exchange Mailbox:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Hypertext Transfer Protocol&lt;br /&gt;
    POST /v0/customers/12345678/domains/example.com/ex/mailboxes/john.smith HTTP/1.1&lt;br /&gt;
    Host: api.emailsrvr.com&lt;br /&gt;
    User-Agent: Rackspace Management Interface&lt;br /&gt;
    X-Api-Signature: eGbq9/2hcZsRlr1JV1Pi:20010317143725:HKUn0aajpSDx7qqGK3vqzn3FglI=&lt;br /&gt;
    Content-Length: 53&lt;br /&gt;
        [Content length: 53]&lt;br /&gt;
    Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
 &lt;br /&gt;
Line-based text data: application/x-www-form-urlencoded&lt;br /&gt;
    size=2048&amp;amp;displayName=John%20Smith&amp;amp;password=abcABC123&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Responses ===&lt;br /&gt;
&lt;br /&gt;
==== HTTP Status Code ====&lt;br /&gt;
&lt;br /&gt;
On a successfully executed request, a 200 HTTP Code is returned. If the request was unsuccessful however, an HTTP error code in the 400s or 500s will be returned.&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Body ====&lt;br /&gt;
&lt;br /&gt;
If the request is an Index or Show request, the request data will be returned in the format specified in the HTTP Body.&lt;br /&gt;
&lt;br /&gt;
===== Formats =====&lt;br /&gt;
&lt;br /&gt;
Requests for data (index and show requests) are returned with XML or JSON data based on what your application populates the [[#HTTP_Headers|HTTP Accept headers]] with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For XML, populate the header with 'text/xml' (ex: Headers![&amp;quot;Accept&amp;quot;] = &amp;quot;text/xml&amp;quot;). The XML document returned will conform to a published XSD (XML Schema Document). There are many ways to parse the data in an XML document, but we have found that the [http://www.w3schools.com/XPath/default.asp XPath] tree-style traversal has served our purposes. In any case, your application will likely need to use a class library for your chosen method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For JSON, populate the header with 'application/json' (ex: Headers![&amp;quot;Accept&amp;quot;] = &amp;quot;application/json&amp;quot;). As with XML, a library will likely be needed to parse the data.&lt;br /&gt;
&lt;br /&gt;
==== HTTP Headers ====&lt;br /&gt;
&lt;br /&gt;
The only data returned in the header is the error message (if any).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Header Name''&lt;br /&gt;
!''Description''&lt;br /&gt;
!''Example Header Value''&lt;br /&gt;
|-&lt;br /&gt;
| x-error-message&lt;br /&gt;
| The error message. See [[#Errors|Errors]].&lt;br /&gt;
| Missing required field: name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Errors ====&lt;br /&gt;
&lt;br /&gt;
When an error occurs, the system will return an HTTP error response code denoting the type of error. The system will also return additional information about the fault in the body of the response.&lt;br /&gt;
&lt;br /&gt;
'''Example Fault Response – XML'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;appsFault code=&amp;quot;500&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;message&amp;gt;Fault!&amp;lt;/message&amp;gt;&lt;br /&gt;
  &amp;lt;details&amp;gt;Error Details...&amp;lt;/details&amp;gt;&lt;br /&gt;
&amp;lt;/appsFault&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example Fault Response – JSON'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;appsFault&amp;quot; : {&lt;br /&gt;
    &amp;quot;code&amp;quot; : 500,&lt;br /&gt;
    &amp;quot;message&amp;quot; : &amp;quot;Fault!&amp;quot;,&lt;br /&gt;
    &amp;quot;details&amp;quot; : &amp;quot;Error Details...&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error code is returned in the body of the response for convenience. The message section returns a human-readable message that is appropriate for display to the end user. The details section is optional and may contain information—for example, a stack trace—to assist in tracking down an error. The detail section may or may not be appropriate for display to an end user.&lt;br /&gt;
The root element of the fault (e.g. appsFault) may change depending on the type of error. The following is a list of possible common root elements along with their associated error codes.  More specific faults may be may exist for different resources and will be documented with those resources.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Fault Element''&lt;br /&gt;
!''Error Codes''&lt;br /&gt;
!''Custom Fields''&lt;br /&gt;
|-&lt;br /&gt;
|appsFault&lt;br /&gt;
|500, 400, and other codes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|itemNotFound&lt;br /&gt;
|404&lt;br /&gt;
|resourceType - What resource in the request that was not found (Domain, Mailbox, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|unauthorized&lt;br /&gt;
|403&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|badRequest&lt;br /&gt;
|400&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From an XML schema perspective, all API faults are extensions of the base fault type AppsAPIFault. When working with a system that binds XML to actual classes (such as JAXB), one should be capable of using AppsAPIFault as a “catch-all” if there's no interest in distinguishing between individual fault types.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''X-Error-Message Header'''&lt;br /&gt;
&lt;br /&gt;
Prior to faults in the body of HTTP responses, the only information returned to users was the HTTP status code and an HTTP header x-error-message with the error message.  This functionality has been kept for backwards compatibility but retrieving fault information in the HTTP body is the recommended approach for new applications.&lt;br /&gt;
&lt;br /&gt;
==== Paging ====&lt;br /&gt;
&lt;br /&gt;
The results of Index actions are split into pages to lessen potentially high resource usage. The index URLs have a query string with parameters in the format &amp;quot;?size=xx&amp;amp;offset=xx.&amp;quot; If a query parameter is omitted, the default value is used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Query Parameter''&lt;br /&gt;
!''Default''&lt;br /&gt;
!''Maximum''&lt;br /&gt;
!''Notes''&lt;br /&gt;
|-&lt;br /&gt;
| size&lt;br /&gt;
| 50&lt;br /&gt;
| 250&lt;br /&gt;
| This is the number of elements per page.&lt;br /&gt;
|-&lt;br /&gt;
| offset&lt;br /&gt;
| 0&lt;br /&gt;
| N/A&lt;br /&gt;
| This is the number of items to offset away from the first item in the list.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example =====&lt;br /&gt;
&lt;br /&gt;
A PHP Example of paging can be found [[PHP_Examples_(Rest_API)| here]].&lt;br /&gt;
&lt;br /&gt;
==== Examples ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Cache-Control: private&lt;br /&gt;
Content-Type: text/xml; charset=utf-8&lt;br /&gt;
Server: Microsoft-IIS/7.0&lt;br /&gt;
Date: Fri, 04 Dec 2009 19:08:11 GMT&lt;br /&gt;
Content-Length: 430&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;domainList xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns=&amp;quot;urn:xml:domainList&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;offset&amp;gt;0&amp;lt;/offset&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;50&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;total&amp;gt;1&amp;lt;/total&amp;gt;&lt;br /&gt;
  &amp;lt;domains&amp;gt;&lt;br /&gt;
    &amp;lt;domain&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;customer.com&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;accountNumber&amp;gt;123456&amp;lt;/accountNumber&amp;gt;&lt;br /&gt;
      &amp;lt;serviceType&amp;gt;rsemail&amp;lt;/serviceType&amp;gt;&lt;br /&gt;
    &amp;lt;/domain&amp;gt;&lt;br /&gt;
  &amp;lt;/domains&amp;gt;&lt;br /&gt;
&amp;lt;/domainList&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 404 Not Found&lt;br /&gt;
Cache-Control: private&lt;br /&gt;
Server: Microsoft-IIS/7.0&lt;br /&gt;
x-error-message: Customer Not Found&lt;br /&gt;
Date: Fri, 04 Dec 2009 19:13:59 GMT&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 400 Bad Request&lt;br /&gt;
Cache-Control: private&lt;br /&gt;
Server: Microsoft-IIS/7.0&lt;br /&gt;
x-error-message: Missing required field: type&lt;br /&gt;
Date: Fri, 04 Dec 2009 19:17:29 GMT&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Ruby ===&lt;br /&gt;
&lt;br /&gt;
This examples is written in [http://www.ruby-lang.org/en/ Ruby]. To make the examples shorter, helper methods have been written. These methods are part of a NetMethods module. The contents of the NetMethods module is listed below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require  'server.rb'&lt;br /&gt;
&lt;br /&gt;
server = Server.new&lt;br /&gt;
&lt;br /&gt;
response = server.get  '/customers', server.xml_format&lt;br /&gt;
&lt;br /&gt;
#fields = Hash['serviceType' =&amp;gt;  'exchange', 'exchangeMaxNumMailboxes' =&amp;gt; '4']&lt;br /&gt;
#response =  server.post '/customers/me/domains/newdomain.com', fields&lt;br /&gt;
&lt;br /&gt;
puts response.code&lt;br /&gt;
puts response['x-error-message']&lt;br /&gt;
puts response.body&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'test/unit/assertions'&lt;br /&gt;
require 'net/http'&lt;br /&gt;
require 'date'&lt;br /&gt;
require 'date/format'&lt;br /&gt;
require 'digest/sha1'&lt;br /&gt;
require 'base64'&lt;br /&gt;
require 'time'&lt;br /&gt;
&lt;br /&gt;
class Server&lt;br /&gt;
  include Test::Unit::Assertions&lt;br /&gt;
  &lt;br /&gt;
  def initialize(server='api.emailsrvr.com', version_prefix='/v0', user_key='xxxxxxxxxxxxxxxxxxxx', secret_hash='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')&lt;br /&gt;
    @server = server&lt;br /&gt;
    @version_prefix = version_prefix&lt;br /&gt;
    @user_key = user_key&lt;br /&gt;
    @secret_hash = secret_hash&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
# Response Type Enums&lt;br /&gt;
&lt;br /&gt;
  def xml_format&lt;br /&gt;
    'text/xml'&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def json_format&lt;br /&gt;
    'application/json'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# HTTP Request Verbs&lt;br /&gt;
#  &lt;br /&gt;
  def get(url_string, format)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    headers = prepared_headers&lt;br /&gt;
    headers['Accept'] = format&lt;br /&gt;
    request = Net::HTTP::Get.new(request_uri(uri), headers)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def delete(url_string)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    request = Net::HTTP::Delete.new(request_uri(uri), prepared_headers)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def put(url_string, fields_hash)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    request = Net::HTTP::Put.new(request_uri(uri), prepared_headers)&lt;br /&gt;
    request.set_form_data(fields_hash)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def post(url_string, fields_hash)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    request = Net::HTTP::Post.new(request_uri(uri), prepared_headers)&lt;br /&gt;
    request.set_form_data(fields_hash)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
#&lt;br /&gt;
# HTTP Request Helpers&lt;br /&gt;
# &lt;br /&gt;
  def make_request request, uri&lt;br /&gt;
    response = Net::HTTP::start(uri.host, uri.port)  do |http|&lt;br /&gt;
      http.request request&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    response&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def full_uri url_string&lt;br /&gt;
    URI.parse('http://' + @server + @version_prefix + url_string)&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def request_uri uri&lt;br /&gt;
    request = uri.path&lt;br /&gt;
    if ! uri.query.nil?&lt;br /&gt;
      request = request + '?' + uri.query&lt;br /&gt;
    end&lt;br /&gt;
    request&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def prepared_headers&lt;br /&gt;
    headers = Hash.new&lt;br /&gt;
    headers.merge! headers_auth_creds(@user_key, @secret_hash)&lt;br /&gt;
    headers['Accept'] = xml_format&lt;br /&gt;
    headers&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def headers_auth_creds apiKey, secretKey&lt;br /&gt;
    userAgent = 'Ruby Test Client'&lt;br /&gt;
    timestamp = DateTime.now.strftime('%Y%m%d%H%M%S')&lt;br /&gt;
    &lt;br /&gt;
    data_to_sign = apiKey + userAgent + timestamp + secretKey&lt;br /&gt;
    &lt;br /&gt;
    hash = Base64.encode64(Digest::SHA1.digest(data_to_sign))&lt;br /&gt;
    signature = apiKey + &amp;quot;:&amp;quot; + timestamp + &amp;quot;:&amp;quot; + hash&lt;br /&gt;
    &lt;br /&gt;
    headers = Hash['User-Agent' =&amp;gt; userAgent, 'X-Api-Signature' =&amp;gt; signature]&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C# ===&lt;br /&gt;
&lt;br /&gt;
This examples is written in [http://msdn.microsoft.com/en-us/vcsharp/default.aspx C#].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Specialized;&lt;br /&gt;
using System.Security.Cryptography;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Net;&lt;br /&gt;
&lt;br /&gt;
public class WebMethods&lt;br /&gt;
{&lt;br /&gt;
  private WebClientBase client;&lt;br /&gt;
  private string baseUrl;&lt;br /&gt;
  private string apiKey;&lt;br /&gt;
  private string secretKey;&lt;br /&gt;
&lt;br /&gt;
  public WebMethods(WebClientBase client, string baseUrl, string apiKey, string secretKey)&lt;br /&gt;
  {&lt;br /&gt;
    this.client = client;&lt;br /&gt;
    this.baseUrl = baseUrl;&lt;br /&gt;
    this.apiKey = apiKey;&lt;br /&gt;
    this.secretKey = secretKey;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public virtual string Get(string url)&lt;br /&gt;
  {&lt;br /&gt;
    return MakeRemoteCall((client) =&amp;gt;&lt;br /&gt;
      {&lt;br /&gt;
        return client.DownloadString(baseUrl + url);&lt;br /&gt;
      },&lt;br /&gt;
      format);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public virtual string Post(string url, NameValueCollection data)&lt;br /&gt;
  {&lt;br /&gt;
    return MakeRemoteCall((client) =&amp;gt;&lt;br /&gt;
      {&lt;br /&gt;
        var bytes = client.UploadValues(baseUrl + url, data);&lt;br /&gt;
        return Encoding.UTF8.GetString(bytes);&lt;br /&gt;
      },&lt;br /&gt;
      format);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private void SignMessage()&lt;br /&gt;
  {&lt;br /&gt;
    var userAgent = &amp;quot;C# Client Library&amp;quot;;&lt;br /&gt;
    client.Headers[&amp;quot;User-Agent&amp;quot;] = userAgent;&lt;br /&gt;
&lt;br /&gt;
    var dateTime = DateTime.UtcNow.ToString(&amp;quot;yyyyMMddHHmmss&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    var dataToSign = apiKey + userAgent + dateTime + secretKey;&lt;br /&gt;
    var hash = SHA1.Create();&lt;br /&gt;
    var signedBytes = hash.ComputeHash(Encoding.UTF8.GetBytes(dataToSign));&lt;br /&gt;
    var signature = Convert.ToBase64String(signedBytes);&lt;br /&gt;
&lt;br /&gt;
    client.Headers[&amp;quot;X-Api-Signature&amp;quot;] = apiKey + &amp;quot;:&amp;quot; + dateTime + &amp;quot;:&amp;quot; + signature;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private void AssignFormat(string format)&lt;br /&gt;
  {&lt;br /&gt;
    client.Headers[&amp;quot;Accept&amp;quot;] = format;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private string MakeRemoteCall(Func&amp;lt;WebClientBase, string&amp;gt; remoteCall, string format)&lt;br /&gt;
  {&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
      SignMessage();&lt;br /&gt;
      AssignFormat(format);&lt;br /&gt;
      return remoteCall.Invoke(client);&lt;br /&gt;
    }&lt;br /&gt;
    catch (WebException e)&lt;br /&gt;
    {&lt;br /&gt;
      throw new ApiException(e);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
&lt;br /&gt;
The PHP Example can be found [[PHP_Examples_(Rest_API)| here]].&lt;/div&gt;</summary>
		<author><name>Subir.jolly</name></author>	</entry>

	<entry>
		<id>http://api-wiki.apps.rackspace.com/api-wiki/index.php?title=Main_Page&amp;diff=450</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://api-wiki.apps.rackspace.com/api-wiki/index.php?title=Main_Page&amp;diff=450"/>
				<updated>2011-08-11T16:44:45Z</updated>
		
		<summary type="html">&lt;p&gt;Subir.jolly: /* Recent Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The The Rackspace Email Rest API provides most of the functions of the Control Panel through a REST-based [http://en.wikipedia.org/wiki/Web_service web API]. Whether it is adding a new customer account, adding mailboxes, or any other of the supported features the API allows your application to administer the changes regardless of your application's language or nature. For more information on RESTful web services refer to the following sites:&lt;br /&gt;
&lt;br /&gt;
[http://www.peej.co.uk/articles/restfully-delicious.html Paul James's Homepage: A RESTful Web service, an example]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Representational_State_Transfer#External_links Wikipedia: Representational State Transfer - External Links]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The API is accessible to all with access to Control Panel, including resellers, business customers, enterprise customers, and indirect customers. However, not all operations are available to non-resellers. See the [[Rest_API#Operations|Operations]] section for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Rackspace Email Soap API Homepage has been moved to [[Soap_API| here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recent Changes ==&lt;br /&gt;
'''08/11/11'''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Bulk operations for Alias resource.&lt;br /&gt;
* Returning fault in response body on errors instead of plain text description.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''10/31/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Rackspace Mailbox indexes now support custom fields.&lt;br /&gt;
* A Login Token may now be generated for Rackspace Mailboxes.&lt;br /&gt;
* Users can set Rackspace Mailbox storage notification settings. See [[Rackspace_Storage_Notification_(Rest_API)| here]] for more details.&lt;br /&gt;
* Users can now manage admins. See [[Admin_(Rest_API)| here]] for more details.&lt;br /&gt;
* Added Email Everyone to Domain operations. See [[Domain_(Rest_API)#Domain_Email_Everyone | here]] for more details.&lt;br /&gt;
* Added Show/Edit Catch-All Address to Domain operations. See [[Domain_(Rest_API)#Show_Domain_Catch-All_Address | here]] for more details.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''09/01/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Now Rackspace Email Mailbox can be marked as visible in Exchange Global Address List. &lt;br /&gt;
* Exchange Mailbox can be marked as visible in Rackspace Email Company Directory.&lt;br /&gt;
* Rackspace Email/Exchange Mailbox last login time.&lt;br /&gt;
* Filter Rackspace Email/Exchange Mailbox by &amp;quot;Enabled&amp;quot; flag.&lt;br /&gt;
* Resellers now can create Login Token that only can be used to log into sub-account Control Panel. See [[Customer_(Rest_API)#Create_Login_Tokens| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''08/01/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added Rackspace Email Mailbox Contact info. See [[Rackspace_Mailbox_(Rest_API)| here]].&lt;br /&gt;
* Added Create Login Token. See [[Customer_(Rest_API)#Create_Login_Tokens| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''06/20/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added [[Rackspace_Alias(Rest_API)| Rackspace Email Alias]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''06/11/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added Rackspace Email Mailbox Spam Settings/Blacklist/Safelist. See [[Rackspace_Mailbox_Spam_(Rest_API)| here]].&lt;br /&gt;
* Now Rackspace Email Mailbox can Show/Edit vacation message and email forwarding address. See [[Rackspace_Mailbox_(Rest_API)| here]].&lt;br /&gt;
* Added SharePoint Service Settings. See [[SharePoint_(Rest_API)| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''05/16/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added shortened URLs. Any URLs that starts with '/customers/me/domains/~' is equivalent to '/domains/~'.&lt;br /&gt;
* Added Rackspace Email Mailbox Add/Edit/Delete/Index. See [[Rackspace_Mailbox_(Rest_API)| here]].&lt;br /&gt;
* Allows to customize Exchange mailbox list result. See [[Exchange_Mailbox_(Rest_API)#Index| Exchange Mailbox Index]] action 'Custom Fields' section.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Changes:&lt;br /&gt;
* Server throttling section has been updated. See [[Rest_API#Throttling| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Bug fix:&lt;br /&gt;
* Fixed a bug that request without User-Agent Header gets 500 error. Now it gets &amp;quot;Authentication failed&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''03/28/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Rest API can be accessed by Business Users. However, not all operations are available.&lt;br /&gt;
* Domain Public Folders can be enabled now.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Deprecated:&lt;br /&gt;
* Good Mobile Service is no longer supported.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''03/14/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Index/Add/Edit/Delete Mailbox Permissions.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Known Issues:&lt;br /&gt;
* Domain public folders can't be enabled using Rest API at this moment. The next release (on 03/21/2010) will fix this problem.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
The following pages detail the operations that the API supports. The operations are grouped into sections based on the entity/object types that each operation interacts with. Non-resellers do not have access to all functions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Resource&lt;br /&gt;
!Example URI&lt;br /&gt;
!Business User Access&lt;br /&gt;
|-&lt;br /&gt;
| [[Customer_(Rest_API)| Customer]]&lt;br /&gt;
| /customers/123456789&lt;br /&gt;
| [[Customer_(Rest_API)#Create_Login_Tokens | Create Login Tokens]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Admin_(Rest_API)| Admin]]&lt;br /&gt;
| /customers/123456789/admins/my_admin&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Domain_(Rest_API)| Domain]]&lt;br /&gt;
| /customers/123456789/domains/example.com&lt;br /&gt;
| [[Domain_(Rest_API)#Index| Index]], [[Domain_(Rest_API)#Show| Show]], [[Domain_(Rest_API)#Split Domain Routing| Split Domain Routing]], [[Domain_(Rest_API)#Archiving SSO Login URL| Archiving SSO Login URL]], [[Domain_(Rest_API)#Domain_Public_Folders_.28Reseller_Only.29|Domain Public Folders]], [[Domain_(Rest_API)#Domain Email Everyone| Email Everyone ]], [[Domain_(Rest_API)#Show_Domain_Catch-All_Address | Catch-All Address]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Domain_Spam_(Rest_API)| Domain Spam Settings]]&lt;br /&gt;
| /customers/123456789/domains/example.com/spam/settings&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Mailbox_(Rest_API)|  Rackspace Email Mailbox]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/mailboxes/john.smith&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Mailbox_Spam_(Rest_API)| Rackspace Email Mailbox Spam Settings]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/mailboxes/john.smith/spam&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Storage_Notification_(Rest_API)| Rackspace Storage Notification Settings]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/storageNotification&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Alias(Rest_API)|  Rackspace Email Alias]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/mailboxes/john.smith/alias&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Mailbox_(Rest_API)| Exchange Mailbox]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/mailboxes/john.smith&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Mailbox_Spam_(Rest_API)| Exchange Mailbox Spam Settings]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/mailboxes/john.smith/spam&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Contact_(Rest_API)| Exchange Contact]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/contacts/john.smith&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Distribution_List_(Rest_API)| Exchange Distribution List]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/distributionlists/group.name&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Resource_Mailbox_(Rest_API)| Exchange Resource Mailbox]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/resources/conference.room&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[SharePoint_(Rest_API)| SharePoint]]&lt;br /&gt;
| /customers/123456789/sharepoint/settings&lt;br /&gt;
| [[SharePoint_(Rest_API)#Show | Show]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The examples shown in the operation pages are written in Ruby and extensively use the helper functions shown in the Ruby Examples below.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
&lt;br /&gt;
'''What you need:'''&lt;br /&gt;
* A Rackspace Email and Apps Control Panel admin account&lt;br /&gt;
* A HTTP class library that supports TLS and the HTTP methods: GET, POST, PUT, DELETE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Making your first API call, an Show Customer request:'''&lt;br /&gt;
# Obtain your API keys&lt;br /&gt;
#:* Click on My Account at the top of the [https://apps.rackspace.com/?cp Control Panel web interface]. Under the Administrators heading there will be an link for the API keys page.&lt;br /&gt;
# Set up your client's HTTP request&lt;br /&gt;
#:* Set up your client to make calls to a URL beginning with &amp;lt;nowiki&amp;gt;https://api.emailsrvr.com/v0&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
#:* Populate the Accept, User-Agent and X-Api-Signature HTTP request headers correctly. This is explained in detail [[#HTTP Headers|here]].&lt;br /&gt;
# Make a GET request to /customers/me.&lt;br /&gt;
#:* The complete URI will be &amp;lt;nowiki&amp;gt;https://api.emailsrvr.com/v0/customers/me&amp;lt;/nowiki&amp;gt;. Use your HTTP library to retrieve the HTTP response code, 'x-error-message' HTTP response header and HTTP response body so that they may be displayed to help debug and determine success.&lt;br /&gt;
'''From here:'''&lt;br /&gt;
* Learn about the operations you'll be implementing at the subpages [[#Operations|here]].&lt;br /&gt;
&lt;br /&gt;
== Accessing the API ==&lt;br /&gt;
&lt;br /&gt;
Your application will need to make HTTP requests to remote servers. Most programming languages have this function provided in its class library. In addition to the common GET and POST HTTP methods, the library used will also need to support PUT and DELETE.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Calls without [http://en.wikipedia.org/wiki/Transport_Layer_Security TLS] (formerly SSL) will complete successfully but it is HIGHLY RECOMMENDED that TLS always be used. Interception of unencrypted communication will allow a third party to have complete access to all functions available via the API.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For some language libraries just using an URL with https:// will cause the library to use TLS. In some other libraries however some options specific to the library may have to be configured to utilize TLS. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All API calls should be directed to a URL in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://api.emailsrvr.com/(version)/(resource)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://api.emailsrvr.com/v0/customers/12345678/domains/customerbusiness.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Versions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Supported Versions''&lt;br /&gt;
!''URL''&lt;br /&gt;
!''Version Documentation''&lt;br /&gt;
|-&lt;br /&gt;
| v0 (current)&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;https://api.emailsrvr.com/v0/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| http://signup.apps.rackspace.com/api-wiki/index.php/Rest_API&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The API version number is a component of the URL that is used to access the API. For example, to access the root of the API, the URL is https://api.emailsrvr.com/v0/. Bug fixes and minor non-breaking changes will be made without changing the version number. When major features or breaking changes are introduced, the version number will be incremented. It is not yet determined how many versions are going to be supported at any one time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Non-breaking Changes''&lt;br /&gt;
!''Breaking Changes''&lt;br /&gt;
|-&lt;br /&gt;
| Adding new fields or attributes to form fields sent&lt;br /&gt;
| Changing or deleting any fields in form fields sent&lt;br /&gt;
|-&lt;br /&gt;
| Adding fields in returned data&lt;br /&gt;
| Changing or removing fields in returned data&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Changing the URI of any resource&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
To gain access to the API, your request must include a properly constructed X-Api-Signature HTTP header. Details on what to put in the header are below. To construct the header, you must have the following keys that that are generated from the [https://apps.rackspace.com/?cp Control Panel Web interface]. The key generation page can be found by clicking 'My Account' at the top, then 'Generate API Keys' in the Administrators section.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Key Name&lt;br /&gt;
!Description&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
| User Key&lt;br /&gt;
| A public key that corresponds to your admin id&lt;br /&gt;
| ''eGbq9/2hcZsRlr1JV1Pi''&lt;br /&gt;
|-&lt;br /&gt;
| Secret Key&lt;br /&gt;
| A shared secret key&lt;br /&gt;
| ''QHOvchm/40czXhJ1OxfxK7jDHr3t''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An unsuccessful authentication will result in a 403 HTTP code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== X-Api-Signature Header ====&lt;br /&gt;
&lt;br /&gt;
Format is as follows:&lt;br /&gt;
&amp;lt;'''User Key'''&amp;gt;:&amp;lt;'''Timestamp'''&amp;gt;:&amp;lt;'''SHA1 Hash'''&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Example: ''eGbq9/2hcZsRlr1JV1Pi:20010317143725:46VIwd66mOFGG8IkbgnLlXnfnkU=''&lt;br /&gt;
&lt;br /&gt;
Remember to include the colons between the data strings!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''User Key''':&amp;lt;br&amp;gt;&lt;br /&gt;
This is the public key issued by the Control Panel browser interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Timestamp''':&amp;lt;br&amp;gt;&lt;br /&gt;
The format is YYYYMMDDHHmmss. All values besides year are zero-padded to two spaces. For example, March 08th 2001 at 2:37.25pm would be ''20010308143725''.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|YYYY&lt;br /&gt;
|Four-digit year&lt;br /&gt;
|-&lt;br /&gt;
| MM&lt;br /&gt;
| Month&lt;br /&gt;
|-&lt;br /&gt;
| DD&lt;br /&gt;
| Day&lt;br /&gt;
|-&lt;br /&gt;
| HH&lt;br /&gt;
| Hour in 24h format&lt;br /&gt;
|-&lt;br /&gt;
| mm&lt;br /&gt;
| Minute&lt;br /&gt;
|-&lt;br /&gt;
| ss&lt;br /&gt;
| Second&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''SHA1 Hash''':&lt;br /&gt;
&lt;br /&gt;
A SHA1 (Secure Hash Algorithm) hash must be applied to a string with the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;'''User Key'''&amp;gt;&amp;lt;'''User Agent'''&amp;gt;&amp;lt;'''Timestamp'''&amp;gt;&amp;lt;'''Secret Key'''&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the 'User Agent' must be the exact same as what is specified in the User-Agent HTTP header. Using the above example data, the string before hashing is:&amp;lt;br&amp;gt;''eGbq9/2hcZsRlr1JV1PiRackspace Management Interface20010308143725QHOvchm/40czXhJ1OxfxK7jDHr3t''&lt;br /&gt;
&lt;br /&gt;
Resulting base-64 SHA1 Hash:&amp;lt;br&amp;gt;''46VIwd66mOFGG8IkbgnLlXnfnkU=''&lt;br /&gt;
&lt;br /&gt;
Be sure to encode the binary hash, not the hex hash, into base-64. The resulting string should be 28 characters long.&lt;br /&gt;
&lt;br /&gt;
== Using the API ==&lt;br /&gt;
&lt;br /&gt;
=== Requests ===&lt;br /&gt;
&lt;br /&gt;
HTTP requests should be sent to the server with the correct URL, HTTP method, HTTP headers and form data (if needed). The URL specifies the resource, the HTTP method specifies what operation is done on the resource, and form data is used to specify the details of the resource when the resource is added or edited.&lt;br /&gt;
&lt;br /&gt;
The URLs, corresponding HTTP methods, and necessary form data for the desired operations are detailed in the [[#Operations|operation pages]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you're getting the HTTP status code 417 see [[Handling HTTP code 417:  Expectation failed]]&lt;br /&gt;
&lt;br /&gt;
==== URL ====&lt;br /&gt;
&lt;br /&gt;
The URLs are specifies the resource or resource collection. Objects are organized in a tree collection, starting with customers at the top, then domains, then domain objects next (such as mailboxes, contacts, and distribution lists) and so on. The URLs of the resources and collections accessible are found on the operation pages.&lt;br /&gt;
&lt;br /&gt;
==== HTTP Method ====&lt;br /&gt;
&lt;br /&gt;
It is the HTTP method that specifies what operation will be done on the resource. For example, to get the details of a mailbox a HTTP GET will be done on /customers/12345678/domains/example.com/ex/mailboxes/john.smith. If the mailbox does not exist, a HTTP POST to the same URL with the necessary form data will add the mailbox. Then, a HTTP PUT to the same URL will edit mailbox. And to delete the mailbox, an HTTP DELETE would be used.&lt;br /&gt;
&lt;br /&gt;
The types of operations a certain method performs is outlined below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''HTTP Method''&lt;br /&gt;
!''Operations''&lt;br /&gt;
!''Response''&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2|GET&lt;br /&gt;
|Index - returns a list of the resources&lt;br /&gt;
|rowspan=2|XML or JSON formatted data&lt;br /&gt;
|-&lt;br /&gt;
|Show - returns the details of the resource&lt;br /&gt;
|-&lt;br /&gt;
|POST&lt;br /&gt;
|Add - adds a new resource&lt;br /&gt;
|rowspan=3|Response code and error message (if applicable) only&lt;br /&gt;
|-&lt;br /&gt;
|PUT&lt;br /&gt;
|Edit - changes the details of the resource&lt;br /&gt;
|-&lt;br /&gt;
|DELETE&lt;br /&gt;
|Delete - deletes the resource&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== HTTP Headers ====&lt;br /&gt;
&lt;br /&gt;
All requests to the API must then include HTTP headers with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Header Name''&lt;br /&gt;
!''Description''&lt;br /&gt;
!''Example Header Value''&lt;br /&gt;
|-&lt;br /&gt;
| Accept&lt;br /&gt;
| The requested content type (required for Index and Show actions). Fill this with either 'text/xml' or 'application/json'. See [[#Formats|Response Formats]]&lt;br /&gt;
| ''text/xml''&lt;br /&gt;
|-&lt;br /&gt;
| User-Agent&lt;br /&gt;
| An identifier you choose for your client software&lt;br /&gt;
| ''Rackspace Management Interface''&lt;br /&gt;
|-&lt;br /&gt;
| X-Api-Signature&lt;br /&gt;
| An authentication string explained in detail [[#X-Api-Signature_Header|here]]&lt;br /&gt;
| ''eGbq9/2hcZsRlr1JV1Pi:20010317143725:HKUn0aajpSDx7qqGK3vqzn3FglI=''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Form Data ====&lt;br /&gt;
&lt;br /&gt;
When using Add and Edit operations, the details of the resource are sent to the API server via HTTP form data. Your HTTP library should include methods for sending form data along with an HTTP request. The library should by default send the data in the HTTP request body using the 'application/x-www-form-urlencoded' data format.&lt;br /&gt;
&lt;br /&gt;
==== Index Filter/Search ====&lt;br /&gt;
&lt;br /&gt;
The results of Index actions can be filtered/searched. The index URLs can take either one of the query strings: &amp;quot;?startswith=xx&amp;quot; or &amp;quot;?contains=xx,&amp;quot; where &amp;quot;xx&amp;quot; is the key word. If the request specifies more than one of these two query strings, a 400 HTTP error will be returned. Different fields will be searched depending on the resource type, see below.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;quot;0-9&amp;quot; is a reserved key word for query string &amp;quot;startswith.&amp;quot; It represents any result starting with numbers.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Index Actions''&lt;br /&gt;
!''Where the key word will be searched''&lt;br /&gt;
|-&lt;br /&gt;
| Customer&lt;br /&gt;
| Customer name, account number, reference number&lt;br /&gt;
|-&lt;br /&gt;
| Domain&lt;br /&gt;
| Domain name&lt;br /&gt;
|-&lt;br /&gt;
| Mailbox&lt;br /&gt;
| Mailbox name, mailbox display name&lt;br /&gt;
|-&lt;br /&gt;
| Contact&lt;br /&gt;
| Contact display name, external email&lt;br /&gt;
|-&lt;br /&gt;
| Group&lt;br /&gt;
| Group name, group display name&lt;br /&gt;
|-&lt;br /&gt;
| Mobile Service&lt;br /&gt;
| Associated mailbox name, mailbox display name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Throttling ====&lt;br /&gt;
&lt;br /&gt;
The server limits the number of requests allowed per user in a certain period of time.  The number of requests made are logged per minute. Calls that were made correctly with a user's API key, but not completed for any reason, including those exceeding the throttle limit, are included in this count.&lt;br /&gt;
&lt;br /&gt;
If a user is over the throttling limit then a 403 HTTP code will be returned with an &amp;quot;Exceeded request limits&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Operation Category''&lt;br /&gt;
!''Request Limit''&lt;br /&gt;
|-&lt;br /&gt;
| GET&lt;br /&gt;
| 60 per minute&lt;br /&gt;
|-&lt;br /&gt;
| PUT, POST, DELETE&lt;br /&gt;
| 30 per minute&lt;br /&gt;
|-&lt;br /&gt;
| POST, PUT, DELETE on a domain&lt;br /&gt;
| 2 per minute&lt;br /&gt;
|-&lt;br /&gt;
| POST, DELETE on alternate domains&lt;br /&gt;
| 2 per minute&lt;br /&gt;
|-&lt;br /&gt;
| Enabling public folders for a domain&lt;br /&gt;
| 1 per 5 minutes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Examples ====&lt;br /&gt;
&lt;br /&gt;
Index of Exchange Mailboxes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Hypertext Transfer Protocol&lt;br /&gt;
    GET /v0/customers/12345678/domains/example.com/ex/mailboxes?size=100&amp;amp;offset=100 HTTP/1.1&lt;br /&gt;
    Host: api.emailsrvr.com&lt;br /&gt;
    User-Agent: Rackspace Management Interface&lt;br /&gt;
    X-Api-Signature: eGbq9/2hcZsRlr1JV1Pi:20010317143725:HKUn0aajpSDx7qqGK3vqzn3FglI=&lt;br /&gt;
    Accept: text/xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Adding New Exchange Mailbox:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Hypertext Transfer Protocol&lt;br /&gt;
    POST /v0/customers/12345678/domains/example.com/ex/mailboxes/john.smith HTTP/1.1&lt;br /&gt;
    Host: api.emailsrvr.com&lt;br /&gt;
    User-Agent: Rackspace Management Interface&lt;br /&gt;
    X-Api-Signature: eGbq9/2hcZsRlr1JV1Pi:20010317143725:HKUn0aajpSDx7qqGK3vqzn3FglI=&lt;br /&gt;
    Content-Length: 53&lt;br /&gt;
        [Content length: 53]&lt;br /&gt;
    Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
 &lt;br /&gt;
Line-based text data: application/x-www-form-urlencoded&lt;br /&gt;
    size=2048&amp;amp;displayName=John%20Smith&amp;amp;password=abcABC123&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Responses ===&lt;br /&gt;
&lt;br /&gt;
==== HTTP Status Code ====&lt;br /&gt;
&lt;br /&gt;
On a successfully executed request, a 200 HTTP Code is returned. If the request was unsuccessful however, an HTTP error code in the 400s or 500s will be returned.&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Body ====&lt;br /&gt;
&lt;br /&gt;
If the request is an Index or Show request, the request data will be returned in the format specified in the HTTP Body.&lt;br /&gt;
&lt;br /&gt;
===== Formats =====&lt;br /&gt;
&lt;br /&gt;
Requests for data (index and show requests) are returned with XML or JSON data based on what your application populates the [[#HTTP_Headers|HTTP Accept headers]] with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For XML, populate the header with 'text/xml' (ex: Headers![&amp;quot;Accept&amp;quot;] = &amp;quot;text/xml&amp;quot;). The XML document returned will conform to a published XSD (XML Schema Document). There are many ways to parse the data in an XML document, but we have found that the [http://www.w3schools.com/XPath/default.asp XPath] tree-style traversal has served our purposes. In any case, your application will likely need to use a class library for your chosen method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For JSON, populate the header with 'application/json' (ex: Headers![&amp;quot;Accept&amp;quot;] = &amp;quot;application/json&amp;quot;). As with XML, a library will likely be needed to parse the data.&lt;br /&gt;
&lt;br /&gt;
==== HTTP Headers ====&lt;br /&gt;
&lt;br /&gt;
The only data returned in the header is the error message (if any).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Header Name''&lt;br /&gt;
!''Description''&lt;br /&gt;
!''Example Header Value''&lt;br /&gt;
|-&lt;br /&gt;
| x-error-message&lt;br /&gt;
| The error message. See [[#Errors|Errors]].&lt;br /&gt;
| Missing required field: name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Errors ====&lt;br /&gt;
&lt;br /&gt;
When an error occurs, the system will return an HTTP error response code denoting the type of error. The system will also return additional information about the fault in the body of the response.&lt;br /&gt;
&lt;br /&gt;
'''Example Fault Response – XML'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;appsFault code=&amp;quot;500&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;message&amp;gt;Fault!&amp;lt;/message&amp;gt;&lt;br /&gt;
  &amp;lt;details&amp;gt;Error Details...&amp;lt;/details&amp;gt;&lt;br /&gt;
&amp;lt;/appsFault&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example Fault Response – JSON'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;appsFault&amp;quot; : {&lt;br /&gt;
    &amp;quot;code&amp;quot; : 500,&lt;br /&gt;
    &amp;quot;message&amp;quot; : &amp;quot;Fault!&amp;quot;,&lt;br /&gt;
    &amp;quot;details&amp;quot; : &amp;quot;Error Details...&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error code is returned in the body of the response for convenience. The message section returns a human-readable message that is appropriate for display to the end user. The details section is optional and may contain information—for example, a stack trace—to assist in tracking down an error. The detail section may or may not be appropriate for display to an end user.&lt;br /&gt;
The root element of the fault (e.g. appsFault) may change depending on the type of error. The following is a list of possible common root elements along with their associated error codes.  More specific faults may be may exist for different resources and will be documented with those resources.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Fault Element''&lt;br /&gt;
!''Error Codes''&lt;br /&gt;
!''Custom Fields''&lt;br /&gt;
|-&lt;br /&gt;
|appsFault&lt;br /&gt;
|500, 400, and other codes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|itemNotFound&lt;br /&gt;
|404&lt;br /&gt;
|resourceType - What resource in the request that was not found (Domain, Mailbox, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|unauthorized&lt;br /&gt;
|403&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|badRequest&lt;br /&gt;
|400&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From an XML schema perspective, all API faults are extensions of the base fault type AppsAPIFault. When working with a system that binds XML to actual classes (such as JAXB), one should be capable of using AppsAPIFault as a “catch-all” if there's no interest in distinguishing between individual fault types.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''X-Error-Message Header'''&lt;br /&gt;
&lt;br /&gt;
Prior to faults in the body of HTTP responses, the only information returned to users was the HTTP status code and an HTTP header x-error-message with the error message.  This functionality has been kept for backwards compatibility but retrieving fault information in the HTTP body is the recommended approach for new applications.&lt;br /&gt;
&lt;br /&gt;
==== Paging ====&lt;br /&gt;
&lt;br /&gt;
The results of Index actions are split into pages to lessen potentially high resource usage. The index URLs have a query string with parameters in the format &amp;quot;?size=xx&amp;amp;offset=xx.&amp;quot; If a query parameter is omitted, the default value is used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Query Parameter''&lt;br /&gt;
!''Default''&lt;br /&gt;
!''Maximum''&lt;br /&gt;
!''Notes''&lt;br /&gt;
|-&lt;br /&gt;
| size&lt;br /&gt;
| 50&lt;br /&gt;
| 250&lt;br /&gt;
| This is the number of elements per page.&lt;br /&gt;
|-&lt;br /&gt;
| offset&lt;br /&gt;
| 0&lt;br /&gt;
| N/A&lt;br /&gt;
| This is the number of items to offset away from the first item in the list.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example =====&lt;br /&gt;
&lt;br /&gt;
A PHP Example of paging can be found [[PHP_Examples_(Rest_API)| here]].&lt;br /&gt;
&lt;br /&gt;
==== Examples ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Cache-Control: private&lt;br /&gt;
Content-Type: text/xml; charset=utf-8&lt;br /&gt;
Server: Microsoft-IIS/7.0&lt;br /&gt;
Date: Fri, 04 Dec 2009 19:08:11 GMT&lt;br /&gt;
Content-Length: 430&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;domainList xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns=&amp;quot;urn:xml:domainList&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;offset&amp;gt;0&amp;lt;/offset&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;50&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;total&amp;gt;1&amp;lt;/total&amp;gt;&lt;br /&gt;
  &amp;lt;domains&amp;gt;&lt;br /&gt;
    &amp;lt;domain&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;customer.com&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;accountNumber&amp;gt;123456&amp;lt;/accountNumber&amp;gt;&lt;br /&gt;
      &amp;lt;serviceType&amp;gt;rsemail&amp;lt;/serviceType&amp;gt;&lt;br /&gt;
    &amp;lt;/domain&amp;gt;&lt;br /&gt;
  &amp;lt;/domains&amp;gt;&lt;br /&gt;
&amp;lt;/domainList&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 404 Not Found&lt;br /&gt;
Cache-Control: private&lt;br /&gt;
Server: Microsoft-IIS/7.0&lt;br /&gt;
x-error-message: Customer Not Found&lt;br /&gt;
Date: Fri, 04 Dec 2009 19:13:59 GMT&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 400 Bad Request&lt;br /&gt;
Cache-Control: private&lt;br /&gt;
Server: Microsoft-IIS/7.0&lt;br /&gt;
x-error-message: Missing required field: type&lt;br /&gt;
Date: Fri, 04 Dec 2009 19:17:29 GMT&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Ruby ===&lt;br /&gt;
&lt;br /&gt;
This examples is written in [http://www.ruby-lang.org/en/ Ruby]. To make the examples shorter, helper methods have been written. These methods are part of a NetMethods module. The contents of the NetMethods module is listed below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require  'server.rb'&lt;br /&gt;
&lt;br /&gt;
server = Server.new&lt;br /&gt;
&lt;br /&gt;
response = server.get  '/customers', server.xml_format&lt;br /&gt;
&lt;br /&gt;
#fields = Hash['serviceType' =&amp;gt;  'exchange', 'exchangeMaxNumMailboxes' =&amp;gt; '4']&lt;br /&gt;
#response =  server.post '/customers/me/domains/newdomain.com', fields&lt;br /&gt;
&lt;br /&gt;
puts response.code&lt;br /&gt;
puts response['x-error-message']&lt;br /&gt;
puts response.body&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'test/unit/assertions'&lt;br /&gt;
require 'net/http'&lt;br /&gt;
require 'date'&lt;br /&gt;
require 'date/format'&lt;br /&gt;
require 'digest/sha1'&lt;br /&gt;
require 'base64'&lt;br /&gt;
require 'time'&lt;br /&gt;
&lt;br /&gt;
class Server&lt;br /&gt;
  include Test::Unit::Assertions&lt;br /&gt;
  &lt;br /&gt;
  def initialize(server='api.emailsrvr.com', version_prefix='/v0', user_key='xxxxxxxxxxxxxxxxxxxx', secret_hash='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')&lt;br /&gt;
    @server = server&lt;br /&gt;
    @version_prefix = version_prefix&lt;br /&gt;
    @user_key = user_key&lt;br /&gt;
    @secret_hash = secret_hash&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
# Response Type Enums&lt;br /&gt;
&lt;br /&gt;
  def xml_format&lt;br /&gt;
    'text/xml'&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def json_format&lt;br /&gt;
    'application/json'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# HTTP Request Verbs&lt;br /&gt;
#  &lt;br /&gt;
  def get(url_string, format)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    headers = prepared_headers&lt;br /&gt;
    headers['Accept'] = format&lt;br /&gt;
    request = Net::HTTP::Get.new(request_uri(uri), headers)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def delete(url_string)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    request = Net::HTTP::Delete.new(request_uri(uri), prepared_headers)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def put(url_string, fields_hash)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    request = Net::HTTP::Put.new(request_uri(uri), prepared_headers)&lt;br /&gt;
    request.set_form_data(fields_hash)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def post(url_string, fields_hash)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    request = Net::HTTP::Post.new(request_uri(uri), prepared_headers)&lt;br /&gt;
    request.set_form_data(fields_hash)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
#&lt;br /&gt;
# HTTP Request Helpers&lt;br /&gt;
# &lt;br /&gt;
  def make_request request, uri&lt;br /&gt;
    response = Net::HTTP::start(uri.host, uri.port)  do |http|&lt;br /&gt;
      http.request request&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    response&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def full_uri url_string&lt;br /&gt;
    URI.parse('http://' + @server + @version_prefix + url_string)&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def request_uri uri&lt;br /&gt;
    request = uri.path&lt;br /&gt;
    if ! uri.query.nil?&lt;br /&gt;
      request = request + '?' + uri.query&lt;br /&gt;
    end&lt;br /&gt;
    request&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def prepared_headers&lt;br /&gt;
    headers = Hash.new&lt;br /&gt;
    headers.merge! headers_auth_creds(@user_key, @secret_hash)&lt;br /&gt;
    headers['Accept'] = xml_format&lt;br /&gt;
    headers&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def headers_auth_creds apiKey, secretKey&lt;br /&gt;
    userAgent = 'Ruby Test Client'&lt;br /&gt;
    timestamp = DateTime.now.strftime('%Y%m%d%H%M%S')&lt;br /&gt;
    &lt;br /&gt;
    data_to_sign = apiKey + userAgent + timestamp + secretKey&lt;br /&gt;
    &lt;br /&gt;
    hash = Base64.encode64(Digest::SHA1.digest(data_to_sign))&lt;br /&gt;
    signature = apiKey + &amp;quot;:&amp;quot; + timestamp + &amp;quot;:&amp;quot; + hash&lt;br /&gt;
    &lt;br /&gt;
    headers = Hash['User-Agent' =&amp;gt; userAgent, 'X-Api-Signature' =&amp;gt; signature]&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C# ===&lt;br /&gt;
&lt;br /&gt;
This examples is written in [http://msdn.microsoft.com/en-us/vcsharp/default.aspx C#].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Specialized;&lt;br /&gt;
using System.Security.Cryptography;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Net;&lt;br /&gt;
&lt;br /&gt;
public class WebMethods&lt;br /&gt;
{&lt;br /&gt;
  private WebClientBase client;&lt;br /&gt;
  private string baseUrl;&lt;br /&gt;
  private string apiKey;&lt;br /&gt;
  private string secretKey;&lt;br /&gt;
&lt;br /&gt;
  public WebMethods(WebClientBase client, string baseUrl, string apiKey, string secretKey)&lt;br /&gt;
  {&lt;br /&gt;
    this.client = client;&lt;br /&gt;
    this.baseUrl = baseUrl;&lt;br /&gt;
    this.apiKey = apiKey;&lt;br /&gt;
    this.secretKey = secretKey;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public virtual string Get(string url)&lt;br /&gt;
  {&lt;br /&gt;
    return MakeRemoteCall((client) =&amp;gt;&lt;br /&gt;
      {&lt;br /&gt;
        return client.DownloadString(baseUrl + url);&lt;br /&gt;
      },&lt;br /&gt;
      format);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public virtual string Post(string url, NameValueCollection data)&lt;br /&gt;
  {&lt;br /&gt;
    return MakeRemoteCall((client) =&amp;gt;&lt;br /&gt;
      {&lt;br /&gt;
        var bytes = client.UploadValues(baseUrl + url, data);&lt;br /&gt;
        return Encoding.UTF8.GetString(bytes);&lt;br /&gt;
      },&lt;br /&gt;
      format);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private void SignMessage()&lt;br /&gt;
  {&lt;br /&gt;
    var userAgent = &amp;quot;C# Client Library&amp;quot;;&lt;br /&gt;
    client.Headers[&amp;quot;User-Agent&amp;quot;] = userAgent;&lt;br /&gt;
&lt;br /&gt;
    var dateTime = DateTime.UtcNow.ToString(&amp;quot;yyyyMMddHHmmss&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    var dataToSign = apiKey + userAgent + dateTime + secretKey;&lt;br /&gt;
    var hash = SHA1.Create();&lt;br /&gt;
    var signedBytes = hash.ComputeHash(Encoding.UTF8.GetBytes(dataToSign));&lt;br /&gt;
    var signature = Convert.ToBase64String(signedBytes);&lt;br /&gt;
&lt;br /&gt;
    client.Headers[&amp;quot;X-Api-Signature&amp;quot;] = apiKey + &amp;quot;:&amp;quot; + dateTime + &amp;quot;:&amp;quot; + signature;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private void AssignFormat(string format)&lt;br /&gt;
  {&lt;br /&gt;
    client.Headers[&amp;quot;Accept&amp;quot;] = format;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private string MakeRemoteCall(Func&amp;lt;WebClientBase, string&amp;gt; remoteCall, string format)&lt;br /&gt;
  {&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
      SignMessage();&lt;br /&gt;
      AssignFormat(format);&lt;br /&gt;
      return remoteCall.Invoke(client);&lt;br /&gt;
    }&lt;br /&gt;
    catch (WebException e)&lt;br /&gt;
    {&lt;br /&gt;
      throw new ApiException(e);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
&lt;br /&gt;
The PHP Example can be found [[PHP_Examples_(Rest_API)| here]].&lt;/div&gt;</summary>
		<author><name>Subir.jolly</name></author>	</entry>

	<entry>
		<id>http://api-wiki.apps.rackspace.com/api-wiki/index.php?title=Main_Page&amp;diff=449</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://api-wiki.apps.rackspace.com/api-wiki/index.php?title=Main_Page&amp;diff=449"/>
				<updated>2011-08-11T16:40:04Z</updated>
		
		<summary type="html">&lt;p&gt;Subir.jolly: /* Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The The Rackspace Email Rest API provides most of the functions of the Control Panel through a REST-based [http://en.wikipedia.org/wiki/Web_service web API]. Whether it is adding a new customer account, adding mailboxes, or any other of the supported features the API allows your application to administer the changes regardless of your application's language or nature. For more information on RESTful web services refer to the following sites:&lt;br /&gt;
&lt;br /&gt;
[http://www.peej.co.uk/articles/restfully-delicious.html Paul James's Homepage: A RESTful Web service, an example]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Representational_State_Transfer#External_links Wikipedia: Representational State Transfer - External Links]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The API is accessible to all with access to Control Panel, including resellers, business customers, enterprise customers, and indirect customers. However, not all operations are available to non-resellers. See the [[Rest_API#Operations|Operations]] section for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Rackspace Email Soap API Homepage has been moved to [[Soap_API| here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recent Changes ==&lt;br /&gt;
&lt;br /&gt;
'''10/31/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Rackspace Mailbox indexes now support custom fields.&lt;br /&gt;
* A Login Token may now be generated for Rackspace Mailboxes.&lt;br /&gt;
* Users can set Rackspace Mailbox storage notification settings. See [[Rackspace_Storage_Notification_(Rest_API)| here]] for more details.&lt;br /&gt;
* Users can now manage admins. See [[Admin_(Rest_API)| here]] for more details.&lt;br /&gt;
* Added Email Everyone to Domain operations. See [[Domain_(Rest_API)#Domain_Email_Everyone | here]] for more details.&lt;br /&gt;
* Added Show/Edit Catch-All Address to Domain operations. See [[Domain_(Rest_API)#Show_Domain_Catch-All_Address | here]] for more details.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''09/01/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Now Rackspace Email Mailbox can be marked as visible in Exchange Global Address List. &lt;br /&gt;
* Exchange Mailbox can be marked as visible in Rackspace Email Company Directory.&lt;br /&gt;
* Rackspace Email/Exchange Mailbox last login time.&lt;br /&gt;
* Filter Rackspace Email/Exchange Mailbox by &amp;quot;Enabled&amp;quot; flag.&lt;br /&gt;
* Resellers now can create Login Token that only can be used to log into sub-account Control Panel. See [[Customer_(Rest_API)#Create_Login_Tokens| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''08/01/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added Rackspace Email Mailbox Contact info. See [[Rackspace_Mailbox_(Rest_API)| here]].&lt;br /&gt;
* Added Create Login Token. See [[Customer_(Rest_API)#Create_Login_Tokens| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''06/20/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added [[Rackspace_Alias(Rest_API)| Rackspace Email Alias]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''06/11/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added Rackspace Email Mailbox Spam Settings/Blacklist/Safelist. See [[Rackspace_Mailbox_Spam_(Rest_API)| here]].&lt;br /&gt;
* Now Rackspace Email Mailbox can Show/Edit vacation message and email forwarding address. See [[Rackspace_Mailbox_(Rest_API)| here]].&lt;br /&gt;
* Added SharePoint Service Settings. See [[SharePoint_(Rest_API)| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''05/16/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Added shortened URLs. Any URLs that starts with '/customers/me/domains/~' is equivalent to '/domains/~'.&lt;br /&gt;
* Added Rackspace Email Mailbox Add/Edit/Delete/Index. See [[Rackspace_Mailbox_(Rest_API)| here]].&lt;br /&gt;
* Allows to customize Exchange mailbox list result. See [[Exchange_Mailbox_(Rest_API)#Index| Exchange Mailbox Index]] action 'Custom Fields' section.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Changes:&lt;br /&gt;
* Server throttling section has been updated. See [[Rest_API#Throttling| here]].&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Bug fix:&lt;br /&gt;
* Fixed a bug that request without User-Agent Header gets 500 error. Now it gets &amp;quot;Authentication failed&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''03/28/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Rest API can be accessed by Business Users. However, not all operations are available.&lt;br /&gt;
* Domain Public Folders can be enabled now.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Deprecated:&lt;br /&gt;
* Good Mobile Service is no longer supported.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''03/14/10 '''&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
New features:&lt;br /&gt;
* Index/Add/Edit/Delete Mailbox Permissions.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Known Issues:&lt;br /&gt;
* Domain public folders can't be enabled using Rest API at this moment. The next release (on 03/21/2010) will fix this problem.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
The following pages detail the operations that the API supports. The operations are grouped into sections based on the entity/object types that each operation interacts with. Non-resellers do not have access to all functions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Resource&lt;br /&gt;
!Example URI&lt;br /&gt;
!Business User Access&lt;br /&gt;
|-&lt;br /&gt;
| [[Customer_(Rest_API)| Customer]]&lt;br /&gt;
| /customers/123456789&lt;br /&gt;
| [[Customer_(Rest_API)#Create_Login_Tokens | Create Login Tokens]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Admin_(Rest_API)| Admin]]&lt;br /&gt;
| /customers/123456789/admins/my_admin&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Domain_(Rest_API)| Domain]]&lt;br /&gt;
| /customers/123456789/domains/example.com&lt;br /&gt;
| [[Domain_(Rest_API)#Index| Index]], [[Domain_(Rest_API)#Show| Show]], [[Domain_(Rest_API)#Split Domain Routing| Split Domain Routing]], [[Domain_(Rest_API)#Archiving SSO Login URL| Archiving SSO Login URL]], [[Domain_(Rest_API)#Domain_Public_Folders_.28Reseller_Only.29|Domain Public Folders]], [[Domain_(Rest_API)#Domain Email Everyone| Email Everyone ]], [[Domain_(Rest_API)#Show_Domain_Catch-All_Address | Catch-All Address]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Domain_Spam_(Rest_API)| Domain Spam Settings]]&lt;br /&gt;
| /customers/123456789/domains/example.com/spam/settings&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Mailbox_(Rest_API)|  Rackspace Email Mailbox]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/mailboxes/john.smith&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Mailbox_Spam_(Rest_API)| Rackspace Email Mailbox Spam Settings]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/mailboxes/john.smith/spam&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Storage_Notification_(Rest_API)| Rackspace Storage Notification Settings]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/storageNotification&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Rackspace_Alias(Rest_API)|  Rackspace Email Alias]]&lt;br /&gt;
|  /customers/123456789/domains/example.com/rs/mailboxes/john.smith/alias&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Mailbox_(Rest_API)| Exchange Mailbox]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/mailboxes/john.smith&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Mailbox_Spam_(Rest_API)| Exchange Mailbox Spam Settings]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/mailboxes/john.smith/spam&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Contact_(Rest_API)| Exchange Contact]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/contacts/john.smith&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Distribution_List_(Rest_API)| Exchange Distribution List]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/distributionlists/group.name&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Exchange_Resource_Mailbox_(Rest_API)| Exchange Resource Mailbox]]&lt;br /&gt;
| /customers/123456789/domains/example.com/ex/resources/conference.room&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[SharePoint_(Rest_API)| SharePoint]]&lt;br /&gt;
| /customers/123456789/sharepoint/settings&lt;br /&gt;
| [[SharePoint_(Rest_API)#Show | Show]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The examples shown in the operation pages are written in Ruby and extensively use the helper functions shown in the Ruby Examples below.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
&lt;br /&gt;
'''What you need:'''&lt;br /&gt;
* A Rackspace Email and Apps Control Panel admin account&lt;br /&gt;
* A HTTP class library that supports TLS and the HTTP methods: GET, POST, PUT, DELETE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Making your first API call, an Show Customer request:'''&lt;br /&gt;
# Obtain your API keys&lt;br /&gt;
#:* Click on My Account at the top of the [https://apps.rackspace.com/?cp Control Panel web interface]. Under the Administrators heading there will be an link for the API keys page.&lt;br /&gt;
# Set up your client's HTTP request&lt;br /&gt;
#:* Set up your client to make calls to a URL beginning with &amp;lt;nowiki&amp;gt;https://api.emailsrvr.com/v0&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
#:* Populate the Accept, User-Agent and X-Api-Signature HTTP request headers correctly. This is explained in detail [[#HTTP Headers|here]].&lt;br /&gt;
# Make a GET request to /customers/me.&lt;br /&gt;
#:* The complete URI will be &amp;lt;nowiki&amp;gt;https://api.emailsrvr.com/v0/customers/me&amp;lt;/nowiki&amp;gt;. Use your HTTP library to retrieve the HTTP response code, 'x-error-message' HTTP response header and HTTP response body so that they may be displayed to help debug and determine success.&lt;br /&gt;
'''From here:'''&lt;br /&gt;
* Learn about the operations you'll be implementing at the subpages [[#Operations|here]].&lt;br /&gt;
&lt;br /&gt;
== Accessing the API ==&lt;br /&gt;
&lt;br /&gt;
Your application will need to make HTTP requests to remote servers. Most programming languages have this function provided in its class library. In addition to the common GET and POST HTTP methods, the library used will also need to support PUT and DELETE.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Calls without [http://en.wikipedia.org/wiki/Transport_Layer_Security TLS] (formerly SSL) will complete successfully but it is HIGHLY RECOMMENDED that TLS always be used. Interception of unencrypted communication will allow a third party to have complete access to all functions available via the API.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For some language libraries just using an URL with https:// will cause the library to use TLS. In some other libraries however some options specific to the library may have to be configured to utilize TLS. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All API calls should be directed to a URL in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://api.emailsrvr.com/(version)/(resource)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://api.emailsrvr.com/v0/customers/12345678/domains/customerbusiness.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Versions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Supported Versions''&lt;br /&gt;
!''URL''&lt;br /&gt;
!''Version Documentation''&lt;br /&gt;
|-&lt;br /&gt;
| v0 (current)&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;https://api.emailsrvr.com/v0/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| http://signup.apps.rackspace.com/api-wiki/index.php/Rest_API&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The API version number is a component of the URL that is used to access the API. For example, to access the root of the API, the URL is https://api.emailsrvr.com/v0/. Bug fixes and minor non-breaking changes will be made without changing the version number. When major features or breaking changes are introduced, the version number will be incremented. It is not yet determined how many versions are going to be supported at any one time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Non-breaking Changes''&lt;br /&gt;
!''Breaking Changes''&lt;br /&gt;
|-&lt;br /&gt;
| Adding new fields or attributes to form fields sent&lt;br /&gt;
| Changing or deleting any fields in form fields sent&lt;br /&gt;
|-&lt;br /&gt;
| Adding fields in returned data&lt;br /&gt;
| Changing or removing fields in returned data&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Changing the URI of any resource&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
To gain access to the API, your request must include a properly constructed X-Api-Signature HTTP header. Details on what to put in the header are below. To construct the header, you must have the following keys that that are generated from the [https://apps.rackspace.com/?cp Control Panel Web interface]. The key generation page can be found by clicking 'My Account' at the top, then 'Generate API Keys' in the Administrators section.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Key Name&lt;br /&gt;
!Description&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
| User Key&lt;br /&gt;
| A public key that corresponds to your admin id&lt;br /&gt;
| ''eGbq9/2hcZsRlr1JV1Pi''&lt;br /&gt;
|-&lt;br /&gt;
| Secret Key&lt;br /&gt;
| A shared secret key&lt;br /&gt;
| ''QHOvchm/40czXhJ1OxfxK7jDHr3t''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An unsuccessful authentication will result in a 403 HTTP code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== X-Api-Signature Header ====&lt;br /&gt;
&lt;br /&gt;
Format is as follows:&lt;br /&gt;
&amp;lt;'''User Key'''&amp;gt;:&amp;lt;'''Timestamp'''&amp;gt;:&amp;lt;'''SHA1 Hash'''&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Example: ''eGbq9/2hcZsRlr1JV1Pi:20010317143725:46VIwd66mOFGG8IkbgnLlXnfnkU=''&lt;br /&gt;
&lt;br /&gt;
Remember to include the colons between the data strings!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''User Key''':&amp;lt;br&amp;gt;&lt;br /&gt;
This is the public key issued by the Control Panel browser interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Timestamp''':&amp;lt;br&amp;gt;&lt;br /&gt;
The format is YYYYMMDDHHmmss. All values besides year are zero-padded to two spaces. For example, March 08th 2001 at 2:37.25pm would be ''20010308143725''.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|YYYY&lt;br /&gt;
|Four-digit year&lt;br /&gt;
|-&lt;br /&gt;
| MM&lt;br /&gt;
| Month&lt;br /&gt;
|-&lt;br /&gt;
| DD&lt;br /&gt;
| Day&lt;br /&gt;
|-&lt;br /&gt;
| HH&lt;br /&gt;
| Hour in 24h format&lt;br /&gt;
|-&lt;br /&gt;
| mm&lt;br /&gt;
| Minute&lt;br /&gt;
|-&lt;br /&gt;
| ss&lt;br /&gt;
| Second&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''SHA1 Hash''':&lt;br /&gt;
&lt;br /&gt;
A SHA1 (Secure Hash Algorithm) hash must be applied to a string with the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;'''User Key'''&amp;gt;&amp;lt;'''User Agent'''&amp;gt;&amp;lt;'''Timestamp'''&amp;gt;&amp;lt;'''Secret Key'''&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the 'User Agent' must be the exact same as what is specified in the User-Agent HTTP header. Using the above example data, the string before hashing is:&amp;lt;br&amp;gt;''eGbq9/2hcZsRlr1JV1PiRackspace Management Interface20010308143725QHOvchm/40czXhJ1OxfxK7jDHr3t''&lt;br /&gt;
&lt;br /&gt;
Resulting base-64 SHA1 Hash:&amp;lt;br&amp;gt;''46VIwd66mOFGG8IkbgnLlXnfnkU=''&lt;br /&gt;
&lt;br /&gt;
Be sure to encode the binary hash, not the hex hash, into base-64. The resulting string should be 28 characters long.&lt;br /&gt;
&lt;br /&gt;
== Using the API ==&lt;br /&gt;
&lt;br /&gt;
=== Requests ===&lt;br /&gt;
&lt;br /&gt;
HTTP requests should be sent to the server with the correct URL, HTTP method, HTTP headers and form data (if needed). The URL specifies the resource, the HTTP method specifies what operation is done on the resource, and form data is used to specify the details of the resource when the resource is added or edited.&lt;br /&gt;
&lt;br /&gt;
The URLs, corresponding HTTP methods, and necessary form data for the desired operations are detailed in the [[#Operations|operation pages]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you're getting the HTTP status code 417 see [[Handling HTTP code 417:  Expectation failed]]&lt;br /&gt;
&lt;br /&gt;
==== URL ====&lt;br /&gt;
&lt;br /&gt;
The URLs are specifies the resource or resource collection. Objects are organized in a tree collection, starting with customers at the top, then domains, then domain objects next (such as mailboxes, contacts, and distribution lists) and so on. The URLs of the resources and collections accessible are found on the operation pages.&lt;br /&gt;
&lt;br /&gt;
==== HTTP Method ====&lt;br /&gt;
&lt;br /&gt;
It is the HTTP method that specifies what operation will be done on the resource. For example, to get the details of a mailbox a HTTP GET will be done on /customers/12345678/domains/example.com/ex/mailboxes/john.smith. If the mailbox does not exist, a HTTP POST to the same URL with the necessary form data will add the mailbox. Then, a HTTP PUT to the same URL will edit mailbox. And to delete the mailbox, an HTTP DELETE would be used.&lt;br /&gt;
&lt;br /&gt;
The types of operations a certain method performs is outlined below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''HTTP Method''&lt;br /&gt;
!''Operations''&lt;br /&gt;
!''Response''&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2|GET&lt;br /&gt;
|Index - returns a list of the resources&lt;br /&gt;
|rowspan=2|XML or JSON formatted data&lt;br /&gt;
|-&lt;br /&gt;
|Show - returns the details of the resource&lt;br /&gt;
|-&lt;br /&gt;
|POST&lt;br /&gt;
|Add - adds a new resource&lt;br /&gt;
|rowspan=3|Response code and error message (if applicable) only&lt;br /&gt;
|-&lt;br /&gt;
|PUT&lt;br /&gt;
|Edit - changes the details of the resource&lt;br /&gt;
|-&lt;br /&gt;
|DELETE&lt;br /&gt;
|Delete - deletes the resource&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== HTTP Headers ====&lt;br /&gt;
&lt;br /&gt;
All requests to the API must then include HTTP headers with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Header Name''&lt;br /&gt;
!''Description''&lt;br /&gt;
!''Example Header Value''&lt;br /&gt;
|-&lt;br /&gt;
| Accept&lt;br /&gt;
| The requested content type (required for Index and Show actions). Fill this with either 'text/xml' or 'application/json'. See [[#Formats|Response Formats]]&lt;br /&gt;
| ''text/xml''&lt;br /&gt;
|-&lt;br /&gt;
| User-Agent&lt;br /&gt;
| An identifier you choose for your client software&lt;br /&gt;
| ''Rackspace Management Interface''&lt;br /&gt;
|-&lt;br /&gt;
| X-Api-Signature&lt;br /&gt;
| An authentication string explained in detail [[#X-Api-Signature_Header|here]]&lt;br /&gt;
| ''eGbq9/2hcZsRlr1JV1Pi:20010317143725:HKUn0aajpSDx7qqGK3vqzn3FglI=''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Form Data ====&lt;br /&gt;
&lt;br /&gt;
When using Add and Edit operations, the details of the resource are sent to the API server via HTTP form data. Your HTTP library should include methods for sending form data along with an HTTP request. The library should by default send the data in the HTTP request body using the 'application/x-www-form-urlencoded' data format.&lt;br /&gt;
&lt;br /&gt;
==== Index Filter/Search ====&lt;br /&gt;
&lt;br /&gt;
The results of Index actions can be filtered/searched. The index URLs can take either one of the query strings: &amp;quot;?startswith=xx&amp;quot; or &amp;quot;?contains=xx,&amp;quot; where &amp;quot;xx&amp;quot; is the key word. If the request specifies more than one of these two query strings, a 400 HTTP error will be returned. Different fields will be searched depending on the resource type, see below.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;quot;0-9&amp;quot; is a reserved key word for query string &amp;quot;startswith.&amp;quot; It represents any result starting with numbers.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Index Actions''&lt;br /&gt;
!''Where the key word will be searched''&lt;br /&gt;
|-&lt;br /&gt;
| Customer&lt;br /&gt;
| Customer name, account number, reference number&lt;br /&gt;
|-&lt;br /&gt;
| Domain&lt;br /&gt;
| Domain name&lt;br /&gt;
|-&lt;br /&gt;
| Mailbox&lt;br /&gt;
| Mailbox name, mailbox display name&lt;br /&gt;
|-&lt;br /&gt;
| Contact&lt;br /&gt;
| Contact display name, external email&lt;br /&gt;
|-&lt;br /&gt;
| Group&lt;br /&gt;
| Group name, group display name&lt;br /&gt;
|-&lt;br /&gt;
| Mobile Service&lt;br /&gt;
| Associated mailbox name, mailbox display name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Throttling ====&lt;br /&gt;
&lt;br /&gt;
The server limits the number of requests allowed per user in a certain period of time.  The number of requests made are logged per minute. Calls that were made correctly with a user's API key, but not completed for any reason, including those exceeding the throttle limit, are included in this count.&lt;br /&gt;
&lt;br /&gt;
If a user is over the throttling limit then a 403 HTTP code will be returned with an &amp;quot;Exceeded request limits&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Operation Category''&lt;br /&gt;
!''Request Limit''&lt;br /&gt;
|-&lt;br /&gt;
| GET&lt;br /&gt;
| 60 per minute&lt;br /&gt;
|-&lt;br /&gt;
| PUT, POST, DELETE&lt;br /&gt;
| 30 per minute&lt;br /&gt;
|-&lt;br /&gt;
| POST, PUT, DELETE on a domain&lt;br /&gt;
| 2 per minute&lt;br /&gt;
|-&lt;br /&gt;
| POST, DELETE on alternate domains&lt;br /&gt;
| 2 per minute&lt;br /&gt;
|-&lt;br /&gt;
| Enabling public folders for a domain&lt;br /&gt;
| 1 per 5 minutes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Examples ====&lt;br /&gt;
&lt;br /&gt;
Index of Exchange Mailboxes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Hypertext Transfer Protocol&lt;br /&gt;
    GET /v0/customers/12345678/domains/example.com/ex/mailboxes?size=100&amp;amp;offset=100 HTTP/1.1&lt;br /&gt;
    Host: api.emailsrvr.com&lt;br /&gt;
    User-Agent: Rackspace Management Interface&lt;br /&gt;
    X-Api-Signature: eGbq9/2hcZsRlr1JV1Pi:20010317143725:HKUn0aajpSDx7qqGK3vqzn3FglI=&lt;br /&gt;
    Accept: text/xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Adding New Exchange Mailbox:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Hypertext Transfer Protocol&lt;br /&gt;
    POST /v0/customers/12345678/domains/example.com/ex/mailboxes/john.smith HTTP/1.1&lt;br /&gt;
    Host: api.emailsrvr.com&lt;br /&gt;
    User-Agent: Rackspace Management Interface&lt;br /&gt;
    X-Api-Signature: eGbq9/2hcZsRlr1JV1Pi:20010317143725:HKUn0aajpSDx7qqGK3vqzn3FglI=&lt;br /&gt;
    Content-Length: 53&lt;br /&gt;
        [Content length: 53]&lt;br /&gt;
    Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
 &lt;br /&gt;
Line-based text data: application/x-www-form-urlencoded&lt;br /&gt;
    size=2048&amp;amp;displayName=John%20Smith&amp;amp;password=abcABC123&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Responses ===&lt;br /&gt;
&lt;br /&gt;
==== HTTP Status Code ====&lt;br /&gt;
&lt;br /&gt;
On a successfully executed request, a 200 HTTP Code is returned. If the request was unsuccessful however, an HTTP error code in the 400s or 500s will be returned.&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Body ====&lt;br /&gt;
&lt;br /&gt;
If the request is an Index or Show request, the request data will be returned in the format specified in the HTTP Body.&lt;br /&gt;
&lt;br /&gt;
===== Formats =====&lt;br /&gt;
&lt;br /&gt;
Requests for data (index and show requests) are returned with XML or JSON data based on what your application populates the [[#HTTP_Headers|HTTP Accept headers]] with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For XML, populate the header with 'text/xml' (ex: Headers![&amp;quot;Accept&amp;quot;] = &amp;quot;text/xml&amp;quot;). The XML document returned will conform to a published XSD (XML Schema Document). There are many ways to parse the data in an XML document, but we have found that the [http://www.w3schools.com/XPath/default.asp XPath] tree-style traversal has served our purposes. In any case, your application will likely need to use a class library for your chosen method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For JSON, populate the header with 'application/json' (ex: Headers![&amp;quot;Accept&amp;quot;] = &amp;quot;application/json&amp;quot;). As with XML, a library will likely be needed to parse the data.&lt;br /&gt;
&lt;br /&gt;
==== HTTP Headers ====&lt;br /&gt;
&lt;br /&gt;
The only data returned in the header is the error message (if any).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Header Name''&lt;br /&gt;
!''Description''&lt;br /&gt;
!''Example Header Value''&lt;br /&gt;
|-&lt;br /&gt;
| x-error-message&lt;br /&gt;
| The error message. See [[#Errors|Errors]].&lt;br /&gt;
| Missing required field: name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Errors ====&lt;br /&gt;
&lt;br /&gt;
When an error occurs, the system will return an HTTP error response code denoting the type of error. The system will also return additional information about the fault in the body of the response.&lt;br /&gt;
&lt;br /&gt;
'''Example Fault Response – XML'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;appsFault code=&amp;quot;500&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;message&amp;gt;Fault!&amp;lt;/message&amp;gt;&lt;br /&gt;
  &amp;lt;details&amp;gt;Error Details...&amp;lt;/details&amp;gt;&lt;br /&gt;
&amp;lt;/appsFault&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example Fault Response – JSON'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;appsFault&amp;quot; : {&lt;br /&gt;
    &amp;quot;code&amp;quot; : 500,&lt;br /&gt;
    &amp;quot;message&amp;quot; : &amp;quot;Fault!&amp;quot;,&lt;br /&gt;
    &amp;quot;details&amp;quot; : &amp;quot;Error Details...&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error code is returned in the body of the response for convenience. The message section returns a human-readable message that is appropriate for display to the end user. The details section is optional and may contain information—for example, a stack trace—to assist in tracking down an error. The detail section may or may not be appropriate for display to an end user.&lt;br /&gt;
The root element of the fault (e.g. appsFault) may change depending on the type of error. The following is a list of possible common root elements along with their associated error codes.  More specific faults may be may exist for different resources and will be documented with those resources.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Fault Element''&lt;br /&gt;
!''Error Codes''&lt;br /&gt;
!''Custom Fields''&lt;br /&gt;
|-&lt;br /&gt;
|appsFault&lt;br /&gt;
|500, 400, and other codes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|itemNotFound&lt;br /&gt;
|404&lt;br /&gt;
|resourceType - What resource in the request that was not found (Domain, Mailbox, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|unauthorized&lt;br /&gt;
|403&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|badRequest&lt;br /&gt;
|400&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From an XML schema perspective, all API faults are extensions of the base fault type AppsAPIFault. When working with a system that binds XML to actual classes (such as JAXB), one should be capable of using AppsAPIFault as a “catch-all” if there's no interest in distinguishing between individual fault types.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''X-Error-Message Header'''&lt;br /&gt;
&lt;br /&gt;
Prior to faults in the body of HTTP responses, the only information returned to users was the HTTP status code and an HTTP header x-error-message with the error message.  This functionality has been kept for backwards compatibility but retrieving fault information in the HTTP body is the recommended approach for new applications.&lt;br /&gt;
&lt;br /&gt;
==== Paging ====&lt;br /&gt;
&lt;br /&gt;
The results of Index actions are split into pages to lessen potentially high resource usage. The index URLs have a query string with parameters in the format &amp;quot;?size=xx&amp;amp;offset=xx.&amp;quot; If a query parameter is omitted, the default value is used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Query Parameter''&lt;br /&gt;
!''Default''&lt;br /&gt;
!''Maximum''&lt;br /&gt;
!''Notes''&lt;br /&gt;
|-&lt;br /&gt;
| size&lt;br /&gt;
| 50&lt;br /&gt;
| 250&lt;br /&gt;
| This is the number of elements per page.&lt;br /&gt;
|-&lt;br /&gt;
| offset&lt;br /&gt;
| 0&lt;br /&gt;
| N/A&lt;br /&gt;
| This is the number of items to offset away from the first item in the list.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example =====&lt;br /&gt;
&lt;br /&gt;
A PHP Example of paging can be found [[PHP_Examples_(Rest_API)| here]].&lt;br /&gt;
&lt;br /&gt;
==== Examples ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Cache-Control: private&lt;br /&gt;
Content-Type: text/xml; charset=utf-8&lt;br /&gt;
Server: Microsoft-IIS/7.0&lt;br /&gt;
Date: Fri, 04 Dec 2009 19:08:11 GMT&lt;br /&gt;
Content-Length: 430&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;domainList xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns=&amp;quot;urn:xml:domainList&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;offset&amp;gt;0&amp;lt;/offset&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;50&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;total&amp;gt;1&amp;lt;/total&amp;gt;&lt;br /&gt;
  &amp;lt;domains&amp;gt;&lt;br /&gt;
    &amp;lt;domain&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;customer.com&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;accountNumber&amp;gt;123456&amp;lt;/accountNumber&amp;gt;&lt;br /&gt;
      &amp;lt;serviceType&amp;gt;rsemail&amp;lt;/serviceType&amp;gt;&lt;br /&gt;
    &amp;lt;/domain&amp;gt;&lt;br /&gt;
  &amp;lt;/domains&amp;gt;&lt;br /&gt;
&amp;lt;/domainList&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 404 Not Found&lt;br /&gt;
Cache-Control: private&lt;br /&gt;
Server: Microsoft-IIS/7.0&lt;br /&gt;
x-error-message: Customer Not Found&lt;br /&gt;
Date: Fri, 04 Dec 2009 19:13:59 GMT&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 400 Bad Request&lt;br /&gt;
Cache-Control: private&lt;br /&gt;
Server: Microsoft-IIS/7.0&lt;br /&gt;
x-error-message: Missing required field: type&lt;br /&gt;
Date: Fri, 04 Dec 2009 19:17:29 GMT&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Ruby ===&lt;br /&gt;
&lt;br /&gt;
This examples is written in [http://www.ruby-lang.org/en/ Ruby]. To make the examples shorter, helper methods have been written. These methods are part of a NetMethods module. The contents of the NetMethods module is listed below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require  'server.rb'&lt;br /&gt;
&lt;br /&gt;
server = Server.new&lt;br /&gt;
&lt;br /&gt;
response = server.get  '/customers', server.xml_format&lt;br /&gt;
&lt;br /&gt;
#fields = Hash['serviceType' =&amp;gt;  'exchange', 'exchangeMaxNumMailboxes' =&amp;gt; '4']&lt;br /&gt;
#response =  server.post '/customers/me/domains/newdomain.com', fields&lt;br /&gt;
&lt;br /&gt;
puts response.code&lt;br /&gt;
puts response['x-error-message']&lt;br /&gt;
puts response.body&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'test/unit/assertions'&lt;br /&gt;
require 'net/http'&lt;br /&gt;
require 'date'&lt;br /&gt;
require 'date/format'&lt;br /&gt;
require 'digest/sha1'&lt;br /&gt;
require 'base64'&lt;br /&gt;
require 'time'&lt;br /&gt;
&lt;br /&gt;
class Server&lt;br /&gt;
  include Test::Unit::Assertions&lt;br /&gt;
  &lt;br /&gt;
  def initialize(server='api.emailsrvr.com', version_prefix='/v0', user_key='xxxxxxxxxxxxxxxxxxxx', secret_hash='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')&lt;br /&gt;
    @server = server&lt;br /&gt;
    @version_prefix = version_prefix&lt;br /&gt;
    @user_key = user_key&lt;br /&gt;
    @secret_hash = secret_hash&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
# Response Type Enums&lt;br /&gt;
&lt;br /&gt;
  def xml_format&lt;br /&gt;
    'text/xml'&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def json_format&lt;br /&gt;
    'application/json'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# HTTP Request Verbs&lt;br /&gt;
#  &lt;br /&gt;
  def get(url_string, format)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    headers = prepared_headers&lt;br /&gt;
    headers['Accept'] = format&lt;br /&gt;
    request = Net::HTTP::Get.new(request_uri(uri), headers)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def delete(url_string)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    request = Net::HTTP::Delete.new(request_uri(uri), prepared_headers)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def put(url_string, fields_hash)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    request = Net::HTTP::Put.new(request_uri(uri), prepared_headers)&lt;br /&gt;
    request.set_form_data(fields_hash)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def post(url_string, fields_hash)&lt;br /&gt;
    uri = full_uri(url_string)&lt;br /&gt;
    request = Net::HTTP::Post.new(request_uri(uri), prepared_headers)&lt;br /&gt;
    request.set_form_data(fields_hash)&lt;br /&gt;
    http_response = make_request request, uri&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
#&lt;br /&gt;
# HTTP Request Helpers&lt;br /&gt;
# &lt;br /&gt;
  def make_request request, uri&lt;br /&gt;
    response = Net::HTTP::start(uri.host, uri.port)  do |http|&lt;br /&gt;
      http.request request&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    response&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def full_uri url_string&lt;br /&gt;
    URI.parse('http://' + @server + @version_prefix + url_string)&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def request_uri uri&lt;br /&gt;
    request = uri.path&lt;br /&gt;
    if ! uri.query.nil?&lt;br /&gt;
      request = request + '?' + uri.query&lt;br /&gt;
    end&lt;br /&gt;
    request&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def prepared_headers&lt;br /&gt;
    headers = Hash.new&lt;br /&gt;
    headers.merge! headers_auth_creds(@user_key, @secret_hash)&lt;br /&gt;
    headers['Accept'] = xml_format&lt;br /&gt;
    headers&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def headers_auth_creds apiKey, secretKey&lt;br /&gt;
    userAgent = 'Ruby Test Client'&lt;br /&gt;
    timestamp = DateTime.now.strftime('%Y%m%d%H%M%S')&lt;br /&gt;
    &lt;br /&gt;
    data_to_sign = apiKey + userAgent + timestamp + secretKey&lt;br /&gt;
    &lt;br /&gt;
    hash = Base64.encode64(Digest::SHA1.digest(data_to_sign))&lt;br /&gt;
    signature = apiKey + &amp;quot;:&amp;quot; + timestamp + &amp;quot;:&amp;quot; + hash&lt;br /&gt;
    &lt;br /&gt;
    headers = Hash['User-Agent' =&amp;gt; userAgent, 'X-Api-Signature' =&amp;gt; signature]&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C# ===&lt;br /&gt;
&lt;br /&gt;
This examples is written in [http://msdn.microsoft.com/en-us/vcsharp/default.aspx C#].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Specialized;&lt;br /&gt;
using System.Security.Cryptography;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Net;&lt;br /&gt;
&lt;br /&gt;
public class WebMethods&lt;br /&gt;
{&lt;br /&gt;
  private WebClientBase client;&lt;br /&gt;
  private string baseUrl;&lt;br /&gt;
  private string apiKey;&lt;br /&gt;
  private string secretKey;&lt;br /&gt;
&lt;br /&gt;
  public WebMethods(WebClientBase client, string baseUrl, string apiKey, string secretKey)&lt;br /&gt;
  {&lt;br /&gt;
    this.client = client;&lt;br /&gt;
    this.baseUrl = baseUrl;&lt;br /&gt;
    this.apiKey = apiKey;&lt;br /&gt;
    this.secretKey = secretKey;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public virtual string Get(string url)&lt;br /&gt;
  {&lt;br /&gt;
    return MakeRemoteCall((client) =&amp;gt;&lt;br /&gt;
      {&lt;br /&gt;
        return client.DownloadString(baseUrl + url);&lt;br /&gt;
      },&lt;br /&gt;
      format);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public virtual string Post(string url, NameValueCollection data)&lt;br /&gt;
  {&lt;br /&gt;
    return MakeRemoteCall((client) =&amp;gt;&lt;br /&gt;
      {&lt;br /&gt;
        var bytes = client.UploadValues(baseUrl + url, data);&lt;br /&gt;
        return Encoding.UTF8.GetString(bytes);&lt;br /&gt;
      },&lt;br /&gt;
      format);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private void SignMessage()&lt;br /&gt;
  {&lt;br /&gt;
    var userAgent = &amp;quot;C# Client Library&amp;quot;;&lt;br /&gt;
    client.Headers[&amp;quot;User-Agent&amp;quot;] = userAgent;&lt;br /&gt;
&lt;br /&gt;
    var dateTime = DateTime.UtcNow.ToString(&amp;quot;yyyyMMddHHmmss&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    var dataToSign = apiKey + userAgent + dateTime + secretKey;&lt;br /&gt;
    var hash = SHA1.Create();&lt;br /&gt;
    var signedBytes = hash.ComputeHash(Encoding.UTF8.GetBytes(dataToSign));&lt;br /&gt;
    var signature = Convert.ToBase64String(signedBytes);&lt;br /&gt;
&lt;br /&gt;
    client.Headers[&amp;quot;X-Api-Signature&amp;quot;] = apiKey + &amp;quot;:&amp;quot; + dateTime + &amp;quot;:&amp;quot; + signature;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private void AssignFormat(string format)&lt;br /&gt;
  {&lt;br /&gt;
    client.Headers[&amp;quot;Accept&amp;quot;] = format;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private string MakeRemoteCall(Func&amp;lt;WebClientBase, string&amp;gt; remoteCall, string format)&lt;br /&gt;
  {&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
      SignMessage();&lt;br /&gt;
      AssignFormat(format);&lt;br /&gt;
      return remoteCall.Invoke(client);&lt;br /&gt;
    }&lt;br /&gt;
    catch (WebException e)&lt;br /&gt;
    {&lt;br /&gt;
      throw new ApiException(e);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
&lt;br /&gt;
The PHP Example can be found [[PHP_Examples_(Rest_API)| here]].&lt;/div&gt;</summary>
		<author><name>Subir.jolly</name></author>	</entry>

	<entry>
		<id>http://api-wiki.apps.rackspace.com/api-wiki/index.php?title=Rackspace_Alias(Rest_API)&amp;diff=448</id>
		<title>Rackspace Alias(Rest API)</title>
		<link rel="alternate" type="text/html" href="http://api-wiki.apps.rackspace.com/api-wiki/index.php?title=Rackspace_Alias(Rest_API)&amp;diff=448"/>
				<updated>2011-08-11T16:24:46Z</updated>
		
		<summary type="html">&lt;p&gt;Subir.jolly: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Index ==&lt;br /&gt;
&lt;br /&gt;
''URL'': &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[GET] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)&lt;br /&gt;
        /rs/aliases/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Description'':&lt;br /&gt;
&lt;br /&gt;
Shows a list of aliases for the Rackspace domain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Remarks'':&lt;br /&gt;
&lt;br /&gt;
The show operation only supports the GET HTTP verb. For .xml format refer to the following schema document: [http://api.emailsrvr.com/v0/Schemas/RSAliasList.xsd RSAliasList.xsd]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Example'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
get '/customers/12345678/domains/example.com/rs/aliases', 'text/xml'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''XML Result Example'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;aliasList xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns=&amp;quot;urn:xml:aliasList&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;aliases&amp;gt;&lt;br /&gt;
    &amp;lt;alias&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;alias1&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;numberOfMembers&amp;gt;3&amp;lt;/numberOfMembers&amp;gt;&lt;br /&gt;
    &amp;lt;/alias&amp;gt;&lt;br /&gt;
  &amp;lt;/aliases&amp;gt;&lt;br /&gt;
&amp;lt;/aliasList&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Json Result Example'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&amp;quot;aliases&amp;quot;:[{&amp;quot;name&amp;quot;:&amp;quot;alias1&amp;quot;,&amp;quot;numberOfMembers&amp;quot;:3}]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add ==&lt;br /&gt;
&lt;br /&gt;
''URL'': &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[POST] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)&lt;br /&gt;
        /rs/aliases/(alias name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Description'':&lt;br /&gt;
&lt;br /&gt;
Creates an alias.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Field Name''&lt;br /&gt;
!''Description''&lt;br /&gt;
|-&lt;br /&gt;
| aliasEmails&lt;br /&gt;
| Comma separated list of domain and non-domain emails.&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
''Example'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
post '/customers/100018/domains/resellerallservices.net/rs/aliases/alias1',&lt;br /&gt;
{'aliasEmails'=&amp;gt;'jane.doe@resellerallservices.net, joe.schmoe@resellerallservices.net,e1@yahoo.com, e2@gmail.com'&lt;br /&gt;
},&lt;br /&gt;
Formats.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Remarks'':&lt;br /&gt;
Currently there is a limit of 50 domain emails and 4 non-domain emails.&lt;br /&gt;
&lt;br /&gt;
''Errors'': &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Description''&lt;br /&gt;
!''HTTP Response Code''&lt;br /&gt;
!''Sample Message''&lt;br /&gt;
|-&lt;br /&gt;
| Non-existent domain email address.&lt;br /&gt;
| 400&lt;br /&gt;
| An alias must point to a valid email address. The following email addresses do not exist: a@resellerallservices.net&lt;br /&gt;
|-&lt;br /&gt;
| Empty domain email list and non-domain email list.&lt;br /&gt;
| 400&lt;br /&gt;
| An alias must point to a valid email address.&lt;br /&gt;
|-&lt;br /&gt;
| More than four non-domain email addresses specified. &lt;br /&gt;
| 400&lt;br /&gt;
| Max number of non-local email recipients reached.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Show ==&lt;br /&gt;
&lt;br /&gt;
''URL'':&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[GET] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)&lt;br /&gt;
        /rs/mailboxes/(mailbox name)/alias/(alias name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Description'':&lt;br /&gt;
&lt;br /&gt;
Returns detailed information about the specified alias.&lt;br /&gt;
&lt;br /&gt;
''Remarks'':&lt;br /&gt;
&lt;br /&gt;
The show operation only supports the GET HTTP verb. For .xml format refer to the following schema document: [http://api.emailsrvr.com/v0/Schemas/RSAliasInfo.xsd RSAliasInfo.xsd]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Example'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
get '/customers/100018/domains/resellerallservices.net/rs/aliases/alias1', Formats.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''XML Result Example'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;alias xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns=&amp;quot;urn:xml:alias&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;alias1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;emailAddressList&amp;gt;&lt;br /&gt;
      &amp;lt;emailAddress&amp;gt;jane.doe@resellerallservices.net&amp;lt;/emailAddress&amp;gt;&lt;br /&gt;
      &amp;lt;emailAddress&amp;gt;e3@yahoo.com&amp;lt;/emailAddress&amp;gt;&lt;br /&gt;
  &amp;lt;/emailAddressList&amp;gt;&lt;br /&gt;
&amp;lt;/alias&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Json Result Example'':&lt;br /&gt;
&lt;br /&gt;
{&amp;quot;emailAddressList&amp;quot;:{&amp;quot;emailAddress&amp;quot;:[&amp;quot;jane.doe@resellerallservices.net&amp;quot;,&amp;quot;e3@yahoo.com&amp;quot;]},&amp;quot;name&amp;quot;:&amp;quot;alias3&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
''Errors'': &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Description''&lt;br /&gt;
!''HTTP Response Code''&lt;br /&gt;
!''Sample Message''&lt;br /&gt;
|-&lt;br /&gt;
| Non-existent alias.&lt;br /&gt;
| 404&lt;br /&gt;
| Resource not found.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Delete ==&lt;br /&gt;
&lt;br /&gt;
''URL'':&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[DELETE] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)&lt;br /&gt;
            /rs/aliases/(alias name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Description'':&lt;br /&gt;
&lt;br /&gt;
Deletes the alias.&lt;br /&gt;
&lt;br /&gt;
''Example'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
delete '/customers/100018/domains/resellerallservices.net/rs/aliases/alias1', Formats.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Errors'': &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Description''&lt;br /&gt;
!''HTTP Response Code''&lt;br /&gt;
!''Sample Message''&lt;br /&gt;
|-&lt;br /&gt;
| Non-existent alias.&lt;br /&gt;
| 404&lt;br /&gt;
| Resource not found.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Add Email Address to Alias List ==&lt;br /&gt;
&lt;br /&gt;
''URL'':&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Adding an email address to a alias.&lt;br /&gt;
[POST] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)&lt;br /&gt;
        /rs/aliases/(alias name)/(email address)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Description'':&lt;br /&gt;
&lt;br /&gt;
Adds an email address to the domain email list or to the non-domain email list. &lt;br /&gt;
&lt;br /&gt;
''Example'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
post '/customers/100018/domains/resellerallservices.net/rs/aliases/alias1/joe.schmoe@resellerallservices.net', {}, Formats.xml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Errors'': &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Description''&lt;br /&gt;
!''HTTP Response Code''&lt;br /&gt;
!''Sample Message''&lt;br /&gt;
|-&lt;br /&gt;
| Non-existent email address in the alias.&lt;br /&gt;
| 400&lt;br /&gt;
| An alias must point to a valid email address. The following email addresses do not exist: a@resellerallservices.net&lt;br /&gt;
|-&lt;br /&gt;
| More than four non-domain email addresses specified. &lt;br /&gt;
| 400&lt;br /&gt;
| Max number of non-local email recipients reached.&lt;br /&gt;
|-&lt;br /&gt;
| Non existent alias. &lt;br /&gt;
| 404&lt;br /&gt;
| Resource not found.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Delete Email Address From Alias List ==&lt;br /&gt;
&lt;br /&gt;
''URL'':&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Deleting an email address from an alias.&lt;br /&gt;
[DELETE] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)&lt;br /&gt;
        /rs/aliases/(alias name)/(email address)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Description'':&lt;br /&gt;
&lt;br /&gt;
Deletes an email address from the domain email list or from the non-domain email list.&lt;br /&gt;
&lt;br /&gt;
''Example'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
delete '/customers/100018/domains/resellerallservices.net/rs/aliases/alias1/joe.schmoe@resellerallservices.net', {}, Formats.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Errors'': &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Description''&lt;br /&gt;
!''HTTP Response Code''&lt;br /&gt;
!''Sample Message''&lt;br /&gt;
|-&lt;br /&gt;
| Non existent alias. &lt;br /&gt;
| 404&lt;br /&gt;
| Resource not found.&lt;br /&gt;
|-&lt;br /&gt;
| Non existent email address in the alias.&lt;br /&gt;
| 404&lt;br /&gt;
| Email address jane.doe@resellerallservices.net does not exist in alias alias1.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Bulk Modify Alias List ==&lt;br /&gt;
&lt;br /&gt;
''URL'':&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
[PUT] https://api.emailsrvr.com/v0/customers/(account number)/domains/(domain name)/rs/aliases/(alias name)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Description'':&lt;br /&gt;
&lt;br /&gt;
You can modify an existing alias by replacing its contents with the new email addresses specified in the field aliasEmails. The following list shows the number of email addresses you can specify:&lt;br /&gt;
&lt;br /&gt;
* 1 - 50 domain email addresses&lt;br /&gt;
* 1 - 4 non-domain addresses&lt;br /&gt;
&lt;br /&gt;
You must specify at least one email address. By default, the maximum combined total of email addresses you can specify is 50.&lt;br /&gt;
&lt;br /&gt;
You cannot delete a specific email address using DELETE. If you use DELETE with this operation, the entire alias is deleted.&lt;br /&gt;
&lt;br /&gt;
''Form Fields:''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Field Name''&lt;br /&gt;
!''Data Type''&lt;br /&gt;
!''Description''&lt;br /&gt;
|-&lt;br /&gt;
| aliasEmail &lt;br /&gt;
| string&lt;br /&gt;
| A comma separated list of email addresses.&lt;br /&gt;
|-&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
''Example'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
put '/customers/100487/domains/testdomain.com/rs/aliases/alias_name',&lt;br /&gt;
    { aliasEmails=email@outsider.com,abc@yahoo.com,user1@domain.com, user2@domain.com }, &lt;br /&gt;
    'text/xml'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Errors'': &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!''Description''&lt;br /&gt;
!''HTTP Response Code''&lt;br /&gt;
!''Sample Message''&lt;br /&gt;
|-&lt;br /&gt;
| Modify Invalid Alias&lt;br /&gt;
| 404&lt;br /&gt;
| Entity of type Alias identified by user3@domain.com was not found.&lt;br /&gt;
|-&lt;br /&gt;
| Modify Valid Alias With No Email Address&lt;br /&gt;
| 400&lt;br /&gt;
| An alias must point to a valid email address. &lt;br /&gt;
|-&lt;br /&gt;
| Modify Valid Alias With Non Existing Email Address(es)&lt;br /&gt;
| 404&lt;br /&gt;
| An alias must point to a valid email address. The following email addresses do not exist: user@domain.com.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Subir.jolly</name></author>	</entry>

	</feed>