Difference between revisions of "Domain (Rest API)"

From Rackspace Email & Apps API
Jump to: navigation, search
(No difference)

Revision as of 13:31, 20 November 2009


Index

URL:

[GET] http://api.emailsrvr.com/v0/customers/(customer account number)/domains


Description:

This operation returns a list of domains under the account. If a customer account is specified, then a list of domains under that specific account will be returned.


Remarks:

To retrieve a list of domains owned by the account that is logged in, use "me" as the customer account number i.e. 'http://api.emailsrvr.com/v0/customers/me/domains'. To retrieve a list of domains owned by all customer sub-accounts and your own account, use "all" as the customer account number.

The index operation only supports the GET HTTP verb. For text/xml format, refer to the following schema document: DomainList.xsd


Example:

get '/customers/all/domains?size=100&page=1', 'text/xml'


XML Result Example:

<?xml version="1.0" encoding="utf-8"?>
<domainList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:domainList">
  <offset>0</offset>
  <size>50</size>
  <total>3</total>
  <domains>
    <domain>
      <name>apidomain53.com</name>
      <accountNumber>100000</accountNumber>
      <serviceType>both</serviceType>
    </domain>
    <domain>
      <name>apidomain66.com</name>
      <accountNumber>100001</accountNumber>
      <serviceType>both</serviceType>
    </domain>
    <domain>
      <name>apidomain68.com</name>
      <accountNumber>100002</accountNumber>
      <serviceType>both</serviceType>
    </domain>
  </domains>
</domainList>


Json Result Example:

{"offset":0,"size":50,"total":3,"domains":[{"name":"apidomain53.com","accountNumber":"100000","serviceType":"both"},{"name":"apidomain66.com","accountNumber":"100001","serviceType":"both"},{"name":"apidomain68.com","accountNumber":"100002","serviceType":"both"}]}


Errors:

Description HTTP Response Code Sample Message
Format is invalid 406 Invalid format
Customer account number is invalid 404 Invalid account number


Show

URL:

[GET] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)


Description:

The show operation will return detailed information about the specified domain name.


Remarks:

The show operation only supports the GET HTTP verb. For text/xml format, refer to the following schema document: Domain.xsd


Example:

get '/customers/999999/domains/example.com', 'text/xml'

XML Result Example:

<?xml version="1.0" encoding="utf-8"?>
<domain xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:domain">
  <name>apidomain66.com</name>
  <accountNumber>100000</accountNumber>
  <serviceType>both</serviceType>
  <exchangeBaseMailboxSize>2048</exchangeBaseMailboxSize>
  <exchangeUsedStorage>0</exchangeUsedStorage>
  <exchangeTotalStorage>18432</exchangeTotalStorage>
  <exchangeExtraStorage>10240</exchangeExtraStorage>
  <exchangeMaxNumMailboxes>4</exchangeMaxNumMailboxes>
  <rsEmailBaseMailboxSize>2048</rsEmailBaseMailboxSize>
  <rsEmailMaxNumberMailboxes>4</rsEmailMaxNumberMailboxes>
  <rsEmailExtraStorage>10240</rsEmailExtraStorage>
  <rsEmailUsedStorage>0</rsEmailUsedStorage>
  <aliases />
  <hasArchivingService>false</hasArchivingService>
  <hasBlackBerryMobileService>true</hasBlackBerryMobileService>
  <blackBerryLicenses>4</blackBerryLicenses>
  <hasActivesyncMobileService>true</hasActivesyncMobileService>
  <activeSyncLicenses>4</activeSyncLicenses>
  <hasGoodmobileMobileService>true</hasGoodmobileMobileService>
  <goodmobileLicenses>4</goodmobileLicenses>
</domain>


Json Result Example:

{"name":"apidomain66.com","accountNumber":"200001","serviceType":"both","exchangeBaseMailboxSize":2048,"exchangeUsedStorage":0,"exchangeTotalStorage":18432,"exchangeExtraStorage":10240,"exchangeMaxNumMailboxes":4,"rsEmailBaseMailboxSize":2048,"rsEmailMaxNumberMailboxes":4,"rsEmailExtraStorage":10240,"rsEmailUsedStorage":0,"aliases":[],"hasArchivingService":false,"hasBlackBerryMobileService":true,"blackBerryLicenses":4,"hasActivesyncMobileService":true,"activeSyncLicenses":4,"hasGoodmobileMobileService":true,"goodmobileLicenses":4}


Errors:

Description HTTP Response Code Sample Message
Format is invalid 406 Invalid format
Domain is not found 404 abc.com not found


Add/Edit

URL:

 Add: [POST] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)
 Edit: [PUT] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)
 


Description:

Adds/edits a new domain to the account with the data specified. To add a domain to your own account, use your own account id.


Field Name Data Type Description
serviceType string Domain service type. "rsemail" = "Rackspace Email Only". "exchange" = "Exchange Only". "both" = "Rackspace Email and Exchange"
exchangeExtraStorage int Exchange service extra storage in megabytes
exchangeMaxNumMailboxes int Maximum number of mailboxes allowed under the domain Exchange service. Required for Adding Exchange service
rsEmailBaseMailboxSize int Rackspace Email base mailbox size in megabytes
rsEmailMaxNumberMailboxes int Maximum number of mailboxes allowed under the domain Rackspace Email service. Required for Adding Rackspace Email service
rsEmailExtraStorage int Rackspace Email service extra storage in megabytes
blackberry boolean Enable or disable domain BlackBerryMobile service
blackberryLicenses int Maximum number of mailboxes allowed to have BlackBerryMobile service. 0 means unlimited
activesync boolean Enable or disable domain ActiveSyncMobile service
activesyncLicenses int Maximum number of mailboxes allowed to have ActiveSyncMobile service. 0 means unlimited
goodmobile boolean Enable or disable domain GoodMobile service
goodmobileLicenses int Maximum number of mailboxes allowed to have GoodMobile service. 0 means unlimited
hasArchivingService boolean Enable or disable domain archiving service


Example:

post '/customers/123455/domains/newcompany.com', 'text/xml',
{
  'maxNumMailboxes' => '5',
  'extraStorage' => '1024'  
}
put '/customers/123455/domains/newcompany.com', 'text/xml',
{
  'maxNumMailboxes' => '25',
  'extraStorage' => '2048'  
}


Errors:

Description HTTP Response Code Sample Message
Format is invalid 406 Invalid format
Customer account number is invalid 404 Invalid account number
Form data has unrecognized field 400 Unrecognized field: size
Required form field is missing 400 Missing required field: maxNumMailboxes
Required form field has null or empty string input 400 Required field name cannot be empty
Integer form field has non-integer input 400 Invalid format for maxNumMailboxes, input must be an integer
New domain name doesn't meet the naming requirements 400 Invalid domain name
New domain name already exists 400 abc.com already exists as a domain or alternate domain


Move

URL:

[PUT] http://api.emailsrvr.com/v0/customers/(new customer account number)/domains/(domain name)


Description:

Moves the domain to another customer account.


Field Name Data Type Description
moveDomain boolean Indicate whether or not moving the domain


Remarks:

Note 'Move Domain' and 'Edit Domain' share the same URI and HTTP verb. When the domain doesn't belong to the customer and 'moveDomain' is set to 'true', API will take the request as a 'Move Domain' call.


Example:

put '/customers/123456/domains/newcompany.com', 'text/xml',
{
  'moveDomain' => 'true'
}


Errors:

Description HTTP Response Code Sample Message
Format is invalid 406 Invalid format
Domain is not found 404 abc.com not found
Customer is not found 404 Customer not found


Delete

URL:

[DELETE] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)


Description:

Deletes the domain.


Remarks:

The domain and all the mailboxes, mailbox contents, groups, and contacts are deleted permanently.


Example:

delete '/customers/12345678/domains/newcompany.com', 'text/xml'


Errors:

Description HTTP Response Code Sample Message
Format is invalid 406 Invalid format
Domain is not found 404 abc.com not found


Archiving SSO Login URL

URL:

[GET] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain)/archivingSSOLoginURL


Description:

Gets the domain archiving service SSO login URL.


Remarks:

The retrieved URL can be used in browser to access the domain archiving control panel.


Example:

get '/customers/12345678/domains/company.com/archivingSSOLoginURL', 'text/xml'


Errors:

Description HTTP Response Code Sample Message
Format is invalid 406 Invalid format
Domain is not found 404 abc.com not found
No archiving service 404 Domain abc.com has no archiving service enabled